Public report of oliverbob/ginto.ai, published 17 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 17 November 2026, 20:35 UTC · Survey ID cd_83e9401180484821b179107b03dcf373

oliverbob/ginto.ai

Measured 17 November 2026, 20:27 UTC, at code version 26df575

First survey, so nothing to compare with yet
CAI score 29.0out of 100 At risk

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 215,154 lines of product code in 7 projects, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Code Health, 12.3

Findings by how serious they are

149 critical 2381 serious 179 minor

16 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 20:27 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

71of 71 dimensions measured by tools.
2695of 2709 findings point to an exact file and line, so you can open each one in the code. The other 14 concern the repository as a whole, such as missing documentation.
71dimensions across 7 lenses, read from 215,154 lines of product code in 7 projects.
Chapters

Executive summary

oliverbob/ginto.ai is rated At risk because critical security findings are open, most of them in the packages it uses. It scores 29.0 out of 100, which the At risk rating leaves unchanged.

Code Health, at 12.3, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 5.3 points. Adding type checking would lift Code Health itself, worth about 2.8 points. Raising Code Health to 70 would lift the score to about 42.7.

Twenty-one known security holes in the packages the code depends on can be used by attackers. Ten weaknesses in the code could be used by an attacker, and thirty-three controls can't be used without a mouse. Updating the vulnerable packages, fixing the weaknesses the scanner points to and making the controls work with a keyboard would close these risks. The seven unsafe settings in infrastructure or container files need changing to safe values. The place where the code runs text as code or as a command needs a direct call instead. The 21 form fields without a label need a label.

The product code is 215,154 lines, about €180,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 12.3 · counts for 46%Production Readiness 26.9 · counts for 25%Accessibility 43.1 · counts for 14%Security and Compliance 62.4 · counts for 8%Maturity 62.5 · counts for 4%Architecture 89.2 · counts for 2%Performance 100.0 · counts for 1%

If Code Health rose from 12.3 to 70, the lowest score rated Strong, the score would rise from 29.0 to about 42.7.

Code composition: what the lines of code are
Product code 100%Tests 0%
Rebuild cost: about €180,000 · Estimate
Cost to rebuild€61,000 to €310,000, for 1,016 to 3,224 hours of work, about 1.3 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 29. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 215,154 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 5.3 points · Low effort · REDACTED Scanning
2
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 2.8 points · Medium effort · Type Safety
3
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.
Raises the score by about 2.8 points · Medium effort · Code Duplication

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €180,000 to build again, about 1.3 person-years of work. Its weakest lens is Code Health, at 12.3 (Critical). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5.3 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 17% on every change. The history of the code shows how much it changes: about 416,406 lines over the last 90 days, which is about 1,688,758 lines a year. At that pace, the extra work comes to an estimated 321.8 to 1931 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

144 modules, with 26 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 104 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 (global)2 App.Core.LLM3 App.Handlers4 App.Middleware5 App.Models6 App.WebSocket7 Core8 Ginto.Core9 Ginto.Helpers10 Ginto.Middleware11 Ginto.Models12 Ginto.Security13 Ginto.Sites14 public.lib.novnc.core.decoders.tight15 public.lib.novnc.core.util.eventtarget16 tools.sdcpu.src.api_server17 tools.sdcpu.src.app_settings18 tools.sdcpu.src.backend.api.models.response19 tools.sdcpu.src.backend.gguf.sdcpp_types20 tools.sdcpu.src.backend.models.gen_images21 tools.sdcpu.src.backend.models.lcmdiffusion_setting22 tools.sdcpu.src.models.interface_types23 tools.sdcpu.src.state24 App.Controllers25 App.Core26 App.Core.LLM.Providers27 Ginto.Services28 Ginto.Sites.Vision29 public.lib.novnc.core.decoders.tightpng30 public.lib.novnc.core.ra231 public.lib.novnc.core.rfb32 tools.sdcpu.src.backend.api33 tools.sdcpu.src.backend.gguf.gguf_diffusion34 tools.sdcpu.src.backend.image_saver35 tools.sdcpu.src.backend.lcm_text_to_image36 tools.sdcpu.src.models.settings37 Ginto.Controllers38 Ginto.Handlers39 tools.sdcpu.src.context40 tools.sdcpu.src
1 (global)
2 App.Core.LLM
3 App.Handlers
4 App.Middleware
5 App.Models
6 App.WebSocket
7 Core
8 Ginto.Core
9 Ginto.Helpers
10 Ginto.Middleware
11 Ginto.Models
12 Ginto.Security
13 Ginto.Sites
14 public.lib.novnc.core.decoders.tight
15 public.lib.novnc.core.util.eventtarget
16 tools.sdcpu.src.api_server
17 tools.sdcpu.src.app_settings
18 tools.sdcpu.src.backend.api.models.response
19 tools.sdcpu.src.backend.gguf.sdcpp_types
20 tools.sdcpu.src.backend.models.gen_images
21 tools.sdcpu.src.backend.models.lcmdiffusion_setting
22 tools.sdcpu.src.models.interface_types
23 tools.sdcpu.src.state
24 App.Controllers25
25 App.Core2
26 App.Core.LLM.Providers6
27 Ginto.Services3
28 Ginto.Sites.Vision2
29 public.lib.novnc.core.decoders.tightpng1
30 public.lib.novnc.core.ra21
31 public.lib.novnc.core.rfb1
32 tools.sdcpu.src.backend.api11
33 tools.sdcpu.src.backend.gguf.gguf_diffusion4
34 tools.sdcpu.src.backend.image_saver1
35 tools.sdcpu.src.backend.lcm_text_to_image1
36 tools.sdcpu.src.models.settings11
37 Ginto.Controllers3515
38 Ginto.Handlers2
39 tools.sdcpu.src.context11
40 tools.sdcpu.src31111
Uses a module listed above itPart of a loopThe module itself
1 (global)2 App.Core.LLM3 App.Handlers4 App.Middleware5 App.Models6 App.WebSocket7 Core8 Ginto.Core9 Ginto.Helpers10 Ginto.Middleware11 Ginto.Models12 Ginto.Security13 Ginto.Sites14 public.lib.novnc.core.decoders.tight15 public.lib.novnc.core.util.eventtarget16 tools.sdcpu.src.api_server17 tools.sdcpu.src.app_settings18 tools.sdcpu.src.backend.api.models.response19 tools.sdcpu.src.backend.gguf.sdcpp_types20 tools.sdcpu.src.backend.models.gen_images21 tools.sdcpu.src.backend.models.lcmdiffusion_setting22 tools.sdcpu.src.models.interface_types23 tools.sdcpu.src.state24 App.Controllers25 App.Core26 App.Core.LLM.Providers27 Ginto.Services28 Ginto.Sites.Vision29 public.lib.novnc.core.decoders.tightpng30 public.lib.novnc.core.ra231 public.lib.novnc.core.rfb32 tools.sdcpu.src.backend.api33 tools.sdcpu.src.backend.gguf.gguf_diffusion34 tools.sdcpu.src.backend.image_saver35 tools.sdcpu.src.backend.lcm_text_to_image36 tools.sdcpu.src.models.settings37 Ginto.Controllers38 Ginto.Handlers39 tools.sdcpu.src.context40 tools.sdcpu.src(global)1App.Core.LLM2App.Handlers3App.Middleware4App.Models5App.WebSocket6Core7Ginto.Core8Ginto.Helpers9Ginto.Middleware10Ginto.Models11Ginto.Security12Ginto.Sites13public.lib.novnc.core.decoders.tight14public.lib.novnc.core.util.eventtarget15tools.sdcpu.src.api_server16tools.sdcpu.src.app_settings17tools.sdcpu.src.backend.api.models.response18tools.sdcpu.src.backend.gguf.sdcpp_types19tools.sdcpu.src.backend.models.gen_images20tools.sdcpu.src.backend.models.lcmdiffusion_setting21tools.sdcpu.src.models.interface_types22tools.sdcpu.src.state23App.Controllers24App.Core25App.Core.LLM.Providers26Ginto.Services27Ginto.Sites.Vision28public.lib.novnc.core.decoders.tightpng29public.lib.novnc.core.ra230public.lib.novnc.core.rfb31tools.sdcpu.src.backend.api32tools.sdcpu.src.backend.gguf.gguf_diffusion33tools.sdcpu.src.backend.image_saver34tools.sdcpu.src.backend.lcm_text_to_image35tools.sdcpu.src.models.settings36Ginto.Controllers37Ginto.Handlers38tools.sdcpu.src.context39tools.sdcpu.src402526321111141111351521131111+104 more modules (most-connected shown)

At a glance — Code Health · 12.3 · Critical · gated by D1, D2, R1, R10, R2, R3, X3, X5 ·

At a glance — Architecture · 89.2 · Strong ·

At a glance — Maturity · 62.5 · Adequate · gated by M2 ·

At a glance — Readiness · 26.9 · Weak · gated by R4, P1, P3, P7 ·

At a glance — Security · 62.4 · Adequate · gated by D29 ·

At a glance — Accessibility · 43.1 · Weak · gated by AC4 ·

At a glance — Performance · 100.0 · 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
A05:2025 — Injection306High / Critical
A03:2025 — Software Supply Chain Failures30High / Critical
A02:2025 — Security Misconfiguration13High / Critical
A07:2025 — Authentication Failures4High / Critical

Roadmap

Top priorities: Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; 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; 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.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+5.3 ptsLowREDACTED Scanning
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.+2.8 ptsMediumType Safety
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.+2.8 ptsMediumCode Duplication
Resolve the 40 finding(s) in Cyclomatic Complexity.+2.8 ptsMediumCyclomatic Complexity
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+2.8 ptsMediumLarge Files
Add a CI workflow that builds and runs the test suite on every push/PR.+2.4 ptsMediumCI/CD gates
Run what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.+2.4 ptsMediumSecurity & performance tooling
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.3 ptsMediumKeyboard semantics

File quality

Per-file score 0–10 — a quality signature. Of 239 files carrying findings, judged against the Production bar: 4% slop · 75% mixed · 21% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.8SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.7SlopDependency Vulnerabilities: High CVE: 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.0MixedStatic Analysis (SAST): Medium: 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.0MixedStatic Analysis (SAST): Medium: REDACTED

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

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

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

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

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 71 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 71 dimensions across the health lenses
D1D2D3D4D5D6D12D13D14D15D17D19D20D21D24D26D28D29D30D31D35D43D44AC1AC2AC3AC4AC5AX10AX3AX4AX6M1M2M3M4P1P10P2P3P4P5P6P7P8PF3R1R10R2R3R4R5R6R7R8R9S1X14X16X18X19X2X21X23X25X27X28X29X3X30X5

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, 2695 of 2709 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 or a scanner, 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
Canine Code Analyzer 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

Every finding is locatable in findings.md. Run 01a1eb31-0813-7402-99fd-dd7950dbb66a.

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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the JavaScript/TypeScript suite(s) run through a browser-driven runner the coverage collector does not drive — public/lib/novnc/ (karma) — a gap in the analyzer, not something this repository is missing. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.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.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares composer.json, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its Composer dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — 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. Git history depth insufficient — this repository has 27 commit(s), too few for a reliable trend signal. The clone is complete, so there is no deeper history to fetch: the signal returns as the project accumulates history.
  • 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. Too few commits for a meaningful bus factor (27 commit(s) sampled, fewer than the 50 this dimension needs before a bus factor means anything).
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `public/assets/js/chat.js`, `public/assets/js/tailwindcss.js`, `public/assets/silverqueen/login-story.js`, `public/assets/silverqueen/story.js`, `public/lib/xterm/xterm.js`, … (+3 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.
  • D34 Knowledge Freshness — 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. Too few commits to judge knowledge freshness (27 commit(s) sampled).
  • D35 Change Coupling — measured, with a gap in what it reached — 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. Git history depth insufficient — this repository has 27 commit(s), too few for a reliable change-coupling signal. The clone is complete, so there is no deeper history to fetch: the signal returns as the project accumulates history.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 626 further occurrence(s) are not listed individually; the score already reflects all 666.
  • AC3 Page structure — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 153 further occurrence(s) are not listed individually; the score already reflects all 193.
  • AC4 Keyboard semantics — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 65 further occurrence(s) are not listed individually; the score already reflects all 105.
  • AC6 Visual & motion safety — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length').
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (docker-compose.sandbox.yml). compose up failed (exit 15 — the compose project is invalid) — service "sandbox-manager" has neither an image nor a build context specified: invalid compose project; runtime evidence skipped.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (src/Views/live/bootstrap.php:77), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (src/Views/live/bootstrap.php:77), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (src/Views/live/bootstrap.php:77), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (src/Views/live/bootstrap.php:77), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's PHP, Python, perl is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's PHP, Python, perl is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The filesystem refused the listing or the read of: public/pma/favicon.ico, public/pma/js, public/pma/libraries, public/pma/locale, public/pma/templates, public/pma/themes, public/pma/vendor. Every other path was read.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 266 further occurrence(s) are not listed individually; the score already reflects all 306.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 485 further occurrence(s) are not listed individually; the score already reflects all 525.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 80 further occurrence(s) are not listed individually; the score already reflects all 120.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 329 further occurrence(s) are not listed individually; the score already reflects all 369.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X2 Cancellation propagation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 113 further occurrence(s) are not listed individually; the score already reflects all 153.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 425 further occurrence(s) are not listed individually; the score already reflects all 465.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1010 further occurrence(s) are not listed individually; the score already reflects all 1050.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala, Rust, Go, Swift, Erlang, F# and Visual Basic source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 22 further occurrence(s) are not listed individually; the score already reflects all 62.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • 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 REDACTED, 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.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

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

423 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ChatStreamHandler.handleMainRequest at 248. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being ProjectTemplates.getContent at 32 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/Handlers/ProjectTemplates.php (ProjectTemplates.getContent at 32). 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)::extend (cyclomatic 21) · ×4REDACTED:38
UploadController.upload (cyclomatic 62) · ×2saicms/app/Controllers/UploadController.php:67
UploadController.handleUploadProfilePicture (cyclomatic 21) · ×2saicms/app/Controllers/UploadController.php:793
UploadController.handleUploadCoverPhoto (cyclomatic 20) · ×2saicms/app/Controllers/UploadController.php:415
StoriesController._pm_deleteFromB2 (cyclomatic 19) · ×2saicms/app/Controllers/StoriesController.php:484

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

What to do

  1. Bring the 16 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with ChatStreamHandler.handleMainRequest (cyclomatic 248), ApiController.models (cyclomatic 102), websearch.generateImage (cyclomatic 97). — 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 16 together lifts Cyclomatic Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

590 method(s) exceeded the cognitive complexity threshold of 15; the worst was ChatStreamHandler.handleMainRequest at 407.

(anonymous)::extend (cognitive 43) · ×5REDACTED:38
UploadController.upload (cognitive 137) · ×2saicms/app/Controllers/UploadController.php:67
UploadController.handleUploadProfilePicture (cognitive 26) · ×2saicms/app/Controllers/UploadController.php:793
UploadController.handleUploadCoverPhoto (cognitive 25) · ×2saicms/app/Controllers/UploadController.php:415
StoriesController.getActiveStories (cognitive 23) · ×2saicms/app/Controllers/StoriesController.php:81

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

What to do

  1. Bring the 45 bodies over 60 down to 60 or less in Cognitive Complexity — start with ChatStreamHandler.handleMainRequest (cognitive 407), ApiController.providerKeys (cognitive 312), ApiController.models (cognitive 239). — 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 45 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes8.1 / 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 8.1 / 10 · rule-coverage 100% · ceiling Prevented

219 god class(es) detected.

MethodTooLong: ImageGenHandler.getPage · ×77src/Handlers/ImageGenHandler.php:984
FileTooLong: js/typeahead-chat.js · ×59saicms/public/assets/client/js/typeahead-chat.js
ClassTooLong: PostFeedManager · ×56saicms/public/assets/client/js/feedmanager.js:28
TooManyMethods: HostingController · ×24REDACTED:8
FunctionTooLong: typing.document.addEventListener("DOMContentLoaded") · ×3saicms/public/assets/gaming/typing/js/typing.js:1

What to do

  1. Resolve the 77 MethodTooLong finding(s) in God Classes — start with typeahead-chat.js (8), REDACTED (6), feedmanager.js (5). — One of this dimension's main actionable groups (77 warning-level).
  2. Resolve the 59 FileTooLong finding(s) in God Classes — start with REDACTED (2), REDACTED (2), UploadController.php (2). — One of this dimension's main actionable groups (59 warning-level).
  3. Resolve the 56 ClassTooLong finding(s) in God Classes — start with REDACTED (2), REDACTED (2), UploadController.php (2). — One of this dimension's main actionable groups (56 warning-level).

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

D4 · Code Duplication6.4 / 10Adequate✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

475 duplicated block group(s) detected. 8.9 % of the production lines (19,177 of 215,154) are in a reported copy. A further 164 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 2 of the 639 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (12 lines × 2) · ×18REDACTED:89
Members sharing a duplicated core (4 members, 50+ identical tokens) · ×17REDACTED:428
Duplicated block (7 lines × 2) · ×17REDACTED:1065
Duplicated block (6 lines × 2) · ×17REDACTED:2048
Duplicated block (11 lines × 2) · ×16saicms/app/Controllers/ApiController.php:381

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

What to do

  1. Resolve the 18 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (18 warning-level).
  2. Resolve the 17 Members sharing a duplicated core (4 members, 50+ identical tokens) finding(s) in Code Duplication — start with REDACTED (2), StoriesController.php, UploadController.php. — One of this dimension's main actionable groups (17 warning-level).
  3. Resolve the 17 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), CourseController.php, REDACTED. — One of this dimension's main actionable groups (17 warning-level).

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

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

6 production modules (npm+Composer), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 3 of the 6 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.4 / 10Stronggated by 6 serious findings✓ 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 9.4 / 10 · rule-coverage 100% · ceiling Verified

6 of 114 classes have LCOM4 above 3.

Low cohesion: ChatController (LCOM4 6) · ×6REDACTED:10

What to do

  1. Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).

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

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

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

6 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: catfan/medoo · ×6

✓ On the Gold path — maintain.

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

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

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 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 87 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 14 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (73 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 9 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares composer.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt10.0 / 10Stronggated by 4 serious findings✓ Tool-verified

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

4 deducted task-comment markers across 215154 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.

TodoComment · ×4src/Views/code/code.php:1054

What to do

  1. Resolve the 4 TodoComment finding(s) in Explicit Debt — start with UploadController.php (2), code.php, code.view.php. — One of this dimension's main actionable groups (4 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

2 of 2 documentation facets pass in full. 38 document(s) read across 6 unit(s).

✓ On the Gold path — maintain.

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: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundcomposer.json:4

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with composer.json. — One of this dimension's main actionable groups (1 recommendation-level).

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

D21 · Naming Consistency8.1 / 10Strong✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

6 naming inconsistencies among 311 declarations measured against a convention their peers follow.

`_layoutID` spells `ID` where 305 names in the project spell it `Id` · ×2public/assets/client/js/gaming/webtypist.js:192
`_lessonID` spells `ID` where 305 names in the project spell it `Id` · ×2public/assets/client/js/gaming/webtypist.js:193
`_repeaterID` spells `ID` where 305 names in the project spell it `Id`public/lib/novnc/core/rfb.js:121
`_screenID` spells `ID` where 305 names in the project spell it `Id`public/lib/novnc/core/rfb.js:151

What to do

  1. Resolve the 2 `_layoutID` spells `ID` where 305 names in the project spell it `Id` finding(s) in Naming Consistency — start with webtypist.js (2). — One of this dimension's main actionable groups (2 recommendation-level).
  2. Resolve the 2 `_lessonID` spells `ID` where 305 names in the project spell it `Id` finding(s) in Naming Consistency — start with webtypist.js (2). — One of this dimension's main actionable groups (2 recommendation-level).
  3. Resolve the 1 `_repeaterID` spells `ID` where 305 names in the project spell it `Id` finding(s) in Naming Consistency — start with rfb.js. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value8.3 7.7 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 7.7 / 10 · rule-coverage 93% · ceiling Documented

72 of 4140 judged comments only repeat the code they sit on (1.7 %). 424 comment(s) in another language or script were not judged.

redundant comment · ×35public/assets/client/js/dashboard.js:445
doc comments repeat the namespublic/assets/js/chat/attachments.js:59

What to do

  1. Resolve the 35 redundant comment finding(s) in Comment Value — start with REDACTED (4), tools.js (3), editor-chat.js (3). — One of this dimension's main actionable groups (35 recommendation-level).

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

D26 · Project Cohesion4.3 / 10Weak✓ 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.

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

2 of 7 build units (Composer, Python, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×2composer.json:1

What to do

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

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

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ 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 9.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
  3. 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)0.0 / 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

312 finding(s): 0 critical, 11 high, 300 medium, 1 low. semgrep hit a parse error in 16 file(s) — `public/assets/bible/js/soundmanager2.js`, `public/assets/js/chat.js`, `public/assets/js/editor-chat.js`, `REDACTED`, `public/assets/js/tailwindcss.js`, … (+11 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

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

What to do

  1. Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

30 finding(s): 3 critical, 18 high, 9 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 18 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (12), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (18 issue-level).
  2. Resolve the 9 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).

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

D31 · IaC & Container Security7.2 / 10Adequategated by 7 critical findings✓ 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 7.2 / 10 · rule-coverage 100% · ceiling Documented

13 finding(s): 0 critical, 7 high, 4 medium, 2 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 7 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (7 issue-level).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.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.

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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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 25 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 alternatives5.3 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×15) — REDACTED:887, saicms/app/views/dashboard.php:324, saicms/app/views/dashboard.php:337, …
  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×16) — public/assets/client/js/F.js:680, saicms/app/views/dashboard/tier.view.php:247, saicms/app/views/dashboard/tier.view.php:264, …
  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×6) — public/assets/client/js/stories.js:375, public/assets/client/js/typeahead-chat.js:2748, public/assets/client/js/typeahead-chat.js:2837, …

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.9 / 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 control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×2) — REDACTED:263, REDACTED:329
  • 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. (×19) — REDACTED:269, REDACTED:317, REDACTED:321, …
  • 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. (×19) — REDACTED:316, REDACTED:320, REDACTED:324, …

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

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×18) — REDACTED:2, public/bob.html:2, public/lib/novnc/vnc.html:2, …
  • An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label. (×9) — public/assets/client/js/mediamanager.js:753, public/assets/js/chat.js:1344, public/assets/js/chat/code-blocks.js:352, …
  • 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) — public/lib/novnc/vnc.html:22, saicms/app/views/code.view.php:49
  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — public/mall.html:2
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×6) — REDACTED:1139, saicms/app/views/dashboard/smartfi360.view.php:548, saicms/app/views/dashboard/wifi_purchase.view.php:152, …
  • An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative. (×2) — saicms/app/views/dashboard/tier.view.php:639, saicms/app/views/game.view.php:74
  • With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled. (×2) — saicms/app/views/friends.view.php:77, saicms/app/views/profile.view.php:21

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.8 / 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".

  • An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action. — public/assets/client/js/contacts.js:110
  • The repo's own CSS styles .cursor-pointer 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. (×4) — public/assets/client/js/feedmanager.js:1109, public/assets/client/js/feedmanager.js:1279, public/assets/client/js/headmanager.js:414, …
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×22) — public/assets/client/js/mediamanager.js:135, public/assets/client/js/profile.js:818, public/assets/custom-select.js:11, …
  • This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — public/assets/client/js/profile.js:744
  • This <div role="alertdialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — public/assets/client/js/profile.js:1087
  • The repo's own CSS styles .reasoning-header 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) — public/assets/js/chat.js:3071, REDACTED:3934
  • The repo's own CSS styles .cursor-pointer 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) — public/assets/js/messenger/messenger-multi-chat.js:3041, public/assets/js/messenger/messenger-multi-chat.js:783
  • The repo's own CSS styles .typeahead-item 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. — REDACTED:181
  • A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×2) — public/index.html:83, public/index.html:95
  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×4) — public/index.html:106, saicms/app/views/code.view.php:823, saicms/app/views/dashboard.php:149, …

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. (×7) — src/Views/mall/checkout.php:1367, src/Views/mall/pages/home.php:319, src/Views/mall/pages/home.php:339, …

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AX10 · Code composition8.1 / 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.

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.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

M1 · Documentation (README)9.2 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

M2 · Architecture documentation2.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.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy6.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

  • public/lib/novnc/README.md links to `docs/EMBEDDING.md`, but `public/lib/novnc/docs/EMBEDDING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — public/lib/novnc/README.md:198
  • public/lib/novnc/README.md links to `docs/LIBRARY.md`, but `public/lib/novnc/docs/LIBRARY.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — public/lib/novnc/README.md:199

What to do

  • Reconcile the README with reality: public/lib/novnc/README.md links to `docs/EMBEDDING.md`, but `public/lib/novnc/docs/EMBEDDING.md` does not exist; public/lib/novnc/README.md links to `docs/LIBRARY.md`, but `public/lib/novnc/docs/LIBRARY.md` does not exist.
P1 · CI/CD gates0.0 / 10Critical✓ 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.

  • No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.

What to do

  • Add a CI workflow that builds and runs the test suite on every push/PR.
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

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.

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) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.
  • `public/lib/novnc/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — public/lib/novnc/package.json:34

What to do

  • Run what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add 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 & Backup7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene10.0 / 10Exemplary✓ 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.

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.

  • `curl_exec(` 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. (×8) — saicms/app/Controllers/WebhookController.php:205, saicms/app/Controllers/WebhookController.php:248, saicms/app/Controllers/WebhookController.php:583, …
  • `file_get_contents('http://` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:256
  • `file_get_contents('https://` 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. (×3) — REDACTED:2521, src/Controllers/SandboxController.php:2243, src/Views/admin/hosting/dns.php:15
  • `fetch(` 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. (×3) — tools/lightpanda-mcp/scripts/stealth-browser.js:664, tools/lightpanda-mcp/scripts/stealth-browser.js:683, REDACTED:1005
  • `http.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:373

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.
  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

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 each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

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 · 132 plain JS — the untyped files are REDACTED, public/assets/bible/js/main.js, REDACTED, public/assets/bible/js/script-fade.js, public/assets/bible/js/script.js, public/assets/bible/js/script_colapse.js (+126 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 Duplication0.0 / 10Critical✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 42 of the duplicated blocks reported below have copies in at least two of the sibling directories public, saicms, tools under the repository root. That concentration is one structural fact, not 42 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 42 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. — public/assets/client/js/notifications.js:3
  • public/assets/client/js/notifications.js:3 · saicms/public/assets/client/js/notifications.js:3 — these 2 files are line-for-line copies of one another — 1026 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. — public/assets/client/js/notifications.js:3
  • public/assets/client/js/feedmanager.js:1718 · saicms/public/assets/client/js/feedmanager.js:1718 — 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. — public/assets/client/js/feedmanager.js:1718
  • public/assets/client/js/mediamanager.js:2 · saicms/public/assets/client/js/mediamanager.js:2 — these 2 files are line-for-line copies of one another — 780 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. — public/assets/client/js/mediamanager.js:2
  • public/assets/client/js/F.js:2 · saicms/public/assets/client/js/F.js:2 — these 2 files are line-for-line copies of one another — 747 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. — public/assets/client/js/F.js:2
  • public/assets/client/js/headmanager.js:2 · saicms/public/assets/client/js/headmanager.js:2 — these 2 files are line-for-line copies of one another — 709 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. — public/assets/client/js/headmanager.js:2
  • public/assets/client/js/typeahead-chat.js:1747 · saicms/public/assets/client/js/typeahead-chat.js:1700 — 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. — public/assets/client/js/typeahead-chat.js:1747
  • public/assets/client/js/profile.js:12 · saicms/public/assets/client/js/profile.js:12 — these 2 files are line-for-line copies of one another — 673 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. — public/assets/client/js/profile.js:12
  • REDACTED:17 · REDACTED:17 — these 2 files are line-for-line copies of one another — 532 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. — REDACTED:17
  • public/assets/client/js/stories.js:3 · saicms/public/assets/client/js/stories.js:3 — these 2 files are line-for-line copies of one another — 521 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. — public/assets/client/js/stories.js:3
  • public/assets/client/js/typeahead-chat.js:2661 · saicms/public/assets/client/js/typeahead-chat.js:2614 — 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. — public/assets/client/js/typeahead-chat.js:2661
  • public/assets/client/js/smartfed.js:2 · saicms/public/assets/client/js/smartfed.js:2 — these 2 files are line-for-line copies of one another — 385 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. — public/assets/client/js/smartfed.js:2
  • public/assets/client/js/feedmanager.js:1182 · saicms/public/assets/client/js/feedmanager.js:1182 — 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. — public/assets/client/js/feedmanager.js:1182
  • public/assets/client/js/typeahead-chat.js:292 · saicms/public/assets/client/js/typeahead-chat.js:245 — 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. — public/assets/client/js/typeahead-chat.js:292
  • public/assets/client/js/typeahead-chat.js:1070 · saicms/public/assets/client/js/typeahead-chat.js:1023 — 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. — public/assets/client/js/typeahead-chat.js:1070
  • public/assets/gaming/typing/js/typing.js:1 · saicms/public/assets/gaming/typing/js/typing.js:1 — these 2 files are line-for-line copies of one another — 343 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. — public/assets/gaming/typing/js/typing.js:1
  • public/assets/client/js/dashboard.js:1 · saicms/public/assets/client/js/dashboard.js:1 — these 2 files are line-for-line copies of one another — 332 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. — public/assets/client/js/dashboard.js:1
  • public/assets/client/js/typeahead-chat.js:3353 · saicms/public/assets/client/js/typeahead-chat.js:3306 — 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. — public/assets/client/js/typeahead-chat.js:3353
  • public/assets/js/editor-chat.js:4108 · REDACTED:4630 — 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. — public/assets/js/editor-chat.js:4108
  • public/assets/client/js/feedmanager.js:437 · saicms/public/assets/client/js/feedmanager.js:437 — 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. — public/assets/client/js/feedmanager.js:437
  • public/assets/js/editor-chat.js:1448 · REDACTED:2027 — 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. — public/assets/js/editor-chat.js:1448
  • public/assets/client/js/typeahead-chat.js:842 · saicms/public/assets/client/js/typeahead-chat.js:795 — 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. — public/assets/client/js/typeahead-chat.js:842
  • public/assets/client/js/typeahead-chat.js:1 · saicms/public/assets/client/js/typeahead-chat.js:1 — the two spans are one implementation copied and then locally edited — 1780 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. — public/assets/client/js/typeahead-chat.js:1
  • public/assets/silverqueen/login-story.js:1 · public/assets/silverqueen/story.js:1 — these 2 files are line-for-line copies of one another — 197 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. — public/assets/silverqueen/login-story.js:1
  • public/assets/client/js/gaming/webtypist.js:1 · saicms/public/assets/client/js/gaming/webtypist.js:1 — these 2 files are line-for-line copies of one another — 194 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. — public/assets/client/js/gaming/webtypist.js:1
  • public/assets/js/editor-chat.js:3108 · REDACTED:3516 — 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. — public/assets/js/editor-chat.js:3108
  • public/assets/js/chat.js:1658 · public/assets/js/chat/conversation.js:41 — the two spans are one implementation copied and then locally edited — 1174 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. — public/assets/js/chat.js:1658
  • public/assets/client/js/typeahead-chat.js:3166 · saicms/public/assets/client/js/typeahead-chat.js:3119 — 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. — public/assets/client/js/typeahead-chat.js:3166
  • public/assets/client/js/contacts.js:4 · saicms/public/assets/client/js/contacts.js:4 — these 2 files are line-for-line copies of one another — 164 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. — public/assets/client/js/contacts.js:4
  • public/assets/js/editor-chat.js:2774 · REDACTED:3177 — 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. — public/assets/js/editor-chat.js:2774
  • public/assets/js/editor-chat.js:2573 · REDACTED:2981 — 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. — public/assets/js/editor-chat.js:2573
  • public/assets/client/js/feedmanager.js:800 · saicms/public/assets/client/js/feedmanager.js:800 — 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. — public/assets/client/js/feedmanager.js:800
  • public/assets/js/editor-chat.js:3937 · REDACTED:4459 — 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. — public/assets/js/editor-chat.js:3937
  • public/assets/client/js/feedmanager.js:83 · saicms/public/assets/client/js/feedmanager.js:83 — 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. — public/assets/client/js/feedmanager.js:83
  • public/assets/js/editor-chat.js:1825 · REDACTED:2404 — 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. — public/assets/js/editor-chat.js:1825
  • public/assets/js/chat.js:1440 · public/assets/js/chat/code-blocks.js:438 — the two spans are one implementation copied and then locally edited — 686 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. — public/assets/js/chat.js:1440
  • public/assets/js/chat.js:1122 · public/assets/js/chat/code-blocks.js:175 — the two spans are one implementation copied and then locally edited — 755 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. — public/assets/js/chat.js:1122
  • public/assets/js/chat.js:7124 · public/assets/js/chat/audio.js:128 — the two spans are one implementation copied and then locally edited — 725 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. — public/assets/js/chat.js:7124
  • public/assets/js/editor-chat.js:3791 · REDACTED:4313 — 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. — public/assets/js/editor-chat.js:3791
  • public/assets/js/chat.js:805 · public/assets/js/chat/markdown.js:252 — 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. — public/assets/js/chat.js:805

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 Complexity0.0 / 10Critical✓ 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.

  • streamWebSearch has cyclomatic complexity 309 and cognitive complexity 751; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/chat.js:4370
  • sendMessage has cyclomatic complexity 286 and cognitive complexity 718; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:3392
  • sendMessage has cyclomatic complexity 227 and cognitive complexity 570; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/editor-chat.js:2989
  • formatToolResult has cyclomatic complexity 127 and cognitive complexity 159; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/chat.js:5899
  • loadFile has cyclomatic complexity 105 and cognitive complexity 172; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:5368
  • openChat has cyclomatic complexity 87 and cognitive complexity 122; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/typeahead-chat.js:1201, saicms/public/assets/client/js/typeahead-chat.js:1154
  • addMessageToChatbox has cyclomatic complexity 85 and cognitive complexity 132; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/typeahead-chat.js:2642, saicms/public/assets/client/js/typeahead-chat.js:2595
  • fetchMcpDiscover has cyclomatic complexity 78 and cognitive complexity 195; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/chat.js:2457
  • _createPostElement has cyclomatic complexity 78 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/feedmanager.js:896, saicms/public/assets/client/js/feedmanager.js:896
  • formatToolResult has cyclomatic complexity 77 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/chat/tools.js:75
  • formatToolResult has cyclomatic complexity 75 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/editor-chat.js:2034
  • createNode has cyclomatic complexity 70 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — public/assets/js/editor-repo-tree.js:30
  • _populatePostViewModal has cyclomatic complexity 67 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/feedmanager.js:1134, saicms/public/assets/client/js/feedmanager.js:1134
  • (anonymous) has cyclomatic complexity 64 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. (×2) — public/assets/js/editor-chat.js:2491, REDACTED:2775
  • continueAgentPlan has cyclomatic complexity 57 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/chat.js:6646
  • startAIGeneration has cyclomatic complexity 55 and cognitive complexity 108; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/feedmanager.js:1991, saicms/public/assets/client/js/feedmanager.js:1991
  • updateSentMessageInChatbox has cyclomatic complexity 53 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/typeahead-chat.js:2780, saicms/public/assets/client/js/typeahead-chat.js:2733
  • init has cyclomatic complexity 53 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/theme.js:80
  • stopRecording has cyclomatic complexity 51 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — public/assets/js/chat.js:7440
  • _loadAndDisplayRecentMessages has cyclomatic complexity 51 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/typeahead-chat.js:2933, saicms/public/assets/client/js/typeahead-chat.js:2886
  • handleIncomingCall has cyclomatic complexity 50 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/messenger/call-manager.js:642
  • (anonymous) has cyclomatic complexity 48 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — public/assets/js/messenger/messenger-multi-chat.js:3619
  • formatToolResult has cyclomatic complexity 46 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:2610
  • mount has cyclomatic complexity 45 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — public/assets/js/editor-sidebar.js:72
  • selectFile has cyclomatic complexity 45 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — public/assets/js/editor-repo-tree.js:205
  • continueEditorAgentPlan has cyclomatic complexity 45 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — public/assets/js/editor-chat.js:2314
  • extractToolCallFromText has cyclomatic complexity 45 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. (×2) — public/assets/js/editor-chat.js:989, REDACTED:1534
  • loadPosts has cyclomatic complexity 44 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — public/assets/client/js/feedmanager.js:712, saicms/public/assets/client/js/feedmanager.js:712
  • attachAndPlay has cyclomatic complexity 44 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. — public/assets/js/messenger/call-manager.js:499
  • _populatePostViewModal has cyclomatic complexity 44 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — public/assets/client/js/notifications.js:778
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.

  • public/assets/js/chat.js has 7411 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/chat.js:1
  • REDACTED has 6080 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • public/assets/js/editor-chat.js has 3989 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/editor-chat.js:1
  • public/assets/js/messenger/messenger-multi-chat.js has 3982 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/messenger/messenger-multi-chat.js:1
  • public/assets/client/js/typeahead-chat.js has 3474 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/typeahead-chat.js:1
  • saicms/public/assets/client/js/typeahead-chat.js has 3429 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/typeahead-chat.js:1
  • public/lib/novnc/core/rfb.js has 2832 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/lib/novnc/core/rfb.js:1
  • public/assets/client/js/feedmanager.js has 2827 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/feedmanager.js:1
  • saicms/public/assets/client/js/feedmanager.js has 2827 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/feedmanager.js:1
  • public/assets/js/messenger/messenger.js has 2217 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/messenger/messenger.js:1
  • public/lib/novnc/app/ui.js has 1564 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/lib/novnc/app/ui.js:1
  • public/assets/client/js/notifications.js has 1332 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/notifications.js:1
  • saicms/public/assets/client/js/notifications.js has 1332 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/notifications.js:1
  • REDACTED has 1118 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • public/assets/js/messenger/messenger-popup.js has 1074 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/messenger/messenger-popup.js:1
  • public/assets/client/js/profile.js has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/profile.js:1
  • saicms/public/assets/client/js/profile.js has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/profile.js:1
  • public/assets/client/js/F.js has 1009 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/F.js:1
  • saicms/public/assets/client/js/F.js has 1009 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/F.js:1
  • public/assets/client/js/mediamanager.js has 988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/mediamanager.js:1
  • saicms/public/assets/client/js/mediamanager.js has 984 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/mediamanager.js:1
  • public/assets/client/js/headmanager.js has 957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/headmanager.js:1
  • saicms/public/assets/client/js/headmanager.js has 957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/headmanager.js:1
  • REDACTED has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • public/assets/js/messenger/call-manager.js has 868 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/messenger/call-manager.js:1
  • REDACTED has 742 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 742 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • public/assets/client/js/stories.js has 654 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/stories.js:1
  • saicms/public/assets/client/js/stories.js has 654 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/stories.js:1
  • public/lib/novnc/core/input/keysym.js has 588 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/lib/novnc/core/input/keysym.js:1
  • public/assets/client/js/smartfed.js has 558 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/client/js/smartfed.js:1
  • public/assets/js/editor-repo-tree.js has 557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/editor-repo-tree.js:1
  • public/assets/js/chat/conversation.js has 543 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/chat/conversation.js:1
  • REDACTED has 527 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • saicms/public/assets/client/js/smartfed.js has 521 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — saicms/public/assets/client/js/smartfed.js:1
  • public/assets/js/chat/audio.js has 515 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/chat/audio.js:1
  • public/assets/js/chat/code-blocks.js has 512 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/chat/code-blocks.js:1
  • public/assets/js/chat/tools.js has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/chat/tools.js:1
  • public/lib/novnc/core/display.js has 487 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/lib/novnc/core/display.js:1
  • public/assets/js/editor-sidebar.js has 483 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — public/assets/js/editor-sidebar.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage0.2 / 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.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — public/assets/js/chat.js:1, REDACTED:1, public/assets/js/messenger/messenger-multi-chat.js:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness9.7 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling6.7 / 10Adequate✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

  • test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
R7 · Dead Code9.3 / 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.

  • Unreachable from the 130 application, 9 tooling and 1 test entry point(s) detected in this repo. Nothing this repository declares compiles or type-checks these files, so a wrong deletion here would raise no compile error — gate removals on `npm test`, which loads the modules, and note that it only covers what it exercises. An undetected custom entry would make these reachable.
  • no import path from any entry point (130 application, 9 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make — src/Views/sites/owner-sim.js
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×14) — public/lib/novnc/core/rfb.js:78, public/lib/novnc/core/rfb.js:79, public/lib/novnc/core/rfb.js:80, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene7.5 / 10Strong✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Declared in public/lib/novnc/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×4) — public/lib/novnc/package.json:38, public/lib/novnc/package.json:40, public/lib/novnc/package.json:42, …
  • Declared in tools/sandbox-proxy/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. — tools/sandbox-proxy/package.json:12

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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 Posture6.0 / 10Adequate✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `https://cdn.tailwindcss.com` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 70 such include(s) across the repository's markup. — public/bob.html:7
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `caddy-frp.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.) — tools/tunnel/frp/caddy-frp.conf:26

What to do

  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
  • 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.
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.

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. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state3.6 / 10Weak✓ Tool-verified

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.

  • `createSandbox` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 53, reset at line 55) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:29
  • `toggleSandbox` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 122, reset at line 124) and the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 131, reset at line 133) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:70
  • `tree` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 226, reset at line 230) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:216
  • `create` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 354, reset at line 356) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:346
  • `rename` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 440, reset at line 442) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:432
  • `delete` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 515, reset at line 517) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:507
  • `paste` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 589, reset at line 591) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:581
  • `save` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 721, reset at line 723) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:698
  • `file` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 792, reset at line 794) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — REDACTED:784
  • `install` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 772, reset at line 797) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — src/Controllers/SandboxController.php:585

What to do

  • Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment variable passed to the operation that needs it (the `cwd` and `env` options of `child_process`, or of `Deno.Command`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional. In Python the same holds for `os.chdir`, `os.environ` and `sys.stdout`: pass `cwd=`/`env=` to `subprocess`, or use `contextlib.chdir`/`redirect_stdout`, rather than moving the global by hand. In PHP the same holds for `chdir`, `putenv`, `setlocale`, `date_default_timezone_set`, `ini_set` and the error-handler stack: pass the value to the operation (`Process` with `cwd`/`env`, an explicit `DateTimeZone`) or restore in a `finally`.
X2 · Cancellation propagation4.4 / 10Weak✓ 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 11/163 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `generateRaphaelImage` 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 })`. — tools/lightpanda-mcp/scripts/stealth-browser.js:513
  • `saveAdminChanges` 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 })`. — saicms/public/assets/gaming/typing/js/typing.js:85
  • `saveProgressToServer` 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 })`. — saicms/public/assets/gaming/typing/js/typing.js:312
  • `loadContacts` 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 })`. — saicms/public/assets/client/js/contacts.js:69
  • `_refreshStatuses` 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 })`. — saicms/public/assets/client/js/contacts.js:165
  • `_handleViewOriginalPostInModal` 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 })`. — saicms/public/assets/client/js/feedmanager.js:414
  • `loadPosts` 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 })`. — saicms/public/assets/client/js/feedmanager.js:712
  • `_handleEditPost` 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 })`. — saicms/public/assets/client/js/feedmanager.js:2213
  • `_fetchAndDisplayComments` 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 })`. (×2) — saicms/public/assets/client/js/feedmanager.js:2791, saicms/public/assets/client/js/notifications.js:1261
  • `_fetchStreamDetails` 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 })`. — saicms/public/assets/client/js/mediamanager.js:424
  • `_initiateWebRTCConnectionToCF` 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 })`. — saicms/public/assets/client/js/mediamanager.js:598
  • `_createStreamPostOnBackend` 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 })`. — saicms/public/assets/client/js/mediamanager.js:915
  • `handleNewPostSubmissionFromUploader` 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 })`. — saicms/public/assets/client/js/mediamanager.js:1047
  • `_apiRequest` 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 })`. — saicms/public/assets/client/js/mf.js:365
  • `_markSingleNotificationAsRead` 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 })`. — saicms/public/assets/client/js/notifications.js:384
  • `_handleMarkAllNotificationsRead` 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 })`. — saicms/public/assets/client/js/notifications.js:415
  • `_loadMoreNotifications` 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 })`. — saicms/public/assets/client/js/notifications.js:477
  • `_handleFriendRequestAction` 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 })`. — saicms/public/assets/client/js/notifications.js:665
  • `_handleViewPostInModal` 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 })`. — saicms/public/assets/client/js/notifications.js:1060
  • `_handleToggleLike` 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 })`. — saicms/public/assets/client/js/notifications.js:1101
  • `_handleSubmitComment` 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 })`. — saicms/public/assets/client/js/notifications.js:1149
  • `_handleDeleteComment` 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 })`. — saicms/public/assets/client/js/notifications.js:1329
  • `onclick` 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 })`. — saicms/public/assets/client/js/notifications.js:1385
  • `_handlePostSubmit` 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 })`. — saicms/public/assets/client/js/profile.js:627
  • `fetchAndRenderStories` 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 })`. — saicms/public/assets/client/js/stories.js:225
  • `handleDeleteStory` 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 })`. — saicms/public/assets/client/js/stories.js:624
  • `_fetchUsers` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:150
  • `_refreshChatboxStatuses` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:417
  • `_handleSubmitCreateGroup` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:578
  • `openChat` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:1154
  • `_handleSendMessage` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:2521
  • `_loadAndDisplayRecentMessages` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:2886
  • `_markConversationAsReadOnServer` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:2989
  • `loadInitialNotifications` 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 })`. — saicms/public/assets/client/js/typeahead-chat.js:3448
  • `fetchUsers` 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 })`. — saicms/public/assets/client/js/typeahead.js:47
  • `_setupDictionary` 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 })`. — public/lib/novnc/app/localization.js:92
  • `start` 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 })`. — public/lib/novnc/app/ui.js:49
  • `fetchServerMap` 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 })`. — public/assets/js/admin-icon-color-picker.js:20

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.

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.

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.

X27 · Collection changed while being enumerated7.9 / 10Strong✓ Tool-verified

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `foreach` leaves the array or collection it is walking alone — PHP raises nothing, but the loop's view and the collection part: an array walked by value (and a Doctrine or Laravel collection) is walked as the snapshot taken when the loop began, so an element added in the body is never visited and one removed is visited anyway; an array walked by reference (`as &$v`) and an SPL container (`SplObjectStorage`, `ArrayObject`, `SplQueue`) are walked live, so an added element is walked too and a removal skips the next one; and after an `array_splice`, `array_shift` or sort every later key names a different element.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

  • line 26 walks `$this->clients`, an SPL container `foreach` walks LIVE, and line 34 changes that same collection with `$this->clients->detach(…)` before the next iteration: the walk skips an element it would have visited (on an SPL container even removing the current one skips the next). PHP raises nothing, so the loop completes over a different set than the code meant. — src/Playground/FileWriteStreamer.php:26
  • line 23 walks `$this->clients`, an SPL container `foreach` walks LIVE, and line 29 changes that same collection with `$this->clients->detach(…)` before the next iteration: the walk skips an element it would have visited (on an SPL container even removing the current one skips the next). PHP raises nothing, so the loop completes over a different set than the code meant. — src/Playground/FixedFileWriteStreamer.php:23

What to do

  • Each finding names the two lines that cannot both stand — the `for` over the collection (or its `keys()`/`values()`/`items()` view), and the call inside the body that changes its size. Confirm from those two, then pick one: walk a snapshot (`for k in list(d):`, `for x in s.copy():`); build the result instead of editing in place (`d = {k: v for k, v in d.items() if keep(v)}`); collect what needs removing and remove it after the loop; or — where only the first match was ever meant — `break` straight after the change, which is the one shape that is already safe. In PHP: Each finding names the two lines that cannot both stand — the `foreach` over the collection, and the change to it in the body. Confirm from those two, then pick one: build the result instead of editing the walked collection (`$kept = array_filter($items, $keep)`, `$batch->reject(…)`); for a worklist, loop `while (($next = array_shift($queue)) !== null)` so what is added is visited; walk a copy (`foreach (array_values($items) as …)`, `foreach (clone $storage as …)`) and change the original; remove only the CURRENT element (`unset($items[$key])`), which an array walk tolerates; or — where only the first match was ever meant — `break` straight after the change.
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 handling3.9 / 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. (×22) — REDACTED:57, REDACTED:97, tools/lightpanda-mcp/scripts/turnstile_bypass.py:102, …
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — tools/lightpanda-mcp/scripts/stealth-browser.js:413
  • `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. (×11) — src/Views/smartfi.php:13, src/Views/user/account-keys.php:14, src/Views/user/account.php:15, …
  • `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. (×4) — src/Views/user/network-tree.php:690, src/Views/user/network-tree.php:701, src/Views/user/network-tree2.php:1644, …
  • `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) — src/Views/chat-m/includes/scripts.php:380, src/Views/chat/includes/scripts.php:527

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.

X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether PHP's static analysis checks null and is not undermined by a nullness baseline — PHPStan from level 8 (`checkNullables`) or Psalm at `errorLevel` 3 or stricter is what makes `?User` a type whose method call is an error, and the null entries of a baseline, `@psalm-suppress PossiblyNull…` and `@phpstan-ignore *.nonObject` are what silence it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.

What to do

  • Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it. Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive.

WCAG coverage — what static analysis assessed

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

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

Not statically assessed — these 42 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.3, 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.7, 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 Health12.3Critical — gated by D1, D2, R1, R10, R2, R3, X3, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture89.2StrongSolid.
Maturity62.5Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness26.9Weak — gated by R4, P1, P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security62.4Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility43.1Weak — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplaryStrongest area.
Unscored — 4 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.

  • SC1 Supply-chain hygiene — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 21 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: this repository stores data through 'PDO' (src/Views/live/bootstrap.php:77) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'PDO' (src/Views/live/bootstrap.php:77) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'PDO' (src/Views/live/bootstrap.php:77) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 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.

  • AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's PHP imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. PHP builds its object graph per request and shares none of it between requests. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — service "sandbox-manager" has neither an image nor a build context specified: invalid compose project; 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: this repository stores data through 'PDO' (src/Views/live/bootstrap.php:77) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route (no Laravel Route::…, no Symfony #[Route], no Filament panel, no WordPress REST route or AJAX action). Access control is therefore N/A here — a Composer library is authorized by the application that mounts it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • D10 Test Quality — ~495 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 — too few commits for a meaningful bus factor
  • 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 — API consistency is measured on C#, TypeScript, Go only; the exposed JavaScript surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D32 Data Compliance (PII/GDPR) — 8 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D34 Knowledge Freshness — too few commits to judge knowledge freshness
  • D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (9 value object(s))
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — no CI workflow found
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for PHPBench subjects (`bench*` methods, or `@Subject`/`#[Subject]` ones) in a file importing PhpBench or carrying its annotations, `bench*` methods in a `*Bench.php` file where PHPBench is installed, or phpbench/phpbench in a composer.json or a phpbench.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • X1 Async correctness — X1 reached only 9% of this repository's production lines — php (204,629 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X12 Unreachable branch — X12 reached only 9% of this repository's production lines — php (204,629 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 9% of this repository's production lines — php (204,629 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — X24 reached only 9% of this repository's production lines — php (204,629 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 149 finding(s)
AC2 · Forms & labels · <label> that labels no control · ×19
  • <label> that labels no control REDACTED:316 — 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 REDACTED:320 — 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 REDACTED:324 — 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 REDACTED:328 — 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 REDACTED:358 — 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 REDACTED:362 — 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 REDACTED:366 — 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 REDACTED:370 — 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 REDACTED:374 — 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 REDACTED:378 — 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 REDACTED:394 — 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 REDACTED:398 — 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 REDACTED: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 REDACTED:643 — 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 REDACTED:716 — 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 REDACTED:720 — 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 REDACTED:762 — 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 REDACTED:767 — 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 REDACTED:772 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels · <input> without a programmatic label · ×18
  • <input> without a programmatic label REDACTED:269 — 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 REDACTED:317 — 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 REDACTED:325 — 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 REDACTED:359 — 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 REDACTED:363 — 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 REDACTED:367 — 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 REDACTED:371 — 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 REDACTED:375 — 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 REDACTED:380 — 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 REDACTED:395 — 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 REDACTED:399 — 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 REDACTED:404 — 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 REDACTED:644 — 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 REDACTED:717 — 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 REDACTED:721 — 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 REDACTED:763 — 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 REDACTED:768 — 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 REDACTED:773 — 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.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×18
  • Click handler on a non-interactive <div> public/assets/client/js/mediamanager.js:135 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/assets/custom-select.js:11 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/assets/js/chat.js:8262 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:3761 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:3774 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:4077 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:5131 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:5221 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/assets/js/editor-repo-tree.js:41 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/assets/js/editor-repo-tree.js:85 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/assets/js/messenger/messenger.js:448 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/assets/js/messenger/messenger.js:925 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:191 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:37 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:87 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:114 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/index.html:83 — A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> public/index.html:95 — A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
D30 · Dependency Vulnerabilities · High CVE · ×18
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC1 · Text alternatives · <img> without a text alternative · ×16
  • <img> without a text alternative public/assets/client/js/F.js:680 — 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 saicms/app/views/dashboard/tier.view.php:247 — 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 saicms/app/views/dashboard/tier.view.php:264 — 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 saicms/app/views/dashboard/tier.view.php:281 — 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 saicms/app/views/dashboard/tier.view.php:298 — 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 saicms/app/views/dashboard/tier.view.php:315 — 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 saicms/app/views/dashboard/tier.view.php:332 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative saicms/app/views/dashboard/tier.view.php:349 — 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 saicms/app/views/dashboard/tier.view.php:366 — 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 saicms/app/views/marketplace/marketfeed.view.php:282 — 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 saicms/app/views/marketplace/marketfeed.view.php:320 — 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 saicms/app/views/marketplace/marketfeed.view.php:356 — 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 saicms/app/views/marketplace/marketfeed.view.php:392 — 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 saicms/app/views/marketplace/marketfeed.view.php:430 — 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 saicms/app/views/marketplace/marketfeed.view.php:467 — 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 saicms/public/assets/client/js/F.js:680 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC3 · Page structure · <iframe> without a title · ×9
  • <iframe> without a title public/assets/client/js/mediamanager.js:753 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title public/assets/js/chat.js:1344 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title public/assets/js/chat/code-blocks.js:352 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title REDACTED:5406 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title REDACTED:5657 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title public/assets/js/messenger/messenger-multi-chat.js:2915 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title public/assets/js/messenger/messenger.js:1075 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title saicms/app/views/code.view.php:291 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title saicms/public/assets/client/js/mediamanager.js:753 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×9
  • Clickable element isn't keyboard-operable public/assets/client/js/feedmanager.js:1109 — The repo's own CSS styles .cursor-pointer 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 public/assets/client/js/feedmanager.js:1279 — The repo's own CSS styles .cursor-pointer 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 public/assets/client/js/headmanager.js:414 — The repo's own CSS styles .cursor-pointer 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 public/assets/client/js/notifications.js:873 — The repo's own CSS styles .cursor-pointer 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 public/assets/js/chat.js:3071 — The repo's own CSS styles .reasoning-header 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 REDACTED:3934 — The repo's own CSS styles .reasoning-header 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 public/assets/js/messenger/messenger-multi-chat.js:3041 — The repo's own CSS styles .cursor-pointer 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 public/assets/js/messenger/messenger-multi-chat.js:783 — The repo's own CSS styles .cursor-pointer 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 REDACTED:181 — The repo's own CSS styles .typeahead-item 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC5 · ARIA correctness · aria-hidden hides a focusable element · ×7
  • aria-hidden hides a focusable element src/Views/mall/checkout.php:1367 — 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 src/Views/mall/pages/home.php:319 — 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 src/Views/mall/pages/home.php:339 — 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 src/Views/mall/pages/home.php:371 — 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 src/Views/mall/pages/storefront.php:143 — 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 src/Views/mall/pages/storefront.php:158 — 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 src/Views/mall/product.php:351 — 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.
D31 · IaC & Container Security · High IaC · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <img> · ×4
  • Click handler on a non-interactive <img> public/assets/js/chat.js:2884 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <img> public/assets/js/chat.js:4464 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <img> public/assets/js/chat.js:6328 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <img> public/assets/js/chat/tools.js:449 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D30 · Dependency Vulnerabilities · Critical CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <select> without a programmatic label · ×2
  • <select> without a programmatic label REDACTED:263 — 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 REDACTED:329 — 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 public/lib/novnc/vnc.html:22 — 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 saicms/app/views/code.view.php:49 — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label REDACTED:321 — 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.
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang public/mall.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC4 · Keyboard semantics · Click handler on a non-interactive <li> · ×1
  • Click handler on a non-interactive <li> public/assets/client/js/profile.js:818 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics · Click handler on a non-interactive <span> · ×1
  • Click handler on a non-interactive <span> public/assets/js/editor-repo-tree.js:158 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 2381 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 175 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×77
  • MethodTooLong: ImageGenHandler.getPage src/Handlers/ImageGenHandler.php:984 — MethodTooLong — getPage runs 826 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 726 over it, 8.26× 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: UserController.registerAction src/Controllers/UserController.php:1220 — MethodTooLong — registerAction runs 328 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 228 over it, 3.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: ChatMessageHandler.onMessage saicms/app/WebSocket/ChatMessageHandler.php:282 — MethodTooLong — onMessage runs 303 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 203 over it, 3.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.
  • MethodTooLong: SandboxMcp.createDocument src/Handlers/SandboxMcp.php:740 — MethodTooLong — createDocument runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: install.finalizeInstallationStep REDACTED:1181 — MethodTooLong — finalizeInstallationStep runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ApiController.providerKeys REDACTED:1617 — MethodTooLong — providerKeys runs 219 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 119 over it, 2.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ApiController.models REDACTED:1014 — MethodTooLong — models runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MallCommerceService.buildOrderBundle src/Services/MallCommerceService.php:984 — MethodTooLong — buildOrderBundle runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× 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: PandaSearchHandler.getTestPage src/Handlers/PandaSearchHandler.php:572 — MethodTooLong — getTestPage runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.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: ImageGenHandler.handleSdcpuGeneration src/Handlers/ImageGenHandler.php:554 — MethodTooLong — handleSdcpuGeneration runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× 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: PostFeedManager._createPostElement saicms/public/assets/client/js/feedmanager.js:896 — MethodTooLong — _createPostElement runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× 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: GtbStrategy.step src/Services/GtbStrategy.php:61 — MethodTooLong — step runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChatController.getOrCreateDirectConversation saicms/app/Controllers/ChatController.php:119 — MethodTooLong — getOrCreateDirectConversation runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× 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: SandboxController.install src/Controllers/SandboxController.php:585 — MethodTooLong — install runs 191 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 91 over it, 1.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.
  • MethodTooLong: PostFeedManager._handleEditPost saicms/public/assets/client/js/feedmanager.js:2213 — MethodTooLong — _handleEditPost runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× 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: ApiController.post REDACTED:345 — MethodTooLong — post runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× 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: ApiController.post saicms/app/Controllers/ApiController.php:43 — MethodTooLong — post runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TunnelController.generateAccessKey REDACTED:1395 — MethodTooLong — generateAccessKey runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× 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: SandboxController.vnc src/Controllers/SandboxController.php:1109 — MethodTooLong — vnc runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× 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: BarangayController.detect REDACTED:36 — MethodTooLong — detect runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PostFeedManager._populatePostViewModal saicms/public/assets/client/js/feedmanager.js:1134 — MethodTooLong — _populatePostViewModal 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.
  • MethodTooLong: CodeController.codesave saicms/app/Controllers/CodeController.php:101 — MethodTooLong — codesave runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HostingController.tunnelsApi REDACTED:1359 — MethodTooLong — tunnelsApi runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentController.paymongoPayments REDACTED:1627 — MethodTooLong — paymongoPayments runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: ChatUIManager.openChat saicms/public/assets/client/js/typeahead-chat.js:1154 — MethodTooLong — openChat runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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.
  • + 52 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×59
  • FileTooLong: js/typeahead-chat.js saicms/public/assets/client/js/typeahead-chat.js — FileTooLong — 2795 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 78% of them inside a single declaration: ChatUIManager (248-3069). The bar is 1500 significant lines; this is 1295 over it, 1.86× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: js/feedmanager.js saicms/public/assets/client/js/feedmanager.js — FileTooLong — 2288 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 98% of them inside a single declaration: PostFeedManager (28-3052). The bar is 1500 significant lines; this is 788 over it, 1.53× 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: Handlers/ChatStreamHandler.php src/Handlers/ChatStreamHandler.php — FileTooLong — 2158 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1658 over it, 4.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2068 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: HostingController (8-3374). The bar is 500 significant lines; this is 1568 over it, 4.14× 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: Services/MallCommerceService.php src/Services/MallCommerceService.php — FileTooLong — 1680 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: MallCommerceService (10-2531). The bar is 500 significant lines; this is 1180 over it, 3.36× 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 — 1674 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PaymentController (11-2533). The bar is 500 significant lines; this is 1174 over it, 3.35× 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 — 1486 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: TunnelController (13-2503). The bar is 500 significant lines; this is 986 over it, 2.97× 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 — 1482 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 982 over it, 2.96× 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: Handlers/ImageGenHandler.php src/Handlers/ImageGenHandler.php — FileTooLong — 1408 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ImageGenHandler (20-2094). The bar is 500 significant lines; this is 908 over it, 2.82× 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: Controllers/SandboxController.php src/Controllers/SandboxController.php — FileTooLong — 1392 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: SandboxController (14-2326). The bar is 500 significant lines; this is 892 over it, 2.78× 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 saicms/app/Controllers/ChatController.php — FileTooLong — 1387 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ChatController (8-2048). The bar is 500 significant lines; this is 887 over it, 2.77× 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 — 1326 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 826 over it, 2.65× 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 — 1323 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: AcademyController (15-1970). The bar is 500 significant lines; this is 823 over it, 2.65× 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: Controllers/UserController.php src/Controllers/UserController.php — FileTooLong — 1320 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: UserController (7-2087). The bar is 500 significant lines; this is 820 over it, 2.64× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1233 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ApiController (7-1934). The bar is 500 significant lines; this is 733 over it, 2.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: js/notifications.js saicms/public/assets/client/js/notifications.js — FileTooLong — 1127 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 627 over it, 2.25× 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: pages/edit_script.php src/Views/admin/pages/edit_script.php — FileTooLong — 1020 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 520 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: Helpers/LxdSandboxManager.php src/Helpers/LxdSandboxManager.php — FileTooLong — 1017 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: LxdSandboxManager (17-2130). The bar is 500 significant lines; this is 517 over it, 2.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 948 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: FriendsController (12-1620). The bar is 500 significant lines; this is 448 over it, 1.90× 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: Services/SilverQueenEngine.php src/Services/SilverQueenEngine.php — FileTooLong — 946 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: SilverQueenEngine (25-1526). The bar is 500 significant lines; this is 446 over it, 1.89× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 877 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PlaygroundController (10-1340). The bar is 500 significant lines; this is 377 over it, 1.75× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 847 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: BarangayController (21-1287). The bar is 500 significant lines; this is 347 over it, 1.69× 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: Controllers/WebhookController.php src/Controllers/WebhookController.php — FileTooLong — 832 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: WebhookController (8-1398). The bar is 500 significant lines; this is 332 over it, 1.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: js/mediamanager.js saicms/public/assets/client/js/mediamanager.js — FileTooLong — 820 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 320 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: REDACTED REDACTED — FileTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ActivitiesController (8-1240). The bar is 500 significant lines; this is 297 over it, 1.59× 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.
  • + 34 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 31 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×56
  • ClassTooLong: PostFeedManager saicms/public/assets/client/js/feedmanager.js:28 — ClassTooLong — 2237 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 1837 over it, 5.59× 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: ChatUIManager saicms/public/assets/client/js/typeahead-chat.js:248 — ClassTooLong — 2190 significant lines (blank, comment-only and punctuation-only lines excluded), 74 methods. The bar is 400 significant lines; this is 1790 over it, 5.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HostingController REDACTED:8 — ClassTooLong — 2066 significant lines (blank, comment-only and punctuation-only lines excluded), 120 methods. The bar is 400 significant lines; this is 1666 over it, 5.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MallCommerceService src/Services/MallCommerceService.php:10 — ClassTooLong — 1673 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 1273 over it, 4.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PaymentController REDACTED:11 — ClassTooLong — 1670 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 1270 over it, 4.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TunnelController REDACTED:13 — ClassTooLong — 1483 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 1083 over it, 3.71× 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: ImageGenHandler src/Handlers/ImageGenHandler.php:20 — ClassTooLong — 1403 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 1003 over it, 3.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SandboxController src/Controllers/SandboxController.php:14 — ClassTooLong — 1388 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 988 over it, 3.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ChatController saicms/app/Controllers/ChatController.php:8 — ClassTooLong — 1383 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 983 over it, 3.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AcademyController REDACTED:15 — ClassTooLong — 1319 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 919 over it, 3.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UserController src/Controllers/UserController.php:7 — ClassTooLong — 1314 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 914 over it, 3.29× 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: ApiController REDACTED:7 — ClassTooLong — 1230 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 830 over it, 3.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LxdSandboxManager src/Helpers/LxdSandboxManager.php:17 — ClassTooLong — 1015 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 615 over it, 2.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SilverQueenEngine src/Services/SilverQueenEngine.php:25 — ClassTooLong — 943 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 543 over it, 2.36× 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: FriendsController REDACTED:12 — ClassTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 542 over it, 2.36× 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: PlaygroundController REDACTED:10 — ClassTooLong — 874 significant lines (blank, comment-only and punctuation-only lines excluded), 19 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: BarangayController REDACTED:21 — ClassTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 444 over it, 2.11× 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: WebhookController src/Controllers/WebhookController.php:8 — ClassTooLong — 827 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 427 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ActivitiesController REDACTED:8 — ClassTooLong — 792 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 392 over it, 1.98× 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: LiveController src/Controllers/LiveController.php:18 — ClassTooLong — 743 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 343 over it, 1.86× 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: ChatMessageHandler saicms/app/WebSocket/ChatMessageHandler.php:12 — ClassTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 342 over it, 1.86× 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: ActivitiesController REDACTED:9 — ClassTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 336 over it, 1.84× 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: MallCheckoutController src/Controllers/MallCheckoutController.php:8 — ClassTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 318 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GtbController REDACTED:16 — ClassTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 300 over it, 1.75× 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: MessengerController REDACTED:10 — ClassTooLong — 698 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 298 over it, 1.75× 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.
  • + 31 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file public/assets/js/chat.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/js/messenger/messenger-multi-chat.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/js/editor-chat.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/client/js/typeahead-chat.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file saicms/public/assets/client/js/typeahead-chat.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/lib/novnc/core/rfb.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/client/js/feedmanager.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file saicms/public/assets/client/js/feedmanager.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/js/messenger/messenger.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/lib/novnc/app/ui.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/client/js/notifications.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file saicms/public/assets/client/js/notifications.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/js/messenger/messenger-popup.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/client/js/profile.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file saicms/public/assets/client/js/profile.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/client/js/F.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file saicms/public/assets/client/js/F.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/client/js/mediamanager.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file saicms/public/assets/client/js/mediamanager.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file public/assets/client/js/headmanager.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file saicms/public/assets/client/js/headmanager.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 15 more in this group — see findings.md.
X2 · Cancellation propagation · Async function without AbortSignal · ×39
  • Async function without AbortSignal: generateRaphaelImage tools/lightpanda-mcp/scripts/stealth-browser.js:513 — `generateRaphaelImage` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: saveAdminChanges saicms/public/assets/gaming/typing/js/typing.js:85 — `saveAdminChanges` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: saveProgressToServer saicms/public/assets/gaming/typing/js/typing.js:312 — `saveProgressToServer` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadContacts saicms/public/assets/client/js/contacts.js:69 — `loadContacts` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _refreshStatuses saicms/public/assets/client/js/contacts.js:165 — `_refreshStatuses` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleViewOriginalPostInModal saicms/public/assets/client/js/feedmanager.js:414 — `_handleViewOriginalPostInModal` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadPosts saicms/public/assets/client/js/feedmanager.js:712 — `loadPosts` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleEditPost saicms/public/assets/client/js/feedmanager.js:2213 — `_handleEditPost` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _fetchAndDisplayComments saicms/public/assets/client/js/feedmanager.js:2791 — `_fetchAndDisplayComments` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _fetchStreamDetails saicms/public/assets/client/js/mediamanager.js:424 — `_fetchStreamDetails` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _initiateWebRTCConnectionToCF saicms/public/assets/client/js/mediamanager.js:598 — `_initiateWebRTCConnectionToCF` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _createStreamPostOnBackend saicms/public/assets/client/js/mediamanager.js:915 — `_createStreamPostOnBackend` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: handleNewPostSubmissionFromUploader saicms/public/assets/client/js/mediamanager.js:1047 — `handleNewPostSubmissionFromUploader` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _apiRequest saicms/public/assets/client/js/mf.js:365 — `_apiRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _markSingleNotificationAsRead saicms/public/assets/client/js/notifications.js:384 — `_markSingleNotificationAsRead` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleMarkAllNotificationsRead saicms/public/assets/client/js/notifications.js:415 — `_handleMarkAllNotificationsRead` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _loadMoreNotifications saicms/public/assets/client/js/notifications.js:477 — `_loadMoreNotifications` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleFriendRequestAction saicms/public/assets/client/js/notifications.js:665 — `_handleFriendRequestAction` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleViewPostInModal saicms/public/assets/client/js/notifications.js:1060 — `_handleViewPostInModal` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleToggleLike saicms/public/assets/client/js/notifications.js:1101 — `_handleToggleLike` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleSubmitComment saicms/public/assets/client/js/notifications.js:1149 — `_handleSubmitComment` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _fetchAndDisplayComments saicms/public/assets/client/js/notifications.js:1261 — `_fetchAndDisplayComments` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handleDeleteComment saicms/public/assets/client/js/notifications.js:1329 — `_handleDeleteComment` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: onclick saicms/public/assets/client/js/notifications.js:1385 — `onclick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: _handlePostSubmit saicms/public/assets/client/js/profile.js:627 — `_handlePostSubmit` 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 })`.
  • + 14 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×24
  • TooManyMethods: HostingController REDACTED:8 — TooManyMethods — 120 methods. The bar is 30 methods; this is 90 over it, 4.00× 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: MallCommerceService src/Services/MallCommerceService.php:10 — TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ChatUIManager saicms/public/assets/client/js/typeahead-chat.js:248 — TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AcademyController REDACTED:15 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ChatStreamHandler src/Handlers/ChatStreamHandler.php:14 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: TunnelController REDACTED:13 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PostFeedManager saicms/public/assets/client/js/feedmanager.js:28 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SilverQueenEngine src/Services/SilverQueenEngine.php:25 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MallCheckoutController src/Controllers/MallCheckoutController.php:8 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LxdSandboxManager src/Helpers/LxdSandboxManager.php:17 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NotificationManager saicms/public/assets/client/js/notifications.js:177 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SitesController src/Controllers/SitesController.php:32 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MallPushService src/Services/MallPushService.php:8 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UserController src/Controllers/UserController.php:7 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProjectTemplates src/Handlers/ProjectTemplates.php:13 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UnifiedSandbox src/Helpers/UnifiedSandbox.php:22 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PayPalHandler src/Handlers/PayPalHandler.php:26 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: install REDACTED:1 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ApiController REDACTED:7 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CourseController src/Controllers/CourseController.php:12 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MallDeliveryController src/Controllers/MallDeliveryController.php:14 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProfileApp saicms/public/assets/client/js/profile.js:44 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NetworkController REDACTED:15 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaymentController REDACTED:11 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X3 · Exception handling · Swallowed exception (empty catch) · ×23
  • Swallowed exception (empty catch) REDACTED:57 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:97 — 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) tools/lightpanda-mcp/scripts/turnstile_bypass.py:102 — 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) tools/lightpanda-mcp/scripts/turnstile_bypass.py:116 — 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) tools/lightpanda-mcp/scripts/turnstile_bypass.py:200 — 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) tools/lightpanda-mcp/scripts/turnstile_bypass.py:265 — 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) tools/lightpanda-mcp/scripts/stealth-browser.js:217 — 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) tools/lightpanda-mcp/scripts/stealth-browser.js:413 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:42 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:111 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:173 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:338 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:753 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:823 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:908 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:101 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:82 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Views/chat-m/includes/main-content.php:20 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Views/chat/includes/main-content.php:17 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Views/chat/includes/mobile-header.php:15 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Views/chat/includes/scripts-model-selector.php:12 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Views/chat/includes/scripts-prompts.php:14 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Views/chat/includes/settings-panel.php:14 — 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.
AC3 · Page structure · Page without a main landmark · ×18
  • Page without a main landmark REDACTED: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 public/bob.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 public/lib/novnc/vnc.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 public/lib/novnc/vnc_lite.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 public/mall.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 public/typing.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 saicms/app/views/auth/login.php:5 — 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 saicms/app/views/code.view.php:46 — 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 REDACTED:15 — 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 saicms/app/views/dashboard/smartfi360.view.php: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 saicms/app/views/dashboard/tier.view.php:23 — 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 saicms/app/views/game.view.php:21 — 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 saicms/app/views/stream.view.php: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 saicms/app/views/upload.view.php:30 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/Views/academy/academy.php:13 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/Views/academy/admin.php:14 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/Views/academy/admin_grant.php:8 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/Views/academy/bot.php:6 — 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) · ×18
  • Duplicated block (12 lines × 2) REDACTED:89 — REDACTED:89-100 | REDACTED:514-525 — both copies are in the same file, so extract the 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:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:256 — REDACTED:256-267 | REDACTED:374-385 — both copies are in the same file, so extract the 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:256` 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) REDACTED:1787 — REDACTED:1787-1798 | REDACTED:1894-1905 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:2863 — REDACTED:2863-2874 | REDACTED:2896-2907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:637 — REDACTED:637-648 | REDACTED:879-890 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:878` calls `getLxcBin` and `REDACTED:636` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) REDACTED:889 — REDACTED:889-900 | src/Controllers/UserController.php:1099-1110 — 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 `REDACTED:889` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Controllers/UserController.php:1112` calls `error_log`, `substr` and `REDACTED:902` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) REDACTED:902 — REDACTED:902-913 | src/Controllers/UserController.php:1115-1126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/UserController.php:1112` calls `error_log`, `substr` and `REDACTED:900` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) REDACTED:150 — REDACTED:150-161 | REDACTED:555-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 (12 lines × 2) src/Controllers/SandboxController.php:1186 — src/Controllers/SandboxController.php:1186-1197 | REDACTED:1860-1871 — 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 (12 lines × 2) src/Controllers/SellerController.php:367 — src/Controllers/SellerController.php:367-378 | src/Controllers/SellerController.php:683-694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/SellerController.php:364` calls `intval` and `src/Controllers/SellerController.php:680` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) src/Controllers/UserController.php:638 — src/Controllers/UserController.php:638-649 | src/Controllers/UserController.php:820-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/UserController.php:638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/Handlers/DevTools.php:255 — src/Handlers/DevTools.php:255-266 | src/Handlers/DevTools.php:292-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/Handlers/LightpandaSearchHandler.php:601 — src/Handlers/LightpandaSearchHandler.php:601-612 | src/Handlers/LightpandaSearchHandler.php:816-827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/LightpandaSearchHandler.php:601` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) saicms/app/Controllers/UploadController.php:53 — saicms/app/Controllers/UploadController.php:53-64 | src/Controllers/UploadController.php:57-68 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:48 — REDACTED:48-59 | REDACTED:115-126 — both copies are in the same file, so extract the 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:48` 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) saicms/app/Controllers/WebhookController.php:466 — saicms/app/Controllers/WebhookController.php:466-478 | src/Controllers/WebhookController.php:631-642 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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) src/Controllers/CourseController.php:31 — src/Controllers/CourseController.php:31-42 | src/Controllers/MasterclassController.php:33-44 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) src/Handlers/ImageGenHandler.php:958 — src/Handlers/ImageGenHandler.php:958-969 | src/Handlers/PandaSearchHandler.php:545-557 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×17
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:428 — REDACTED:428-543 | REDACTED:1122-1147 | REDACTED:1193-1218 | src/Controllers/SocialController.php:495-520 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:621 — REDACTED:621-828 | REDACTED:925-1095 | src/Controllers/LiveController.php:215-362 | src/Controllers/MigrationController.php:246-261 — 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) saicms/app/Controllers/StoriesController.php:25 — saicms/app/Controllers/StoriesController.php:25-44 | saicms/app/Controllers/UploadController.php:48-64 | src/Controllers/StoriesController.php:29-62 | src/Controllers/UploadController.php:51-68 — 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) saicms/app/Controllers/UploadController.php:379 — saicms/app/Controllers/UploadController.php:379-412 | saicms/app/Controllers/UploadController.php:757-790 | src/Controllers/UploadController.php:406-439 | src/Controllers/UploadController.php:784-817 — 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) saicms/app/Controllers/WebhookController.php:191 — saicms/app/Controllers/WebhookController.php:191-215 | saicms/app/Controllers/WebhookController.php:220-258 | src/Controllers/WebhookController.php:205-229 | src/Controllers/WebhookController.php:234-272 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:121 — REDACTED:121-131 | REDACTED:1142-1149 | REDACTED:1198-1205 | REDACTED:1348-1360 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:63 — REDACTED:63-218 | REDACTED:363-430 | REDACTED:547-596 | REDACTED:604-640 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:779 — REDACTED:779-865 | src/Core/LLM/ProviderRegistry.php:515-622 | src/Core/LLM/ProviderRegistry.php:704-723 | src/Core/LLM/ProviderRegistry.php:731-767 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:717 — REDACTED:717-838 | REDACTED:882-946 | REDACTED:975-1030 | REDACTED:1039-1101 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/Controllers/CourseController.php:651 — src/Controllers/CourseController.php:651-686 | src/Controllers/CourseController.php:695-758 | src/Controllers/MasterclassController.php:491-526 | src/Controllers/MasterclassController.php:535-606 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:217 — REDACTED:217-348 | src/Controllers/LiveController.php:93-145 | src/Controllers/LiveController.php:154-206 | src/Controllers/LiveController.php:1087-1133 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/Controllers/LiveController.php:93 — src/Controllers/LiveController.php:93-145 | src/Controllers/LiveController.php:926-1082 | src/Controllers/LiveController.php:1087-1133 | src/Controllers/LiveController.php:1138-1168 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:857 — REDACTED:857-984 | REDACTED:1042-1184 | REDACTED:1193-1361 | src/Controllers/UserController.php:1078-1217 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:141 — REDACTED:141-170 | REDACTED:203-219 | REDACTED:231-312 | REDACTED:320-361 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/Controllers/SandboxController.php:1513 — src/Controllers/SandboxController.php:1513-1666 | src/Controllers/SandboxController.php:1675-1749 | src/Controllers/SandboxController.php:1758-1798 | src/Controllers/SandboxController.php:1888-2008 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:90 — REDACTED:90-111 | REDACTED:117-135 | REDACTED:172-186 | REDACTED:226-240 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:2016 — REDACTED:2016-2025 | src/Controllers/UserController.php:759-815 | src/Controllers/UserController.php:858-917 | src/Controllers/UserController.php:922-975 — 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 (7 lines × 2) · ×17
  • Duplicated block (7 lines × 2) REDACTED:1065 — REDACTED:1065-1072 | src/Controllers/LiveController.php:531-537 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1065` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/Controllers/CourseController.php:583 — src/Controllers/CourseController.php:583-589 | src/Controllers/MasterclassController.php:416-422 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 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) REDACTED:702 — REDACTED:702-708 | REDACTED:982-988 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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) REDACTED:1139 — REDACTED:1139-1145 | REDACTED:1227-1233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/Handlers/DocumentRagService.php:499 — src/Handlers/DocumentRagService.php:499-505 | src/Handlers/DocumentRagService.php:508-514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/Handlers/PayMongoHandler.php:321 — src/Handlers/PayMongoHandler.php:321-327 | src/Handlers/PayMongoHandler.php:375-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/PayMongoHandler.php:321` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/Services/GtbBrain.php:131 — src/Services/GtbBrain.php:131-137 | src/Services/GtbBrain.php:175-181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/GtbBrain.php:131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) src/Services/MallCommerceService.php:1060 — src/Services/MallCommerceService.php:1060-1066 | src/Services/MallCommerceService.php:1340-1346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/MallCommerceService.php:1060` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/Controllers/SellerController.php:47 — src/Controllers/SellerController.php:47-53 | src/Controllers/SellerController.php:324-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) src/Handlers/ChatStreamHandler.php:2970 — src/Handlers/ChatStreamHandler.php:2970-2976 | src/Handlers/ImageGenHandler.php:273-279 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/ChatStreamHandler.php:2970` 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) REDACTED:705 — REDACTED:705-711 | REDACTED:712-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/Services/GtbStrategy.php:624 — src/Services/GtbStrategy.php:624-630 | src/Services/GtbStrategy.php:650-656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/GtbStrategy.php:624` 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, `src/Services/GtbStrategy.php:657` calls `in_array`, `protectLive`, `empty` and `src/Services/GtbStrategy.php:632` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) REDACTED:1104 — REDACTED:1104-1110 | src/Controllers/LiveController.php:370-376 — 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 (7 lines × 2) saicms/app/Controllers/ApiController.php:19 — saicms/app/Controllers/ApiController.php:19-25 | REDACTED:54-60 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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 (7 lines × 2) saicms/app/Controllers/WebhookController.php:180 — saicms/app/Controllers/WebhookController.php:180-186 | src/Controllers/WebhookController.php:194-200 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 (7 lines × 2) REDACTED:356 — REDACTED:356-362 | REDACTED:644-650 — 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 `REDACTED:356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/Controllers/MallCheckoutController.php:714 — src/Controllers/MallCheckoutController.php:714-720 | src/Controllers/UserController.php:1652-1658 — 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 (6 lines × 2) · ×17
  • Duplicated block (6 lines × 2) REDACTED:2048 — REDACTED:2048-2053 | src/Core/Database.php:42-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) REDACTED:109 — REDACTED:109-116 | REDACTED:130-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:109` 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 (6 lines × 2) REDACTED:1187 — REDACTED:1187-1192 | REDACTED:1221-1226 — both copies are in the same file, so extract the 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:1187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:336 — REDACTED:336-341 | REDACTED:469-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:477` calls `filter_input` and `REDACTED:343` 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) REDACTED:1233 — REDACTED:1233-1238 | src/Handlers/ChatStreamHandler.php:149-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/Controllers/MallCheckoutController.php:244 — src/Controllers/MallCheckoutController.php:244-249 | src/Controllers/MallCheckoutController.php:256-261 — both copies are in the same file, so extract the 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) REDACTED:169 — REDACTED:169-174 | src/Controllers/SellerController.php:331-336 — 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 `REDACTED:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:326 — REDACTED:326-331 | src/Core/McpUnifier.php:206-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:332` calls `rtrim`, `json_decode`, `is_array` and `src/Core/McpUnifier.php:212` 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) REDACTED:56 — REDACTED:56-61 | src/Views/admin/pages/edit_script.php:21-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/Sites/Assistant.php:109 — src/Sites/Assistant.php:109-114 | src/Sites/Indexing.php:187-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Sites/Assistant.php:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:191 — REDACTED:191-196 | REDACTED:199-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/Handlers/SandboxMcp.php:904 — src/Handlers/SandboxMcp.php:904-909 | src/Handlers/SandboxMcp.php:996-1001 — both copies are in the same file, so extract the 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) REDACTED:1957 — REDACTED:1957-1962 | REDACTED:529-534 — 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) REDACTED:697 — REDACTED:697-702 | REDACTED:263-268 — 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) REDACTED:161 — REDACTED:161-166 | src/Controllers/SellerController.php:310-315 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) src/Controllers/MallDeliveryController.php:207 — src/Controllers/MallDeliveryController.php:207-212 | src/Playground/MallNotifyServer.php:244-249 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) REDACTED:1175 — REDACTED:1175-1180 | REDACTED:1315-1320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×17
  • Swallowed exception (caught, then discarded) src/Views/smartfi.php:13 — `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) src/Views/user/account-keys.php:14 — `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) src/Views/user/account.php:15 — `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) src/Views/user/network-tree.php:690 — `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) src/Views/user/network-tree.php:701 — `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) src/Views/user/network-tree2.php:1644 — `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) src/Views/user/network-tree2.php:1655 — `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) src/Views/user/settings.php:10 — `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) src/Views/social/home.php:5 — `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) REDACTED:24 — `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) REDACTED:103 — `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) REDACTED:203 — `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) REDACTED:2699 — `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) src/Views/chat-m/includes/scripts.php:380 — `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) src/Views/chat-m/includes/scripts.php:387 — `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) src/Views/chat/includes/scripts.php:527 — `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) src/Views/chat/includes/scripts.php:534 — `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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×16
  • Duplicated block (11 lines × 2) saicms/app/Controllers/ApiController.php:381 — saicms/app/Controllers/ApiController.php:381-391 | REDACTED:997-1007 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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) REDACTED:1438 — REDACTED:1438-1448 | saicms/app/Controllers/ProfileController.php:169-179 — 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 `REDACTED:1438` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) REDACTED:69 — REDACTED:69-79 | REDACTED:128-138 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: 96% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:68 — REDACTED:68-78 | REDACTED:501-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:253 — REDACTED:253-263 | REDACTED:825-835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:253 — REDACTED:253-263 | REDACTED:310-320 — both copies are in the same file, so extract the 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:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:1655 — REDACTED:1655-1665 | REDACTED:1722-1732 — both copies are in the same file, so extract the 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) REDACTED:393 — REDACTED:393-403 | REDACTED:400-410 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 (11 lines × 2) REDACTED:1060 — REDACTED:1060-1070 | REDACTED:1223-1233 — both copies are in the same file, so extract the 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:1060` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Controllers/SettingsController.php:33 — src/Controllers/SettingsController.php:33-43 | src/Controllers/SettingsController.php:53-63 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SettingsController.php:33` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) src/Handlers/PandaSearchHandler.php:279 — src/Handlers/PandaSearchHandler.php:279-289 | src/Handlers/PandaSearchHandler.php:319-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/PandaSearchHandler.php:279` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Handlers/PandaSearchHandler.php:277` calls `$onReasoning` and `src/Handlers/PandaSearchHandler.php:317` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/Services/MallCommerceService.php:2375 — src/Services/MallCommerceService.php:2375-2385 | src/Services/MallCommerceService.php:2388-2398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/MallCommerceService.php:2375` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:209 — REDACTED:209-219 | REDACTED:328-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:209` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Helpers/SandboxManager.php:56 — src/Helpers/SandboxManager.php:56-66 | src/Helpers/SandboxManager.php:80-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) saicms/app/Controllers/ApiController.php:334 — saicms/app/Controllers/ApiController.php:334-344 | REDACTED:950-960 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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 (11 lines × 2) REDACTED:29 — REDACTED:29-39 | REDACTED:30-40 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×16
  • Outbound HTTP without resilience saicms/app/Controllers/WebhookController.php:205 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience saicms/app/Controllers/WebhookController.php:248 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience saicms/app/Controllers/WebhookController.php:583 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:256 — `file_get_contents('http://` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:2521 — `file_get_contents('https://` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/Controllers/SandboxController.php:2243 — `file_get_contents('https://` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:404 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:432 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:524 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:566 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:636 — `curl_exec(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/Views/admin/hosting/dns.php:15 — `file_get_contents('https://` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience tools/lightpanda-mcp/scripts/stealth-browser.js:664 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience tools/lightpanda-mcp/scripts/stealth-browser.js:683 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:1005 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:373 — `http.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
AC1 · Text alternatives · <canvas> without a text alternative · ×15
  • <canvas> without a text alternative REDACTED:887 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative saicms/app/views/dashboard.php:324 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative saicms/app/views/dashboard.php:337 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative saicms/app/views/dashboard/smartfi.view.php:244 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative saicms/app/views/dashboard/wifi_purchase.view.php:320 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative saicms/app/views/dashboard/wifi_purchase.view.php:325 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/admin/parts/body.php:94 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/admin/users/dashboard.php:57 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/silverqueen_home.php:52 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/silverqueen_login.php:39 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/silverqueen_sqb_engine_v2.php:659 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/silverqueen_sqb_engine_v3.php:646 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/silverqueen_sqb_engine_v3.php:652 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/smartfi.php:296 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative src/Views/user/dashboard.php:621 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×15
  • Duplicated block (5 lines × 2) REDACTED:239 — REDACTED:239-243 | REDACTED:369-376 — 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 `REDACTED:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) src/Controllers/MallCheckoutController.php:76 — src/Controllers/MallCheckoutController.php:76-80 | src/Controllers/MallCheckoutController.php:121-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:442 — REDACTED:442-447 | REDACTED:1084-1088 — both copies are in the same file, so extract the 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:442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) src/Controllers/SellerController.php:344 — src/Controllers/SellerController.php:344-348 | src/Controllers/SellerController.php:661-665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/Controllers/SitesController.php:153 — src/Controllers/SitesController.php:153-157 | src/Controllers/SitesController.php:485-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SitesController.php:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) REDACTED:295 — REDACTED:295-299 | REDACTED:301-305 — both copies are in the same file, so extract the 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:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) src/Handlers/ChatStreamHandler.php:3289 — src/Handlers/ChatStreamHandler.php:3289-3293 | src/Handlers/ImageGenHandler.php:887-891 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) src/Playground/FixedPtyServer.php:20 — src/Playground/FixedPtyServer.php:20-24 | src/Playground/PtyServer.php:98-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Playground/FixedPtyServer.php:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Playground/PtyServer.php:106` calls `empty` and `src/Playground/FixedPtyServer.php:26` 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) saicms/app/Controllers/WebhookController.php:36 — saicms/app/Controllers/WebhookController.php:36-40 | src/Controllers/WebhookController.php:39-43 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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) REDACTED:529 — REDACTED:529-533 | REDACTED:710-714 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) REDACTED:1337 — REDACTED:1337-1341 | REDACTED:2030-2035 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) REDACTED:1440 — REDACTED:1440-1444 | REDACTED:1483-1487 — both copies are in the same file, so extract the 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:1440` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1481` calls `empty`, `redirect` and `REDACTED:1438` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) src/Controllers/ApiKeysRelayController.php:69 — src/Controllers/ApiKeysRelayController.php:69-73 | src/Controllers/SqetchChatController.php:32-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/ApiKeysRelayController.php:69` 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) REDACTED:2419 — REDACTED:2419-2423 | src/Controllers/WebhookController.php:1288-1292 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) src/Handlers/ChatStreamHandler.php:2984 — src/Handlers/ChatStreamHandler.php:2984-2988 | src/Handlers/ImageGenHandler.php:284-288 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/ChatStreamHandler.php:2984` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Handlers/ChatStreamHandler.php:2989` calls `is_string`, `empty`, `trim` and `src/Handlers/ImageGenHandler.php:289` 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 (13 lines × 2) · ×13
  • Duplicated block (13 lines × 2) REDACTED:1133 — REDACTED:1133-1145 | src/Controllers/LiveController.php:398-410 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:1146` calls `date` and `src/Controllers/LiveController.php:411` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) REDACTED:761 — REDACTED:761-773 | REDACTED:905-917 — both copies are in the same file, so extract the 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:761` 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) REDACTED:310 — REDACTED:310-322 | REDACTED:776-788 — both copies are in the same file, so extract the 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:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:774 — REDACTED:774-786 | REDACTED:823-835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:774` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/Controllers/CourseController.php:653 — src/Controllers/CourseController.php:653-665 | src/Controllers/CourseController.php:697-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) src/Controllers/LiveController.php:929 — src/Controllers/LiveController.php:929-941 | src/Controllers/LiveController.php:1141-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/LiveController.php:929` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/Controllers/MasterclassController.php:493 — src/Controllers/MasterclassController.php:493-505 | src/Controllers/MasterclassController.php:537-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) REDACTED:919 — REDACTED:919-931 | REDACTED:961-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.
  • Duplicated block (13 lines × 2) REDACTED:205 — REDACTED:205-217 | REDACTED:244-256 — both copies are in the same file, so extract the 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:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:969 — REDACTED:969-981 | REDACTED:1076-1088 — both copies are in the same file, so extract the 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) REDACTED:557 — REDACTED:557-569 | REDACTED:627-639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/Core/LLM/AbstractLLMProvider.php:150 — src/Core/LLM/AbstractLLMProvider.php:150-162 | src/Core/LLM/Providers/OllamaProvider.php:374-386 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/LLM/AbstractLLMProvider.php:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/Controllers/MallDeliveryController.php:591 — src/Controllers/MallDeliveryController.php:591-603 | src/Controllers/MallDeliveryController.php:627-639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/MallDeliveryController.php:591` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/MallDeliveryController.php:589` calls `empty`, `array_column` and `src/Controllers/MallDeliveryController.php:626` 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.
D29 · Static Analysis (SAST) · REDACTED · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×11
  • Duplicated block (9 lines × 2) saicms/app/Controllers/StoriesController.php:353 — saicms/app/Controllers/StoriesController.php:353-361 | src/Controllers/StoriesController.php:378-386 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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 `saicms/app/Controllers/StoriesController.php:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/StoriesController.php:377` calls `_app_log`, `getMessage` and `saicms/app/Controllers/StoriesController.php:352` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) REDACTED:1695 — REDACTED:1695-1703 | REDACTED:1744-1752 — both copies are in the same file, so extract the 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:1695` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) REDACTED:69 — REDACTED:69-77 | REDACTED:87-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.
  • Duplicated block (9 lines × 2) src/Controllers/CourseController.php:661 — src/Controllers/CourseController.php:661-669 | src/Controllers/MasterclassController.php:501-509 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 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 (9 lines × 2) src/Handlers/ChatStreamHandler.php:1204 — src/Handlers/ChatStreamHandler.php:1204-1212 | src/Handlers/ChatStreamHandler.php:1228-1236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/Helpers/LxdSandboxManager.php:1637 — src/Helpers/LxdSandboxManager.php:1637-1645 | src/Helpers/UnifiedSandbox.php:538-546 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdSandboxManager.php:1637` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) REDACTED:381 — REDACTED:381-389 | REDACTED:416-424 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) REDACTED:1263 — REDACTED:1263-1271 | REDACTED:1907-1915 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) src/Handlers/ChatStreamHandler.php:2739 — src/Handlers/ChatStreamHandler.php:2739-2747 | src/Handlers/ImageGenHandler.php:44-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/Handlers/ChatStreamHandler.php:2752 — src/Handlers/ChatStreamHandler.php:2752-2760 | src/Handlers/ImageGenHandler.php:57-65 — 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 (9 lines × 2) src/Handlers/ChatStreamHandler.php:2802 — src/Handlers/ChatStreamHandler.php:2802-2810 | src/Handlers/ImageGenHandler.php:107-115 — 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 (17 lines × 2) · ×10
  • Duplicated block (17 lines × 2) REDACTED:259 — REDACTED:259-275 | REDACTED:287-303 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) saicms/app/Controllers/StoriesController.php:130 — saicms/app/Controllers/StoriesController.php:130-146 | src/Controllers/StoriesController.php:148-164 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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 `saicms/app/Controllers/StoriesController.php:130` 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 (17 lines × 2) REDACTED:684 — REDACTED:684-700 | REDACTED:718-734 — both copies are in the same file, so extract the 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:684` 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 (17 lines × 2) REDACTED:498 — REDACTED:498-514 | REDACTED:673-689 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) REDACTED:1662 — REDACTED:1662-1678 | REDACTED:1795-1811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) src/Core/McpUnifier.php:49 — src/Core/McpUnifier.php:49-65 | src/Core/McpUnifier.php:432-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/McpUnifier.php:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) src/Handlers/ChatStreamHandler.php:2942 — src/Handlers/ChatStreamHandler.php:2942-2958 | src/Handlers/ImageGenHandler.php:246-262 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) src/Handlers/SandboxMcp.php:344 — src/Handlers/SandboxMcp.php:344-360 | src/Handlers/SandboxMcp.php:386-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) src/Sites/Members.php:93 — src/Sites/Members.php:93-109 | src/Sites/Members.php:135-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Sites/Members.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.
  • Duplicated block (17 lines × 2) tools/groq-mcp/src/groq_stt.py:134 — tools/groq-mcp/src/groq_stt.py:134-150 | tools/groq-mcp/src/groq_stt.py:204-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×10
  • Duplicated block (15 lines × 2) REDACTED:1122 — REDACTED:1122-1136 | REDACTED:1193-1207 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) REDACTED:462 — REDACTED:462-476 | REDACTED:1453-1467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) REDACTED:1045 — REDACTED:1045-1059 | REDACTED:1088-1102 — both copies are in the same file, so extract the 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:1045` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/Core/LLM/AbstractLLMProvider.php:122 — src/Core/LLM/AbstractLLMProvider.php:122-136 | src/Core/LLM/Providers/OllamaProvider.php:350-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/LLM/AbstractLLMProvider.php:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Core/LLM/AbstractLLMProvider.php:138` calls `error_log`, `getStatusCode` and `src/Core/LLM/Providers/OllamaProvider.php:366` 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 (15 lines × 2) src/Core/LLM/ProviderRegistry.php:547 — src/Core/LLM/ProviderRegistry.php:547-563 | src/Core/LLM/ProviderRegistry.php:705-719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/Helpers/DockerSandboxManager.php:224 — src/Helpers/DockerSandboxManager.php:224-238 | src/Helpers/LxdSandboxManager.php:146-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. 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 (15 lines × 2) src/Helpers/LxdApiClient.php:385 — src/Helpers/LxdApiClient.php:385-399 | src/Helpers/LxdSandboxManager.php:753-767 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdApiClient.php:385` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) src/Services/BinanceClient.php:304 — src/Services/BinanceClient.php:304-318 | src/Services/BinanceClient.php:345-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) saicms/app/Controllers/StoriesController.php:30 — saicms/app/Controllers/StoriesController.php:30-44 | src/Controllers/StoriesController.php:48-62 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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 (15 lines × 2) REDACTED:47 — REDACTED:47-62 | REDACTED:48-62 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 (14 lines × 2) · ×10
  • Duplicated block (14 lines × 2) REDACTED:557 — REDACTED:557-570 | REDACTED:1645-1658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) REDACTED:392 — REDACTED:392-405 | REDACTED:755-768 — both copies are in the same file, so extract the 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:392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) REDACTED:397 — REDACTED:397-410 | REDACTED:517-530 — both copies are in the same file, so extract the 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:397` 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 (14 lines × 2) src/Controllers/WebhookController.php:1135 — src/Controllers/WebhookController.php:1135-1148 | src/Controllers/WebhookController.php:1245-1258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/Core/LLM/ProviderRegistry.php:548 — src/Core/LLM/ProviderRegistry.php:548-564 | src/Core/LLM/ProviderRegistry.php:735-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.
  • Duplicated block (14 lines × 2) src/Handlers/LightpandaSearchHandler.php:890 — src/Handlers/LightpandaSearchHandler.php:890-903 | src/Handlers/PandaSearchHandler.php:264-277 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Handlers/LightpandaSearchHandler.php:905` calls `error_log` and `src/Handlers/PandaSearchHandler.php:279` 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) src/Handlers/SandboxMcp.php:148 — src/Handlers/SandboxMcp.php:148-161 | src/Handlers/SandboxMcp.php:194-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/Helpers/UnifiedSandbox.php:771 — src/Helpers/UnifiedSandbox.php:771-784 | src/Helpers/UnifiedSandbox.php:794-807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/Services/BinanceClient.php:338 — src/Services/BinanceClient.php:338-351 | src/Services/GtbBrain.php:296-311 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/BinanceClient.php:338` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/Controllers/CourseController.php:393 — src/Controllers/CourseController.php:393-413 | src/Controllers/MasterclassController.php:320-333 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/CourseController.php:393` 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.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×10
  • Process-global state is restored only on the happy path REDACTED:29 — `createSandbox` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 53, reset at line 55) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:70 — `toggleSandbox` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 122, reset at line 124) and the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 131, reset at line 133) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:216 — `tree` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 226, reset at line 230) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:346 — `create` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 354, reset at line 356) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:432 — `rename` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 440, reset at line 442) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:507 — `delete` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 515, reset at line 517) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:581 — `paste` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 589, reset at line 591) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:698 — `save` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 721, reset at line 723) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path REDACTED:784 — `file` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 792, reset at line 794) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path src/Controllers/SandboxController.php:585 — `install` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GINTO_SKIP_SANDBOX_START` environment variable (changed at line 772, reset at line 797) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
D30 · Dependency Vulnerabilities · Medium CVE · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×9
  • Duplicated block (8 lines × 2) src/Controllers/AdminController.php:139 — src/Controllers/AdminController.php:139-146 | REDACTED:336-343 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) REDACTED:685 — REDACTED:685-692 | REDACTED:928-936 — 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 `REDACTED:685` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/Controllers/CourseController.php:224 — src/Controllers/CourseController.php:224-231 | src/Controllers/MasterclassController.php:215-222 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) REDACTED:557 — REDACTED:557-564 | REDACTED:1410-1417 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1408` calls `validateCsrfFromInput` and `REDACTED:555` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) REDACTED:2133 — REDACTED:2133-2140 | REDACTED:2158-2165 — both copies are in the same file, so extract the 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:2133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:2167` calls `basename` and `REDACTED:2141` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) src/Models/Product.php:162 — src/Models/Product.php:162-172 | src/Models/Product.php:289-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Models/Product.php:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Models/Product.php:173` calls `listByBarangay`, `empty` and `src/Models/Product.php:297` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) src/Services/GtbStrategy.php:684 — src/Services/GtbStrategy.php:684-691 | src/Services/GtbStrategy.php:739-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/GtbStrategy.php:684` 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) REDACTED:134 — REDACTED:134-141 | REDACTED:162-169 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) REDACTED:121 — REDACTED:121-128 | REDACTED:424-431 — both copies are in the same file, so extract the 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 · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×8
  • Duplicated block (16 lines × 2) saicms/app/Controllers/ApiController.php:288 — saicms/app/Controllers/ApiController.php:288-303 | REDACTED:598-613 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) saicms/app/Controllers/ChatController.php:1404 — saicms/app/Controllers/ChatController.php:1404-1419 | saicms/app/Controllers/ChatController.php:1422-1438 — both copies are in the same file, so extract the 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 (16 lines × 2) src/Controllers/CourseController.php:767 — src/Controllers/CourseController.php:767-782 | src/Controllers/MasterclassController.php:615-630 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/CourseController.php:767` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) REDACTED:736 — REDACTED:736-751 | REDACTED:805-820 — both copies are in the same file, so extract the 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:736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) REDACTED:257 — REDACTED:257-272 | REDACTED:263-278 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 `REDACTED:257` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:280` calls `getLxcBin` and `REDACTED:274` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) src/Controllers/MallCheckoutController.php:55 — src/Controllers/MallCheckoutController.php:55-71 | src/Controllers/MallCheckoutController.php:125-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/MallCheckoutController.php:55` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) REDACTED:79 — REDACTED:79-94 | REDACTED:275-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/Handlers/ChatStreamHandler.php:3027 — src/Handlers/ChatStreamHandler.php:3027-3042 | src/Handlers/ImageGenHandler.php:317-332 — 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×7
  • Duplicated block (21 lines × 2) REDACTED:277 — REDACTED:277-297 | REDACTED:312-332 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) saicms/app/Controllers/WebhookController.php:155 — saicms/app/Controllers/WebhookController.php:155-175 | src/Controllers/WebhookController.php:169-189 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 (21 lines × 2) REDACTED:1474 — REDACTED:1474-1494 | REDACTED:2066-2086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) src/Controllers/UserController.php:1295 — src/Controllers/UserController.php:1295-1315 | src/Controllers/UserController.php:1338-1358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/UserController.php:1295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) src/Handlers/ChatStreamHandler.php:163 — src/Handlers/ChatStreamHandler.php:163-183 | src/Handlers/ChatStreamHandler.php:853-873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) src/Handlers/ChatStreamHandler.php:223 — src/Handlers/ChatStreamHandler.php:223-243 | src/Handlers/ChatStreamHandler.php:292-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/ChatStreamHandler.php:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) src/Controllers/AdminController.php:163 — src/Controllers/AdminController.php:163-183 | src/Controllers/AdminController.php:185-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/AdminController.php:163` 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.
AC1 · Text alternatives · <video> without a captions track · ×6
  • <video> without a captions track public/assets/client/js/stories.js:375 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track public/assets/client/js/typeahead-chat.js:2748 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track public/assets/client/js/typeahead-chat.js:2837 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track saicms/public/assets/client/js/stories.js:375 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track saicms/public/assets/client/js/typeahead-chat.js:2701 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track saicms/public/assets/client/js/typeahead-chat.js:2790 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×6
  • Modal dialog does not manage focus public/assets/client/js/profile.js:744 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus public/assets/client/js/profile.js:1087 — This <div role="alertdialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus public/index.html:106 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus saicms/app/views/code.view.php:823 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus saicms/app/views/dashboard.php:149 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus saicms/app/views/dashboard.php:584 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D6 · Cohesion (LCOM4) · Low cohesion · ×6
  • Low cohesion: ChatController (LCOM4 6) REDACTED:10 — ChatController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PaymentController (LCOM4 6) REDACTED:11 — PaymentController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TunnelController (LCOM4 6) REDACTED:13 — TunnelController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SandboxController (LCOM4 5) src/Controllers/SandboxController.php:14 — SandboxController's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AuthController (LCOM4 4) REDACTED:11 — AuthController's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ImageGenHandler (LCOM4 4) src/Handlers/ImageGenHandler.php:20 — ImageGenHandler's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D2 · Cognitive Complexity · (anonymous) · ×5
  • (anonymous)::extend (cognitive 43) REDACTED:38 — (anonymous)::extend has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 2 (12 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • (anonymous)::init (cognitive 27) REDACTED:138 — (anonymous)::init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, ternaries 2 (6 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)::handleNewPostSubmissionFromUploader (cognitive 22) saicms/public/assets/client/js/mediamanager.js:1047 — (anonymous)::handleNewPostSubmissionFromUploader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • (anonymous)::handleKeyDown (cognitive 21) saicms/public/assets/gaming/typing/js/typing.js:337 — (anonymous)::handleKeyDown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 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.
  • (anonymous)::staticEach (cognitive 19) REDACTED:85 — (anonymous)::staticEach has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 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.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×5
  • Edited copy of a member (9 corresponding lines) REDACTED:277 — REDACTED:277-285 | REDACTED:424-450 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:1232 — REDACTED:1232-1240 | src/Support/RelayAuth.php:279-297 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/Models/GtbTrade.php:23 — src/Models/GtbTrade.php:23-31 | src/Models/GtbTrade.php:48-56 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/Controllers/CourseController.php:223 — src/Controllers/CourseController.php:223-231 | src/Controllers/MasterclassController.php:214-222 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/Services/MallCommerceService.php:60 — src/Services/MallCommerceService.php:60-75 | src/Services/SilverQueenEngine.php:1006-1014 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×5
  • Edited copy of a member (2 corresponding lines) REDACTED:1230 — REDACTED:1230-1237 | src/Controllers/SocialController.php:490-491 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) src/Handlers/ChatStreamHandler.php:205 — src/Handlers/ChatStreamHandler.php:205-206 | src/Handlers/PandaSearchHandler.php:535-536 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) saicms/app/Controllers/StoriesController.php:426 — saicms/app/Controllers/StoriesController.php:426-427 | src/Controllers/StoriesController.php:451-452 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) saicms/app/Controllers/StoriesController.php:422 — saicms/app/Controllers/StoriesController.php:422-423 | src/Controllers/StoriesController.php:447-448 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) src/Playground/FixedPtyServer.php:149 — src/Playground/FixedPtyServer.php:149-150 | src/Playground/PtyServer.php:354-355 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×5
  • Duplicated block (18 lines × 2) saicms/app/Controllers/ApiController.php:308 — saicms/app/Controllers/ApiController.php:308-325 | REDACTED:915-932 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) REDACTED:999 — REDACTED:999-1016 | REDACTED:270-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:999` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) REDACTED:274 — REDACTED:274-291 | REDACTED:281-298 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 `REDACTED: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:280` calls `getLxcBin` and `REDACTED:272` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) REDACTED:234 — REDACTED:234-251 | REDACTED:343-360 — both copies are in the same file, so extract the 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:234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/Helpers/DockerSandboxManager.php:984 — src/Helpers/DockerSandboxManager.php:984-1001 | src/Helpers/LxdSandboxManager.php:1755-1772 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/DockerSandboxManager.php:984` 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 (10 lines × 2) · ×5
  • Duplicated block (10 lines × 2) saicms/app/Controllers/UploadController.php:365 — saicms/app/Controllers/UploadController.php:365-374 | src/Controllers/UploadController.php:392-401 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 (10 lines × 2) saicms/app/Controllers/UploadController.php:743 — saicms/app/Controllers/UploadController.php:743-752 | src/Controllers/UploadController.php:770-779 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 (10 lines × 2) REDACTED:502 — REDACTED:502-511 | REDACTED:1056-1065 — both copies are in the same file, so extract the 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:502` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/Handlers/ChatStreamHandler.php:2928 — src/Handlers/ChatStreamHandler.php:2928-2937 | src/Handlers/ImageGenHandler.php:232-241 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) REDACTED:156 — REDACTED:156-165 | REDACTED:159-168 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 (7 lines × 4) · ×5
  • Duplicated block (7 lines × 4) REDACTED:234 — REDACTED:234-240 | REDACTED:446-452 | REDACTED:770-776 | REDACTED:819-825 — 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 `REDACTED:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:816` calls `vncConnect`, `header` and `REDACTED:232` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) src/Controllers/CourseController.php:651 — src/Controllers/CourseController.php:651-657 | src/Controllers/CourseController.php:695-701 | src/Controllers/MasterclassController.php:491-497 | src/Controllers/MasterclassController.php:535-541 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 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 × 4) REDACTED:902 — REDACTED:902-908 | REDACTED:1112-1118 | REDACTED:1259-1265 | src/Controllers/UserController.php:1115-1121 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:909` calls `curl_setopt` and `REDACTED:1120` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) REDACTED:105 — REDACTED:105-111 | REDACTED:129-135 | REDACTED:180-186 | REDACTED:234-240 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:105` 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 × 4) REDACTED:264 — REDACTED:264-270 | REDACTED:317-323 | REDACTED:292-298 | REDACTED:350-356 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:264` 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, `REDACTED:271` calls `get` and `REDACTED:324` 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.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×4
  • Heading level jumps from h1 to h3 saicms/app/views/dashboard/smartfi360.view.php:548 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 saicms/app/views/groups/home.view.php:230 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 saicms/app/views/marketplace/marketfeed.view.php:285 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 saicms/app/views/stream.view.php:51 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
D1 · Cyclomatic Complexity · (anonymous) · ×4
  • (anonymous)::extend (cyclomatic 21) REDACTED:38 — (anonymous)::extend 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.
  • (anonymous)::handleKeyDown (cyclomatic 21) saicms/public/assets/gaming/typing/js/typing.js:337 — (anonymous)::handleKeyDown 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)::init (cyclomatic 19) REDACTED:138 — (anonymous)::init has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous)::handleNewPostSubmissionFromUploader (cyclomatic 16) saicms/public/assets/client/js/mediamanager.js:1047 — (anonymous)::handleNewPostSubmissionFromUploader 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.
D17 · Explicit Debt · TodoComment · ×4
  • TodoComment src/Views/code/code.php:1054 — // TODO: Update UI/backend — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment saicms/app/views/code.view.php:760 — // TODO: Update UI/backend — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Controllers/UploadController.php:185 — // TODO: Implement B2 actual file deletion — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment saicms/app/Controllers/UploadController.php:181 — // TODO: Implement B2 actual file deletion — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (6 members, 50+ identical tokens) REDACTED:976 — REDACTED:976-1031 | saicms/app/Controllers/GroupController.php:195-241 | saicms/app/Controllers/HomeController.php:174-220 | saicms/app/Controllers/ProfileController.php:479-540 | saicms/app/Controllers/SocialController.php:154-195 | REDACTED:1047-1102 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/Controllers/SitesController.php:292 — src/Controllers/SitesController.php:292-298 | src/Controllers/SitesController.php:304-311 | src/Controllers/SitesController.php:317-324 | src/Controllers/SitesController.php:330-337 | src/Controllers/SitesController.php:379-414 | src/Controllers/SitesController.php:593-609 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/Handlers/SandboxMcp.php:146 — src/Handlers/SandboxMcp.php:146-180 | src/Handlers/SandboxMcp.php:192-238 | src/Handlers/SandboxMcp.php:250-273 | src/Handlers/SandboxMcp.php:285-332 | src/Handlers/SandboxMcp.php:433-463 | src/Handlers/SandboxMcp.php:586-603 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/Helpers/LxdSandboxManager.php:1847 — src/Helpers/LxdSandboxManager.php:1847-1882 | src/Helpers/LxdSandboxManager.php:1895-1927 | src/Helpers/LxdSandboxManager.php:1940-1971 | src/Helpers/LxdSandboxManager.php:1983-2013 | src/Helpers/LxdSandboxManager.php:2026-2058 | src/Helpers/LxdSandboxManager.php:2096-2128 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×4
  • Edited copy of a member (10 corresponding lines) REDACTED:134 — REDACTED:134-143 | REDACTED:162-171 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) src/Services/MallPushService.php:455 — src/Services/MallPushService.php:455-464 | src/Services/MallPushService.php:581-590 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) REDACTED:566 — REDACTED:566-575 | REDACTED:683-692 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) REDACTED:2671 — REDACTED:2671-2680 | src/Services/MallCommerceService.php:2421-2436 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) src/Services/BinanceClient.php:335 — src/Services/BinanceClient.php:335-359 | src/Services/GtbBrain.php:296-319 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) REDACTED:1547 — REDACTED:1547-1570 | src/Controllers/SqMallRelayController.php:175-201 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) REDACTED:999 — REDACTED:999-1027 | REDACTED:270-293 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) src/Helpers/LxdApiClient.php:54 — src/Helpers/LxdApiClient.php:54-77 | src/Helpers/LxdApiClient.php:93-118 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×4
  • Edited copy of a member (29 corresponding lines) REDACTED:73 — REDACTED:73-101 | REDACTED:272-317 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) REDACTED:2857 — REDACTED:2857-2889 | REDACTED:2894-2922 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) REDACTED:318 — REDACTED:318-346 | REDACTED:355-383 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) REDACTED:601 — REDACTED:601-629 | REDACTED:833-870 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×4
  • Duplicated block (33 lines × 2) REDACTED:411 — REDACTED:411-443 | REDACTED:418-450 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 (33 lines × 2) src/Handlers/ChatStreamHandler.php:2765 — src/Handlers/ChatStreamHandler.php:2765-2797 | src/Handlers/ImageGenHandler.php:70-102 — 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 (33 lines × 2) REDACTED:999 — REDACTED:999-1031 | REDACTED:1070-1102 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 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 (33 lines × 2) REDACTED:469 — REDACTED:469-501 | REDACTED:502-534 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×4
  • Duplicated block (29 lines × 2) REDACTED:357 — REDACTED:357-385 | REDACTED:364-392 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 (29 lines × 2) src/Controllers/SandboxController.php:685 — src/Controllers/SandboxController.php:685-713 | src/Controllers/SandboxController.php:724-752 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SandboxController.php:685` 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 (29 lines × 2) src/Core/UserRateLimiter.php:238 — src/Core/UserRateLimiter.php:238-266 | src/Core/UserRateLimiter.php:270-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/UserRateLimiter.php:238` 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 (29 lines × 2) REDACTED:438 — REDACTED:438-466 | REDACTED:471-499 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×4
  • Duplicated block (25 lines × 2) REDACTED:226 — REDACTED:226-250 | REDACTED:256-280 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 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 (25 lines × 2) saicms/app/Controllers/WebhookController.php:191 — saicms/app/Controllers/WebhookController.php:191-215 | src/Controllers/WebhookController.php:205-229 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 `saicms/app/Controllers/WebhookController.php:191` 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 (25 lines × 2) REDACTED:318 — REDACTED:318-342 | REDACTED:355-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) REDACTED:95 — REDACTED:95-119 | REDACTED:95-119 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 `REDACTED:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:122` calls `preg_replace`, `implode` and `REDACTED:121` 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 (18 lines × 3) · ×4
  • Duplicated block (18 lines × 3) REDACTED:395 — REDACTED:395-412 | REDACTED:511-528 | REDACTED:615-632 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (18 lines × 3) src/Controllers/SandboxController.php:394 — src/Controllers/SandboxController.php:394-411 | src/Controllers/SandboxController.php:525-542 | src/Controllers/SandboxController.php:1128-1145 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SandboxController.php:394` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 3) src/Controllers/UserController.php:1246 — src/Controllers/UserController.php:1246-1263 | src/Controllers/UserController.php:1272-1289 | src/Controllers/UserController.php:1295-1312 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/UserController.php:1246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 3) src/Helpers/LxdApiClient.php:93 — src/Helpers/LxdApiClient.php:93-111 | src/Helpers/LxdApiClient.php:131-149 | src/Helpers/LxdApiClient.php:167-184 — 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 (13 lines × 3) · ×4
  • Duplicated block (13 lines × 3) REDACTED:1124 — REDACTED:1124-1136 | REDACTED:1195-1207 | src/Controllers/SocialController.php:501-513 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) saicms/app/Controllers/GroupController.php:290 — saicms/app/Controllers/GroupController.php:290-302 | saicms/app/Controllers/HomeController.php:269-281 | saicms/app/Controllers/SocialController.php:239-251 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.php:290` 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 (13 lines × 3) REDACTED:185 — REDACTED:185-197 | REDACTED:214-226 | REDACTED:243-255 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) REDACTED:418 — REDACTED:418-430 | REDACTED:949-961 | REDACTED:1052-1064 — 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 (11 lines × 3) · ×4
  • Duplicated block (11 lines × 3) REDACTED:41 — REDACTED:41-51 | saicms/app/Controllers/UploadController.php:214-224 | src/Controllers/UploadController.php:218-228 — 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.
  • Duplicated block (11 lines × 3) REDACTED:24 — REDACTED:24-34 | src/Controllers/SocialController.php:21-31 | src/Controllers/StoriesController.php:36-46 — 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 `REDACTED:24` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) src/Controllers/AdminController.php:343 — src/Controllers/AdminController.php:343-353 | REDACTED:823-833 | REDACTED:1103-1113 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/AdminController.php:343` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 3) src/Handlers/SandboxMcp.php:147 — src/Handlers/SandboxMcp.php:147-157 | src/Handlers/SandboxMcp.php:193-203 | src/Handlers/SandboxMcp.php:286-296 — 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 (9 lines × 4) · ×4
  • Duplicated block (9 lines × 4) REDACTED:626 — REDACTED:626-634 | REDACTED:941-949 | src/Controllers/LiveController.php:220-228 | src/Controllers/MigrationController.php:251-259 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 4) REDACTED:125 — REDACTED:125-133 | REDACTED:366-374 | REDACTED:550-558 | REDACTED:607-615 — 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 `REDACTED:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) REDACTED:1667 — REDACTED:1667-1676 | REDACTED:191-200 | REDACTED:521-530 | REDACTED:720-728 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1667` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:188` calls `session_status`, `session_start` and `REDACTED:718` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 4) src/Helpers/LxdSandboxManager.php:1917 — src/Helpers/LxdSandboxManager.php:1917-1925 | src/Helpers/LxdSandboxManager.php:2001-2011 | src/Helpers/LxdSandboxManager.php:2047-2056 | src/Helpers/LxdSandboxManager.php:2117-2126 — 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 (8 lines × 3) · ×4
  • Duplicated block (8 lines × 3) REDACTED:311 — REDACTED:311-318 | saicms/app/Controllers/ChatController.php:1567-1574 | REDACTED:344-351 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) saicms/app/Controllers/StoriesController.php:26 — saicms/app/Controllers/StoriesController.php:26-33 | saicms/app/Controllers/UploadController.php:49-56 | src/Controllers/UploadController.php:53-60 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/UploadController.php:52` calls `getInstance` and `saicms/app/Controllers/StoriesController.php:25` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) src/Controllers/LiveController.php:128 — src/Controllers/LiveController.php:128-137 | src/Controllers/LiveController.php:932-939 | src/Controllers/LiveController.php:1144-1151 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/LiveController.php:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) src/Helpers/LxdSandboxManager.php:1853 — src/Helpers/LxdSandboxManager.php:1853-1860 | src/Helpers/LxdSandboxManager.php:1901-1908 | src/Helpers/LxdSandboxManager.php:1946-1953 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdSandboxManager.php:1853` 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 (5 lines × 3) · ×4
  • Duplicated block (5 lines × 3) REDACTED:1080 — REDACTED:72-76 | REDACTED:1080-1084 | REDACTED:1219-1223 — 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 `REDACTED:72` 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 × 3) REDACTED:2112 — REDACTED:2112-2116 | REDACTED:2136-2140 | REDACTED:2161-2165 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:2167` calls `basename` and `REDACTED:2117` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) src/Controllers/SandboxController.php:1675 — src/Controllers/SandboxController.php:1675-1679 | src/Controllers/SandboxController.php:1758-1762 | src/Controllers/SandboxController.php:1888-1892 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) src/Services/SilverQueenEngine.php:830 — src/Services/SilverQueenEngine.php:830-834 | src/Services/SilverQueenEngine.php:843-848 | src/Services/SilverQueenEngine.php:893-897 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/SilverQueenEngine.php:830` 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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×3
  • FunctionTooLong: typing.document.addEventListener("DOMContentLoaded") saicms/public/assets/gaming/typing/js/typing.js:1 — FunctionTooLong — document.addEventListener("DOMContentLoaded") runs 348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 248 over it, 3.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: websearch.generateImage REDACTED:583 — FunctionTooLong — generateImage runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.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: stealth-browser.generateRaphaelImage tools/lightpanda-mcp/scripts/stealth-browser.js:513 — FunctionTooLong — generateRaphaelImage 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.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (7 members, 50+ identical tokens) src/Controllers/AdminController.php:342 — src/Controllers/AdminController.php:342-353 | REDACTED:818-833 | REDACTED:1098-1113 | src/Controllers/PaymentsAdminController.php:197-211 | REDACTED:316-330 | src/Controllers/ReferralLinksAdminController.php:19-33 | REDACTED:452-466 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) REDACTED:218 — REDACTED:218-286 | REDACTED:348-426 | REDACTED:434-501 | REDACTED:509-558 | REDACTED:583-675 | REDACTED:700-778 | REDACTED:786-865 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) REDACTED:114 — REDACTED:114-130 | REDACTED:149-162 | REDACTED:170-178 | REDACTED:190-202 | REDACTED:210-222 | REDACTED:230-243 | REDACTED:251-263 — These 7 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 7 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 7 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:619 — REDACTED:619-700 | REDACTED:704-826 | REDACTED:544-633 | REDACTED:680-757 | REDACTED:761-901 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) saicms/app/Controllers/StoriesController.php:366 — saicms/app/Controllers/StoriesController.php:366-408 | REDACTED:305-345 | saicms/app/Controllers/UploadController.php:672-699 | src/Controllers/StoriesController.php:391-433 | src/Controllers/UploadController.php:699-726 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:542 — REDACTED:542-613 | REDACTED:621-704 | REDACTED:714-785 | src/Helpers/LxdApiClient.php:364-401 | src/Helpers/LxdSandboxManager.php:716-772 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (70 corresponding lines) · ×3
  • Edited copy of a member (70 corresponding lines) REDACTED:306 — REDACTED:306-375 | REDACTED:383-457 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (70 corresponding lines) REDACTED:153 — REDACTED:153-222 | REDACTED:181-252 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (70 corresponding lines) src/Handlers/ChatStreamHandler.php:2824 — src/Handlers/ChatStreamHandler.php:2824-2893 | src/Handlers/ImageGenHandler.php:129-198 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) src/Services/MallCommerceService.php:1782 — src/Services/MallCommerceService.php:1782-1800 | src/Services/MallCommerceService.php:1806-1824 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) src/Handlers/PayMongoHandler.php:545 — src/Handlers/PayMongoHandler.php:545-578 | src/Handlers/PayMongoHandler.php:619-637 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) src/Handlers/LightpandaSearchHandler.php:997 — src/Handlers/LightpandaSearchHandler.php:997-1017 | src/Handlers/PandaSearchHandler.php:341-359 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×3
  • Edited copy of a member (14 corresponding lines) src/Security/PmaGate.php:202 — src/Security/PmaGate.php:202-231 | src/Services/TotpService.php:113-126 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) REDACTED:719 — REDACTED:405-418 | REDACTED:719-745 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/Controllers/MallDeliveryController.php:587 — src/Controllers/MallDeliveryController.php:587-603 | src/Controllers/MallDeliveryController.php:626-639 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×3
  • Edited copy of a member (30 corresponding lines) src/Core/LLM/UnifiedMcpClient.php:965 — src/Core/LLM/UnifiedMcpClient.php:965-1006 | src/Helpers/AdminErrorLogger.php:16-45 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) REDACTED:671 — REDACTED:671-700 | REDACTED:705-734 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) REDACTED:139 — REDACTED:139-168 | REDACTED:1704-1733 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×3
  • Edited copy of a member (11 corresponding lines) src/Core/LLM/AbstractLLMProvider.php:32 — src/Core/LLM/AbstractLLMProvider.php:32-43 | src/Core/LLM/Providers/OllamaProvider.php:74-84 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) REDACTED:60 — REDACTED:60-70 | REDACTED:565-591 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/Helpers/LxdSandboxManager.php:622 — src/Helpers/LxdSandboxManager.php:622-632 | src/Helpers/SandboxProxy.php:44-55 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×3
  • Duplicated block (39 lines × 2) saicms/app/Controllers/WebhookController.php:220 — saicms/app/Controllers/WebhookController.php:220-258 | src/Controllers/WebhookController.php:234-272 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 `saicms/app/Controllers/WebhookController.php:220` 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 (39 lines × 2) src/Controllers/ClientsController.php:192 — src/Controllers/ClientsController.php:192-230 | src/Controllers/ClientsController.php:427-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/ClientsController.php:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Controllers/ClientsController.php:237` calls `basename`, `strtolower`, `pathinfo` and `src/Controllers/ClientsController.php:468` 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 (39 lines × 2) REDACTED:1090 — REDACTED:1090-1128 | REDACTED:1237-1275 — both copies are in the same file, so extract the 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:1090` 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 (28 lines × 2) · ×3
  • Duplicated block (28 lines × 2) saicms/app/Controllers/ApiController.php:349 — saicms/app/Controllers/ApiController.php:349-376 | REDACTED:965-992 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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 (28 lines × 2) REDACTED:121 — REDACTED:121-148 | REDACTED:124-151 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:122` calls `preg_replace`, `implode` and `REDACTED:119` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (28 lines × 2) REDACTED:1673 — REDACTED:1673-1700 | REDACTED:1737-1764 — both copies are in the same file, so extract the 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:1673` 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 (23–24 lines × 2) · ×3
  • Duplicated block (23–24 lines × 2) REDACTED:370 — REDACTED:370-392 | REDACTED:489-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:370` 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 (23–24 lines × 2) src/Helpers/LxdApiClient.php:132 — src/Helpers/LxdApiClient.php:132-155 | src/Helpers/LxdApiClient.php:168-190 — both copies are in the same file, so extract the 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 (23–24 lines × 2) src/Helpers/LxdSandboxManager.php:1574 — src/Helpers/LxdSandboxManager.php:1574-1597 | src/Helpers/UnifiedSandbox.php:644-666 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdSandboxManager.php:1574` 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) REDACTED:931 — REDACTED:931-953 | REDACTED:1055-1077 — both copies are in the same file, so extract the 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, `REDACTED:1051` calls `validateCsrf` and `REDACTED:927` 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 (23 lines × 2) src/Core/RateLimitService.php:294 — src/Core/RateLimitService.php:294-316 | src/Core/RateLimitService.php:319-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2) tools/groq-mcp/src/groq_stt.py:97 — tools/groq-mcp/src/groq_stt.py:97-119 | tools/groq-mcp/src/groq_stt.py:178-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `tools/groq-mcp/src/groq_stt.py:121` calls `get` and `tools/groq-mcp/src/groq_stt.py:201` 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 (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) REDACTED:714 — REDACTED:714-733 | REDACTED:767-786 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:714` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) REDACTED:610 — REDACTED:610-629 | REDACTED:851-870 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (20 lines × 2) src/Handlers/ImageGenHandler.php:424 — src/Handlers/ImageGenHandler.php:424-443 | src/Handlers/ImageGenHandler.php:571-590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/ImageGenHandler.php:424` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Handlers/ImageGenHandler.php:592` calls `strpos`, `explode` and `src/Handlers/ImageGenHandler.php:444` 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 (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) REDACTED:2112 — REDACTED:2112-2130 | REDACTED:2136-2154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) REDACTED:451 — REDACTED:451-469 | REDACTED:459-477 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 `REDACTED:451` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) src/Helpers/LxdSandboxManager.php:1605 — src/Helpers/LxdSandboxManager.php:1605-1623 | src/Helpers/UnifiedSandbox.php:680-698 — 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) src/Controllers/PaymentsAdminController.php:114 — src/Controllers/PaymentsAdminController.php:114-130 | src/Controllers/PaymentsAdminController.php:164-181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/PaymentsAdminController.php:159` calls `json_decode`, `file_get_contents`, `trim` and `src/Controllers/PaymentsAdminController.php:110` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17–18 lines × 2) REDACTED:547 — REDACTED:547-564 | REDACTED:670-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:547` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) src/Core/ProviderKeyManager.php:317 — src/Core/ProviderKeyManager.php:317-334 | src/Core/ProviderKeyManager.php:345-361 — both copies are in the same file, so extract the 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 (14–15 lines × 2) · ×3
  • Duplicated block (14–15 lines × 2) REDACTED:90 — REDACTED:90-104 | REDACTED:593-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.
  • Duplicated block (14–15 lines × 2) REDACTED:95 — REDACTED:95-109 | src/Controllers/PostsController.php:33-46 — 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 `REDACTED:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) src/Helpers/DockerSandboxManager.php:1055 — src/Helpers/DockerSandboxManager.php:1055-1069 | src/Helpers/LxdSandboxManager.php:1820-1833 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/DockerSandboxManager.php:1055` 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 (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) REDACTED:795 — REDACTED:795-807 | src/Controllers/MigrationController.php:211-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/MigrationController.php:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) REDACTED:25 — REDACTED:25-36 | src/Controllers/SocialController.php:22-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:25` 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–13 lines × 2) REDACTED:2015 — REDACTED:2015-2026 | REDACTED:2329-2341 — both copies are in the same file, so extract the 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:2015` 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 (12 lines × 5) · ×3
  • Duplicated block (12 lines × 5) REDACTED:39 — REDACTED:39-50 | REDACTED:94-105 | REDACTED:704-715 | src/Controllers/SandboxController.php:608-619 | src/Controllers/SandboxController.php:909-920 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:39` 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, `REDACTED:718` calls `defined`, `dirname` and `REDACTED:52` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 5) REDACTED:315 — REDACTED:315-326 | REDACTED:409-420 | REDACTED:535-546 | REDACTED:1042-1053 | REDACTED:1085-1096 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 5) REDACTED:368 — REDACTED:368-379 | REDACTED:910-921 | REDACTED:1013-1024 | REDACTED:1111-1122 | REDACTED:1196-1207 — 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 `REDACTED:368` 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 (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) REDACTED:229 — REDACTED:229-240 | REDACTED:441-452 | REDACTED:765-776 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) src/Controllers/LiveController.php:926 — src/Controllers/LiveController.php:926-937 | src/Controllers/LiveController.php:1087-1098 | src/Controllers/LiveController.php:1138-1149 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) REDACTED:929 — REDACTED:929-940 | REDACTED:1053-1064 | REDACTED:1096-1107 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:929` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1051` calls `validateCsrf` and `REDACTED:927` 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 (10–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) REDACTED:82 — REDACTED:82-91 | saicms/app/Controllers/GameController.php:91-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10–12 lines × 2) src/Services/SilverQueenEngine.php:360 — src/Services/SilverQueenEngine.php:360-369 | src/Services/SilverQueenEngine.php:735-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/SilverQueenEngine.php:360` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–12 lines × 2) REDACTED:122 — REDACTED:122-131 | REDACTED:1349-1360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:122` 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–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) REDACTED:1027 — REDACTED:1027-1037 | REDACTED:1845-1856 — both copies are in the same file, so extract the 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:1027` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) REDACTED:162 — REDACTED:162-172 | src/Controllers/UserController.php:1425-1436 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/UserController.php:1425` 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 (11–12 lines × 2) src/Playground/FixedPtyServer.php:57 — src/Playground/FixedPtyServer.php:57-68 | src/Playground/PtyServer.php:217-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Playground/FixedPtyServer.php:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×3
  • Duplicated block (9–11 lines × 2) REDACTED:238 — REDACTED:238-246 | src/Controllers/UserController.php:1794-1804 — 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 `REDACTED:238` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–11 lines × 2) src/Helpers/LxdSandboxManager.php:1853 — src/Helpers/LxdSandboxManager.php:1853-1863 | src/Helpers/LxdSandboxManager.php:1946-1954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdSandboxManager.php:1853` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–11 lines × 2) src/Playground/MallNotifyServer.php:63 — src/Playground/MallNotifyServer.php:63-71 | src/Playground/MessengerServer.php:53-63 — 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 lines × 3) · ×3
  • Duplicated block (10 lines × 3) src/Sites/Insights.php:165 — src/Sites/Insights.php:165-174 | src/Sites/Members.php:101-110 | src/Sites/Members.php:143-152 — 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 (10 lines × 3) src/Views/admin/parts/icon_helpers.php:145 — src/Views/admin/parts/icon_helpers.php:145-154 | src/Views/admin/parts/icon_helpers.php:188-197 | src/Views/admin/parts/icon_helpers.php:230-239 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Views/admin/parts/icon_helpers.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 (10 lines × 3) src/Handlers/ChatStreamHandler.php:1091 — src/Handlers/ChatStreamHandler.php:1091-1100 | src/Handlers/ChatStreamHandler.php:1113-1122 | src/Handlers/PandaSearchHandler.php:498-507 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/ChatStreamHandler.php:1091` 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) · ×3
  • Duplicated block (9 lines × 3) REDACTED:71 — REDACTED:71-79 | REDACTED:504-512 | REDACTED:170-178 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:499` calls `requireAdmin`, `json_decode`, `file_get_contents` and `REDACTED:167` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) REDACTED:373 — REDACTED:373-381 | REDACTED:517-525 | REDACTED:555-563 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/Controllers/CourseController.php:66 — src/Controllers/CourseController.php:66-74 | src/Controllers/CourseController.php:141-152 | src/Controllers/MasterclassController.php:68-76 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/CourseController.php:66` 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 (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) REDACTED:1104 — REDACTED:427-434 | REDACTED:473-480 | REDACTED:1104-1111 | REDACTED:1243-1250 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) REDACTED:1401 — REDACTED:1401-1408 | REDACTED:1696-1703 | REDACTED:1755-1762 | REDACTED:1864-1871 — 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 `REDACTED:1401` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) src/Services/GtbStrategy.php:632 — src/Services/GtbStrategy.php:632-639 | src/Services/GtbStrategy.php:660-667 | src/Services/GtbStrategy.php:682-689 | src/Services/GtbStrategy.php:737-744 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/GtbStrategy.php:632` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Services/GtbStrategy.php:657` calls `in_array`, `protectLive`, `empty` and `src/Services/GtbStrategy.php:630` 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 (5 lines × 4) · ×3
  • Duplicated block (5 lines × 4) REDACTED:462 — REDACTED:462-466 | REDACTED:862-872 | REDACTED:495-499 | REDACTED:933-943 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:462` 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 × 4) saicms/app/Controllers/GroupController.php:141 — saicms/app/Controllers/GroupController.php:141-148 | saicms/app/Controllers/HomeController.php:120-127 | saicms/app/Controllers/SocialController.php:110-114 | src/Controllers/SocialController.php:156-160 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.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 (5 lines × 4) saicms/app/Controllers/StoriesController.php:189 — saicms/app/Controllers/StoriesController.php:189-193 | saicms/app/Controllers/UploadController.php:257-264 | src/Controllers/StoriesController.php:205-209 | src/Controllers/UploadController.php:281-288 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:189` 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 (3–5 lines × 3) · ×3
  • Duplicated block (3–5 lines × 3) REDACTED:1673 — REDACTED:1673-1677 | REDACTED:1737-1741 | REDACTED:1857-1859 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1673` 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 (3–5 lines × 3) REDACTED:567 — REDACTED:567-571 | REDACTED:1223-1225 | REDACTED:1421-1425 — 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 `REDACTED:1223` 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 (3–5 lines × 3) src/Controllers/SellerController.php:510 — src/Controllers/SellerController.php:510-512 | src/Controllers/SellerController.php:568-572 | src/Controllers/SellerController.php:647-651 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/SellerController.php:647` calls `empty`, `http_response_code` and `src/Controllers/SellerController.php:510` 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.
AC3 · Page structure · Multiple navigation landmarks without distinguishing labels · ×2
  • Multiple navigation landmarks without distinguishing labels saicms/app/views/friends.view.php:77 — With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled.
  • Multiple navigation landmarks without distinguishing labels saicms/app/views/profile.view.php:21 — With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled.
D1 · Cyclomatic Complexity · UploadController.upload (cyclomatic 62) · ×2
  • UploadController.upload (cyclomatic 62) saicms/app/Controllers/UploadController.php:67 — UploadController.upload has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • UploadController.upload (cyclomatic 62) src/Controllers/UploadController.php:71 — UploadController.upload has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent 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 · UploadController.handleUploadProfilePicture (cyclomatic 21) · ×2
  • UploadController.handleUploadProfilePicture (cyclomatic 21) saicms/app/Controllers/UploadController.php:793 — UploadController.handleUploadProfilePicture 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.
  • UploadController.handleUploadProfilePicture (cyclomatic 21) src/Controllers/UploadController.php:820 — UploadController.handleUploadProfilePicture 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 · UploadController.handleUploadCoverPhoto (cyclomatic 20) · ×2
  • UploadController.handleUploadCoverPhoto (cyclomatic 20) saicms/app/Controllers/UploadController.php:415 — UploadController.handleUploadCoverPhoto 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.
  • UploadController.handleUploadCoverPhoto (cyclomatic 20) src/Controllers/UploadController.php:442 — UploadController.handleUploadCoverPhoto 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 · StoriesController._pm_deleteFromB2 (cyclomatic 19) · ×2
  • StoriesController._pm_deleteFromB2 (cyclomatic 19) saicms/app/Controllers/StoriesController.php:484 — StoriesController._pm_deleteFromB2 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.
  • StoriesController._pm_deleteFromB2 (cyclomatic 19) src/Controllers/StoriesController.php:509 — StoriesController._pm_deleteFromB2 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 · StoriesController._pm_uploadToB2 (cyclomatic 18) · ×2
  • StoriesController._pm_uploadToB2 (cyclomatic 18) saicms/app/Controllers/StoriesController.php:446 — StoriesController._pm_uploadToB2 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.
  • StoriesController._pm_uploadToB2 (cyclomatic 18) src/Controllers/StoriesController.php:471 — StoriesController._pm_uploadToB2 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 · UploadController._pm_uploadToB2 (cyclomatic 18) · ×2
  • UploadController._pm_uploadToB2 (cyclomatic 18) saicms/app/Controllers/UploadController.php:608 — UploadController._pm_uploadToB2 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.
  • UploadController._pm_uploadToB2 (cyclomatic 18) src/Controllers/UploadController.php:635 — UploadController._pm_uploadToB2 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.
D2 · Cognitive Complexity · UploadController.upload (cognitive 137) · ×2
  • UploadController.upload (cognitive 137) saicms/app/Controllers/UploadController.php:67 — UploadController.upload has cognitive complexity 137 (threshold 15). Drivers by points: if/else 32 (82 pts), ternaries 7 (25 pts), boolean chains 17, error handling 4 (13 pts) (nesting depth added 77). 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.
  • UploadController.upload (cognitive 137) src/Controllers/UploadController.php:71 — UploadController.upload has cognitive complexity 137 (threshold 15). Drivers by points: if/else 32 (82 pts), ternaries 7 (25 pts), boolean chains 17, error handling 4 (13 pts) (nesting depth added 77). 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 · UploadController.handleUploadProfilePicture (cognitive 26) · ×2
  • UploadController.handleUploadProfilePicture (cognitive 26) saicms/app/Controllers/UploadController.php:793 — UploadController.handleUploadProfilePicture has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (22 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.
  • UploadController.handleUploadProfilePicture (cognitive 26) src/Controllers/UploadController.php:820 — UploadController.handleUploadProfilePicture has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (22 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 · UploadController.handleUploadCoverPhoto (cognitive 25) · ×2
  • UploadController.handleUploadCoverPhoto (cognitive 25) saicms/app/Controllers/UploadController.php:415 — UploadController.handleUploadCoverPhoto has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 2, 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.
  • UploadController.handleUploadCoverPhoto (cognitive 25) src/Controllers/UploadController.php:442 — UploadController.handleUploadCoverPhoto has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 2, 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 · StoriesController.getActiveStories (cognitive 23) · ×2
  • StoriesController.getActiveStories (cognitive 23) saicms/app/Controllers/StoriesController.php:81 — StoriesController.getActiveStories has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • StoriesController.getActiveStories (cognitive 23) src/Controllers/StoriesController.php:99 — StoriesController.getActiveStories has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StoriesController._pm_deleteFromB2 (cognitive 23) · ×2
  • StoriesController._pm_deleteFromB2 (cognitive 23) saicms/app/Controllers/StoriesController.php:484 — StoriesController._pm_deleteFromB2 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • StoriesController._pm_deleteFromB2 (cognitive 23) src/Controllers/StoriesController.php:509 — StoriesController._pm_deleteFromB2 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ActivitiesController.formatTimeAgo (cognitive 20) · ×2
  • ActivitiesController.formatTimeAgo (cognitive 20) REDACTED:132 — ActivitiesController.formatTimeAgo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (10 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.
  • ActivitiesController.formatTimeAgo (cognitive 20) REDACTED:160 — ActivitiesController.formatTimeAgo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (10 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 · ActivitiesController.generateFallbackAvatar (cognitive 20) · ×2
  • ActivitiesController.generateFallbackAvatar (cognitive 20) REDACTED:575 — ActivitiesController.generateFallbackAvatar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 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.
  • ActivitiesController.generateFallbackAvatar (cognitive 20) REDACTED:636 — ActivitiesController.generateFallbackAvatar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 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 · StoriesController._pm_uploadToB2 (cognitive 20) · ×2
  • StoriesController._pm_uploadToB2 (cognitive 20) saicms/app/Controllers/StoriesController.php:446 — StoriesController._pm_uploadToB2 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • StoriesController._pm_uploadToB2 (cognitive 20) src/Controllers/StoriesController.php:471 — StoriesController._pm_uploadToB2 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · UploadController._pm_uploadToB2 (cognitive 20) · ×2
  • UploadController._pm_uploadToB2 (cognitive 20) saicms/app/Controllers/UploadController.php:608 — UploadController._pm_uploadToB2 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • UploadController._pm_uploadToB2 (cognitive 20) src/Controllers/UploadController.php:635 — UploadController._pm_uploadToB2 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SocialController.generateFallbackAvatar (cognitive 18) · ×2
  • SocialController.generateFallbackAvatar (cognitive 18) saicms/app/Controllers/SocialController.php:198 — SocialController.generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • SocialController.generateFallbackAvatar (cognitive 18) src/Controllers/SocialController.php:303 — SocialController.generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UploadController._pm_generateFallbackAvatar (cognitive 18) · ×2
  • UploadController._pm_generateFallbackAvatar (cognitive 18) saicms/app/Controllers/UploadController.php:702 — UploadController._pm_generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • UploadController._pm_generateFallbackAvatar (cognitive 18) src/Controllers/UploadController.php:729 — UploadController._pm_generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StoriesController._fetchFullStoryData (cognitive 17) · ×2
  • StoriesController._fetchFullStoryData (cognitive 17) saicms/app/Controllers/StoriesController.php:365 — StoriesController._fetchFullStoryData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • StoriesController._fetchFullStoryData (cognitive 17) src/Controllers/StoriesController.php:390 — StoriesController._fetchFullStoryData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) saicms/app/Controllers/StoriesController.php:447 — saicms/app/Controllers/StoriesController.php:447-480 | saicms/app/Controllers/StoriesController.php:486-557 | saicms/app/Controllers/UploadController.php:69-207 | saicms/app/Controllers/UploadController.php:610-666 | src/Controllers/StoriesController.php:472-505 | src/Controllers/StoriesController.php:511-582 | src/Controllers/UploadController.php:73-211 | src/Controllers/UploadController.php:637-693 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) src/Handlers/PayMongoHandler.php:132 — src/Handlers/PayMongoHandler.php:132-174 | src/Handlers/PayMongoHandler.php:186-241 | src/Handlers/PayMongoHandler.php:254-289 | src/Handlers/PayMongoHandler.php:303-357 | src/Handlers/PayMongoHandler.php:368-424 | src/Handlers/PayMongoHandler.php:689-773 | src/Handlers/PayMongoHandler.php:789-819 | src/Handlers/PayMongoHandler.php:832-871 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Edited copy of a member (64 corresponding lines) · ×2
  • Edited copy of a member (64 corresponding lines) saicms/app/Controllers/StoriesController.php:83 — saicms/app/Controllers/StoriesController.php:83-146 | src/Controllers/StoriesController.php:101-164 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (64 corresponding lines) src/Controllers/SqRelayController.php:51 — src/Controllers/SqRelayController.php:51-121 | src/Controllers/SqRelayController.php:146-209 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) REDACTED:233 — REDACTED:233-255 | REDACTED:354-418 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) src/Controllers/MallDeliveryController.php:132 — src/Controllers/MallDeliveryController.php:132-154 | src/Controllers/MallDeliveryController.php:163-185 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×2
  • Edited copy of a member (48 corresponding lines) REDACTED:381 — REDACTED:381-428 | REDACTED:416-463 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (48 corresponding lines) REDACTED:1687 — REDACTED:1687-1736 | REDACTED:1855-1902 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×2
  • Edited copy of a member (56 corresponding lines) REDACTED:717 — REDACTED:717-783 | REDACTED:793-848 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (56 corresponding lines) src/Controllers/SandboxController.php:377 — src/Controllers/SandboxController.php:377-452 | src/Controllers/SandboxController.php:899-954 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×2
  • Edited copy of a member (54 corresponding lines) REDACTED:95 — REDACTED:95-148 | REDACTED:95-151 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) REDACTED:1279 — REDACTED:1279-1332 | REDACTED:1923-1979 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×2
  • Edited copy of a member (39 corresponding lines) REDACTED:84 — REDACTED:84-122 | REDACTED:143-191 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) src/Controllers/CourseController.php:583 — src/Controllers/CourseController.php:583-621 | src/Controllers/MasterclassController.php:416-454 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×2
  • Edited copy of a member (46 corresponding lines) REDACTED:438 — REDACTED:438-483 | REDACTED:491-539 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) REDACTED:451 — REDACTED:451-496 | REDACTED:459-510 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) REDACTED:257 — REDACTED:257-291 | REDACTED:263-298 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) REDACTED:961 — REDACTED:961-999 | REDACTED:1085-1119 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) src/Playground/MallNotifyServer.php:54 — src/Playground/MallNotifyServer.php:54-75 | src/Playground/MessengerServer.php:40-67 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) src/Services/MallCommerceService.php:1566 — src/Services/MallCommerceService.php:1566-1589 | src/Services/MallCommerceService.php:1594-1615 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 30+ corresponding lines) src/Views/admin/parts/icon_helpers.php:130 — src/Views/admin/parts/icon_helpers.php:130-159 | src/Views/admin/parts/icon_helpers.php:174-204 | src/Views/admin/parts/icon_helpers.php:214-243 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 30+ corresponding lines) REDACTED:172 — REDACTED:172-201 | REDACTED:210-256 | REDACTED:1644-1677 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) src/Core/ProviderKeyManager.php:78 — src/Core/ProviderKeyManager.php:78-105 | src/Core/ProviderKeyManager.php:152-181 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) src/Core/LLM/Providers/AnthropicProvider.php:158 — src/Core/LLM/Providers/AnthropicProvider.php:158-186 | src/Core/LLM/Providers/OllamaProvider.php:225-252 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) src/Controllers/MallCheckoutController.php:397 — src/Controllers/MallCheckoutController.php:397-411 | src/Controllers/MallCheckoutController.php:416-430 | src/Controllers/MallCheckoutController.php:1001-1017 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) REDACTED:95 — REDACTED:95-111 | REDACTED:138-152 | src/Controllers/PostsController.php:33-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×2
  • Edited copy of a member (18 corresponding lines) REDACTED:21 — REDACTED:21-41 | src/Controllers/SocialController.php:18-35 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) REDACTED:1593 — REDACTED:1593-1618 | REDACTED:1627-1644 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) src/Playground/MessengerServer.php:208 — src/Playground/MessengerServer.php:208-233 | src/Playground/MessengerServer.php:241-265 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) REDACTED:1424 — REDACTED:1424-1448 | saicms/app/Controllers/ProfileController.php:155-179 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) src/Controllers/RelayController.php:62 — src/Controllers/RelayController.php:62-78 | src/Controllers/RelayController.php:84-99 | src/Controllers/RelayController.php:113-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) saicms/app/Controllers/URLMDController.php:184 — saicms/app/Controllers/URLMDController.php:184-200 | saicms/app/Controllers/URLMDController.php:207-223 | saicms/app/Controllers/URLMDController.php:230-245 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 8+ corresponding lines) REDACTED:1189 — REDACTED:504-511 | REDACTED:611-618 | REDACTED:1189-1202 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) src/Services/SilverQueenEngine.php:830 — src/Services/SilverQueenEngine.php:830-837 | src/Services/SilverQueenEngine.php:843-851 | src/Services/SilverQueenEngine.php:893-900 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) REDACTED:1346 — REDACTED:1346-1351 | REDACTED:2040-2045 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) REDACTED:192 — REDACTED:192-197 | REDACTED:431-438 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 3+ corresponding lines) src/Services/Strategies/Breakout.php:18 — src/Services/Strategies/Breakout.php:18-20 | src/Services/Strategies/PullbackDip.php:23-26 | src/Services/Strategies/ScalpMomentum.php:16-19 | src/Services/Strategies/TrendTrailing.php:20-23 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 3+ corresponding lines) saicms/app/Controllers/StoriesController.php:413 — saicms/app/Controllers/StoriesController.php:413-415 | saicms/app/Controllers/UploadController.php:561-563 | src/Controllers/StoriesController.php:438-440 | src/Controllers/UploadController.php:588-590 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 4+ corresponding lines) saicms/app/Controllers/StoriesController.php:430 — saicms/app/Controllers/StoriesController.php:430-433 | saicms/app/Controllers/UploadController.php:584-589 | src/Controllers/StoriesController.php:455-458 | src/Controllers/UploadController.php:611-616 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 4+ corresponding lines) saicms/app/Controllers/StoriesController.php:441 — saicms/app/Controllers/StoriesController.php:441-444 | saicms/app/Controllers/UploadController.php:598-605 | src/Controllers/StoriesController.php:466-469 | src/Controllers/UploadController.php:625-632 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) saicms/app/Controllers/StoriesController.php:436 — saicms/app/Controllers/StoriesController.php:436-438 | src/Controllers/StoriesController.php:461-463 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) src/Controllers/MallCheckoutController.php:15 — src/Controllers/MallCheckoutController.php:15-17 | src/Controllers/MallDeliveryController.php:22-25 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 1+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 1+ corresponding lines) src/Services/Strategies/Breakout.php:54 — src/Services/Strategies/Breakout.php:54-54 | src/Services/Strategies/PullbackDip.php:68-68 | src/Services/Strategies/ScalpMomentum.php:47-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 1+ corresponding lines) src/Services/Strategies/Breakout.php:49 — src/Services/Strategies/Breakout.php:49-49 | src/Services/Strategies/PullbackDip.php:63-63 | src/Services/Strategies/ScalpMomentum.php:42-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (102 lines × 2) · ×2
  • Duplicated block (102 lines × 2) REDACTED:28 — REDACTED:28-129 | REDACTED:56-157 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 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 (102 lines × 2) saicms/app/Controllers/ApiController.php:179 — saicms/app/Controllers/ApiController.php:179-280 | REDACTED:489-590 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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 `saicms/app/Controllers/ApiController.php:179` 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 (47 lines × 2) · ×2
  • Duplicated block (47 lines × 2) REDACTED:1077 — REDACTED:1077-1123 | REDACTED:1216-1262 — both copies are in the same file, so extract the 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:1077` 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 (47 lines × 2) src/Handlers/ChatStreamHandler.php:2825 — src/Handlers/ChatStreamHandler.php:2825-2871 | src/Handlers/ImageGenHandler.php:130-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (46 lines × 2) · ×2
  • Duplicated block (46 lines × 2) REDACTED:839 — REDACTED:839-884 | src/Controllers/SandboxController.php:1200-1245 — 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 `REDACTED:839` 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 (46 lines × 2) src/Controllers/CourseController.php:170 — src/Controllers/CourseController.php:170-215 | src/Controllers/MasterclassController.php:161-206 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 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 (43 lines × 2) · ×2
  • Duplicated block (43 lines × 2) src/Helpers/DockerSandboxManager.php:1010 — src/Helpers/DockerSandboxManager.php:1010-1052 | src/Helpers/LxdSandboxManager.php:1775-1817 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/DockerSandboxManager.php:1010` 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 (43 lines × 2) src/Controllers/SellerController.php:392 — src/Controllers/SellerController.php:392-434 | src/Controllers/SellerController.php:722-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Controllers/SellerController.php:436` calls `Product` and `src/Controllers/SellerController.php:766` 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 (42 lines × 2) · ×2
  • Duplicated block (42 lines × 2) src/Controllers/ClientsController.php:124 — src/Controllers/ClientsController.php:124-165 | src/Controllers/ClientsController.php:359-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/ClientsController.php:124` 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.
  • Duplicated block (42 lines × 2) saicms/app/Controllers/UploadController.php:166 — saicms/app/Controllers/UploadController.php:166-207 | src/Controllers/UploadController.php:170-211 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:166` 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 (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) REDACTED:1279 — REDACTED:1279-1316 | REDACTED:1923-1960 — 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 `REDACTED:1279` 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 (38 lines × 2) src/Core/RateLimitService.php:580 — src/Core/RateLimitService.php:580-618 | src/Core/RateLimitService.php:622-659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/RateLimitService.php:580` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Core/RateLimitService.php:579` calls `getenv` and `src/Core/RateLimitService.php:620` 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 (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) REDACTED:580 — REDACTED:580-613 | REDACTED:671-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:580` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (34 lines × 2) src/Services/MallCommerceService.php:990 — src/Services/MallCommerceService.php:990-1023 | src/Services/MallCommerceService.php:1287-1320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/MallCommerceService.php:990` 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 (32–33 lines × 2) · ×2
  • Duplicated block (32–33 lines × 2) src/Controllers/CourseController.php:705 — src/Controllers/CourseController.php:705-737 | src/Controllers/MasterclassController.php:545-576 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/CourseController.php:705` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Controllers/CourseController.php:738` calls `updateStudyStreak` and `src/Controllers/MasterclassController.php:577` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (32–33 lines × 2) REDACTED:2379 — REDACTED:2379-2410 | src/Controllers/SandboxController.php:2119-2151 — 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 `REDACTED:2379` 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 (30 lines × 2) · ×2
  • Duplicated block (30 lines × 2) saicms/app/Controllers/WebhookController.php:567 — saicms/app/Controllers/WebhookController.php:567-596 | src/Controllers/WebhookController.php:731-760 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 (30 lines × 2) REDACTED:2497 — REDACTED:2497-2526 | src/Controllers/SandboxController.php:2219-2248 — 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 `REDACTED:2497` 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 (29–30 lines × 2) · ×2
  • Duplicated block (29–30 lines × 2) src/Core/LLM/Providers/OpenAICompatibleProvider.php:617 — src/Core/LLM/Providers/OpenAICompatibleProvider.php:617-646 | src/Core/LLM/Providers/OpenAICompatibleProvider.php:662-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (29–30 lines × 2) src/Core/LLM/UnifiedMcpClient.php:1108 — src/Core/LLM/UnifiedMcpClient.php:1108-1137 | src/Core/LLM/UnifiedMcpClient.php:1247-1275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/LLM/UnifiedMcpClient.php:1108` 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 (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) REDACTED:305 — REDACTED:305-331 | REDACTED:338-364 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:305` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) REDACTED:221 — REDACTED:221-247 | REDACTED:340-366 — both copies are in the same file, so extract the 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:221` 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 (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) src/Controllers/ClientsController.php:167 — src/Controllers/ClientsController.php:167-190 | src/Controllers/ClientsController.php:402-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/ClientsController.php:167` 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 (24 lines × 2) REDACTED:720 — REDACTED:720-743 | REDACTED:1000-1023 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 (21 lines × 3) · ×2
  • Duplicated block (21 lines × 3) REDACTED:173 — REDACTED:173-193 | REDACTED:201-221 | REDACTED:229-249 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (21 lines × 3) REDACTED:1690 — REDACTED:1690-1710 | REDACTED:1749-1769 | REDACTED:1858-1878 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1690` 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–21 lines × 2) · ×2
  • Duplicated block (19–21 lines × 2) REDACTED:230 — REDACTED:230-250 | REDACTED:254-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19–21 lines × 2) src/Controllers/UserController.php:791 — src/Controllers/UserController.php:791-809 | src/Controllers/UserController.php:889-909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/UserController.php:889` 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 (18–21 lines × 2) · ×2
  • Duplicated block (18–21 lines × 2) src/Controllers/LiveController.php:1188 — src/Controllers/LiveController.php:1188-1205 | src/Controllers/LiveController.php:1210-1230 — both copies are in the same file, so extract the 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 (18–21 lines × 2) src/Core/UserRateLimiter.php:359 — src/Core/UserRateLimiter.php:359-379 | src/Core/UserRateLimiter.php:400-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/UserRateLimiter.php:359` 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 (19–20 lines × 2) · ×2
  • Duplicated block (19–20 lines × 2) REDACTED:689 — REDACTED:689-707 | REDACTED:1115-1134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:689` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–20 lines × 2) REDACTED:722 — REDACTED:722-741 | REDACTED:887-905 — both copies are in the same file, so extract the 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:722` 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 (16 lines × 4) · ×2
  • Duplicated block (16 lines × 4) saicms/app/Controllers/StoriesController.php:121 — saicms/app/Controllers/StoriesController.php:121-136 | saicms/app/Controllers/StoriesController.php:390-405 | src/Controllers/StoriesController.php:139-154 | src/Controllers/StoriesController.php:415-430 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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 `saicms/app/Controllers/StoriesController.php:121` 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 × 4) REDACTED:920 — REDACTED:920-935 | REDACTED:1023-1038 | REDACTED:1121-1136 | REDACTED:1206-1221 — 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 (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) REDACTED:1537 — REDACTED:1537-1552 | REDACTED:1553-1567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–16 lines × 2) src/Models/Product.php:176 — src/Models/Product.php:176-191 | src/Models/Product.php:296-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Models/Product.php:176` 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 (14–15 lines × 3) · ×2
  • Duplicated block (14–15 lines × 3) REDACTED:318 — REDACTED:318-332 | REDACTED:412-425 | REDACTED:538-551 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 3) src/Playground/MessengerServer.php:214 — src/Playground/MessengerServer.php:214-228 | src/Playground/MessengerServer.php:246-260 | src/Playground/MessengerServer.php:277-290 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Playground/MessengerServer.php:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Playground/MessengerServer.php:229` calls `error_log`, `getMessage` and `src/Playground/MessengerServer.php:262` 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 (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) REDACTED:640 — REDACTED:640-653 | src/Core/LLM/ProviderRegistry.php:330-343 | src/Handlers/ChatStreamHandler.php:2576-2589 — 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:640` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 3) src/Controllers/SandboxController.php:377 — src/Controllers/SandboxController.php:377-390 | src/Controllers/SandboxController.php:899-912 | src/Controllers/SandboxController.php:1111-1124 — 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 (11–14 lines × 2) · ×2
  • Duplicated block (11–14 lines × 2) REDACTED:1049 — REDACTED:1049-1062 | src/Controllers/LiveController.php:519-529 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11–14 lines × 2) src/Handlers/DocumentRagService.php:593 — src/Handlers/DocumentRagService.php:593-606 | src/Handlers/DocumentRagService.php:742-752 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) saicms/app/Controllers/ContactsController.php:26 — saicms/app/Controllers/ContactsController.php:26-38 | saicms/app/Controllers/SearchController.php:25-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13–14 lines × 2) REDACTED:1593 — REDACTED:1593-1606 | REDACTED:1627-1639 — both copies are in the same file, so extract the 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 (11 lines × 5) · ×2
  • Duplicated block (11 lines × 5) REDACTED:622 — REDACTED:622-633 | REDACTED:713-723 | REDACTED:839-849 | REDACTED:766-776 | REDACTED:910-920 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:622` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 5) REDACTED:577 — REDACTED:577-587 | REDACTED:668-678 | REDACTED:758-768 | src/Helpers/LxdApiClient.php:385-395 | src/Helpers/LxdSandboxManager.php:753-763 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:577` 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 (11 lines × 4) · ×2
  • Duplicated block (11 lines × 4) REDACTED:90 — REDACTED:90-100 | REDACTED:310-320 | REDACTED:515-525 | REDACTED:776-786 — 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 `REDACTED:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 4) REDACTED:142 — REDACTED:142-152 | REDACTED:204-214 | REDACTED:232-242 | REDACTED:321-331 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:142` 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 (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) REDACTED:1126 — REDACTED:1126-1136 | REDACTED:1234-1243 — both copies are in the same file, so extract the 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:1126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1230` calls `empty` and `REDACTED:1124` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) src/Core/LLM/ToolCall.php:152 — src/Core/LLM/ToolCall.php:152-161 | src/Core/LLM/UnifiedMcpClient.php:779-789 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/LLM/ToolCall.php:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) REDACTED:213 — REDACTED:213-222 | REDACTED:767-778 | REDACTED:1039-1049 | REDACTED:243-252 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1038` calls `error_log`, `last` and `REDACTED:765` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 4) src/Controllers/PaymentsAdminController.php:197 — src/Controllers/PaymentsAdminController.php:197-206 | REDACTED:316-325 | src/Controllers/ReferralLinksAdminController.php:19-28 | REDACTED:452-461 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×2
  • Duplicated block (9 lines × 6) src/Handlers/PayMongoHandler.php:153 — src/Handlers/PayMongoHandler.php:153-161 | src/Handlers/PayMongoHandler.php:228-236 | src/Handlers/PayMongoHandler.php:275-283 | src/Handlers/PayMongoHandler.php:754-762 | src/Handlers/PayMongoHandler.php:806-814 | src/Handlers/PayMongoHandler.php:852-860 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Handlers/PayMongoHandler.php:750` calls `empty`, `array_values` and `src/Handlers/PayMongoHandler.php:226` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 6) src/Handlers/SandboxMcp.php:146 — src/Handlers/SandboxMcp.php:146-154 | src/Handlers/SandboxMcp.php:192-200 | src/Handlers/SandboxMcp.php:250-258 | src/Handlers/SandboxMcp.php:285-293 | src/Handlers/SandboxMcp.php:433-441 | src/Handlers/SandboxMcp.php:586-594 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) saicms/app/Controllers/GroupController.php:356 — saicms/app/Controllers/GroupController.php:356-365 | saicms/app/Controllers/HomeController.php:335-344 | saicms/app/Controllers/SocialController.php:296-304 | saicms/app/Controllers/StoriesController.php:106-112 | src/Controllers/StoriesController.php:124-130 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.php:356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 5) saicms/app/Controllers/ContactsController.php:12 — saicms/app/Controllers/ContactsController.php:12-18 | saicms/app/Controllers/GroupController.php:17-23 | saicms/app/Controllers/HomeController.php:17-23 | saicms/app/Controllers/SearchController.php:12-19 | saicms/app/Controllers/SocialController.php:17-23 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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.
R10 · Code Duplication · Duplicated block with local edits (106 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (106 matched lines × 2 locations) public/assets/js/chat.js:1122 — public/assets/js/chat.js:1122 · public/assets/js/chat/code-blocks.js:175 — the two spans are one implementation copied and then locally edited — 755 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (106 matched lines × 2 locations) public/assets/js/chat.js:7124 — public/assets/js/chat.js:7124 · public/assets/js/chat/audio.js:128 — the two spans are one implementation copied and then locally edited — 725 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.
R2 · Cyclomatic Complexity · Complex function openChat (cyclomatic 87, cognitive 122) · ×2
  • Complex function openChat (cyclomatic 87, cognitive 122) public/assets/client/js/typeahead-chat.js:1201 — openChat has cyclomatic complexity 87 and cognitive complexity 122; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function openChat (cyclomatic 87, cognitive 122) saicms/public/assets/client/js/typeahead-chat.js:1154 — openChat has cyclomatic complexity 87 and cognitive complexity 122; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 addMessageToChatbox (cyclomatic 85, cognitive 132) · ×2
  • Complex function addMessageToChatbox (cyclomatic 85, cognitive 132) public/assets/client/js/typeahead-chat.js:2642 — addMessageToChatbox has cyclomatic complexity 85 and cognitive complexity 132; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function addMessageToChatbox (cyclomatic 85, cognitive 132) saicms/public/assets/client/js/typeahead-chat.js:2595 — addMessageToChatbox has cyclomatic complexity 85 and cognitive complexity 132; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 _createPostElement (cyclomatic 78, cognitive 120) · ×2
  • Complex function _createPostElement (cyclomatic 78, cognitive 120) public/assets/client/js/feedmanager.js:896 — _createPostElement has cyclomatic complexity 78 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function _createPostElement (cyclomatic 78, cognitive 120) saicms/public/assets/client/js/feedmanager.js:896 — _createPostElement has cyclomatic complexity 78 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 _populatePostViewModal (cyclomatic 67, cognitive 76) · ×2
  • Complex function _populatePostViewModal (cyclomatic 67, cognitive 76) public/assets/client/js/feedmanager.js:1134 — _populatePostViewModal has cyclomatic complexity 67 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function _populatePostViewModal (cyclomatic 67, cognitive 76) saicms/public/assets/client/js/feedmanager.js:1134 — _populatePostViewModal has cyclomatic complexity 67 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 64, cognitive 63) · ×2
  • Complex function (anonymous) (cyclomatic 64, cognitive 63) public/assets/js/editor-chat.js:2491 — (anonymous) has cyclomatic complexity 64 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function (anonymous) (cyclomatic 64, cognitive 63) REDACTED:2775 — (anonymous) has cyclomatic complexity 64 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 startAIGeneration (cyclomatic 55, cognitive 108) · ×2
  • Complex function startAIGeneration (cyclomatic 55, cognitive 108) public/assets/client/js/feedmanager.js:1991 — startAIGeneration has cyclomatic complexity 55 and cognitive complexity 108; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function startAIGeneration (cyclomatic 55, cognitive 108) saicms/public/assets/client/js/feedmanager.js:1991 — startAIGeneration has cyclomatic complexity 55 and cognitive complexity 108; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 updateSentMessageInChatbox (cyclomatic 53, cognitive 128) · ×2
  • Complex function updateSentMessageInChatbox (cyclomatic 53, cognitive 128) public/assets/client/js/typeahead-chat.js:2780 — updateSentMessageInChatbox has cyclomatic complexity 53 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function updateSentMessageInChatbox (cyclomatic 53, cognitive 128) saicms/public/assets/client/js/typeahead-chat.js:2733 — updateSentMessageInChatbox has cyclomatic complexity 53 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 _loadAndDisplayRecentMessages (cyclomatic 51, cognitive 55) · ×2
  • Complex function _loadAndDisplayRecentMessages (cyclomatic 51, cognitive 55) public/assets/client/js/typeahead-chat.js:2933 — _loadAndDisplayRecentMessages has cyclomatic complexity 51 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function _loadAndDisplayRecentMessages (cyclomatic 51, cognitive 55) saicms/public/assets/client/js/typeahead-chat.js:2886 — _loadAndDisplayRecentMessages has cyclomatic complexity 51 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 extractToolCallFromText (cyclomatic 45, cognitive 57) · ×2
  • Complex function extractToolCallFromText (cyclomatic 45, cognitive 57) public/assets/js/editor-chat.js:989 — extractToolCallFromText has cyclomatic complexity 45 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function extractToolCallFromText (cyclomatic 45, cognitive 57) REDACTED:1534 — extractToolCallFromText has cyclomatic complexity 45 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 loadPosts (cyclomatic 44, cognitive 83) · ×2
  • Complex function loadPosts (cyclomatic 44, cognitive 83) public/assets/client/js/feedmanager.js:712 — loadPosts has cyclomatic complexity 44 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function loadPosts (cyclomatic 44, cognitive 83) saicms/public/assets/client/js/feedmanager.js:712 — loadPosts has cyclomatic complexity 44 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×2
  • JavaScript dependencies are not locked public/lib/novnc/package.json:34 — public/lib/novnc/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked tools/terminal-server/package.json:10 — tools/terminal-server/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X27 · Collection changed while being enumerated · Collection is structurally changed while it is being enumerated · ×2
  • Collection is structurally changed while it is being enumerated src/Playground/FileWriteStreamer.php:26 — line 26 walks `$this->clients`, an SPL container `foreach` walks LIVE, and line 34 changes that same collection with `$this->clients->detach(…)` before the next iteration: the walk skips an element it would have visited (on an SPL container even removing the current one skips the next). PHP raises nothing, so the loop completes over a different set than the code meant.
  • Collection is structurally changed while it is being enumerated src/Playground/FixedFileWriteStreamer.php:23 — line 23 walks `$this->clients`, an SPL container `foreach` walks LIVE, and line 29 changes that same collection with `$this->clients->detach(…)` before the next iteration: the walk skips an element it would have visited (on an SPL container even removing the current one skips the next). PHP raises nothing, so the loop completes over a different set than the code meant.
AC3 · Page structure · Heading level jumps from h2 to h4 · ×1
  • Heading level jumps from h2 to h4 REDACTED:1139 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure · Empty <h3> heading · ×1
  • Empty <h3> heading saicms/app/views/dashboard/tier.view.php:639 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC3 · Page structure · Heading level jumps from h1 to h4 · ×1
  • Heading level jumps from h1 to h4 saicms/app/views/dashboard/wifi_purchase.view.php:152 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure · Empty <h2> heading · ×1
  • Empty <h2> heading saicms/app/views/game.view.php:74 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC4 · Keyboard semantics · Link used as a button (placeholder href) · ×1
  • Link used as a button (placeholder href) public/assets/client/js/contacts.js:110 — An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
D1 · Cyclomatic Complexity · ChatStreamHandler.handleMainRequest (cyclomatic 248) · ×1
  • ChatStreamHandler.handleMainRequest (cyclomatic 248) src/Handlers/ChatStreamHandler.php:827 — ChatStreamHandler.handleMainRequest has cyclomatic complexity 248 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ApiController.models (cyclomatic 102) · ×1
  • ApiController.models (cyclomatic 102) REDACTED:1014 — ApiController.models has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent 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 · websearch.generateImage (cyclomatic 97) · ×1
  • websearch.generateImage (cyclomatic 97) REDACTED:583 — websearch.generateImage has cyclomatic complexity 97 (threshold 15). Most of this is not in the body itself: 1 of the 97 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 587, 740, 810, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Renderer.html (cyclomatic 92) · ×1
  • Renderer.html (cyclomatic 92) src/Sites/Renderer.php:100 — Renderer.html has cyclomatic complexity 92 (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 · openChat (cyclomatic 90) · ×1
  • openChat (cyclomatic 90) saicms/public/assets/client/js/typeahead-chat.js:1154 — openChat has cyclomatic complexity 90 (threshold 15). Of this number, 87 points are the body's own statements and 3 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 · ChatUIManager.addMessageToChatbox (cyclomatic 88) · ×1
  • ChatUIManager.addMessageToChatbox (cyclomatic 88) saicms/public/assets/client/js/typeahead-chat.js:2595 — ChatUIManager.addMessageToChatbox has cyclomatic complexity 88 (threshold 15). Of this number, 85 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ApiController.providerKeys (cyclomatic 86) · ×1
  • ApiController.providerKeys (cyclomatic 86) REDACTED:1617 — ApiController.providerKeys has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ChatStreamHandler.executeImageGeneration (cyclomatic 86) · ×1
  • ChatStreamHandler.executeImageGeneration (cyclomatic 86) src/Handlers/ChatStreamHandler.php:3045 — ChatStreamHandler.executeImageGeneration has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent 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 · PostFeedManager._createPostElement (cyclomatic 78) · ×1
  • PostFeedManager._createPostElement (cyclomatic 78) saicms/public/assets/client/js/feedmanager.js:896 — PostFeedManager._createPostElement has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent 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 · UserController.registerAction (cyclomatic 76) · ×1
  • UserController.registerAction (cyclomatic 76) src/Controllers/UserController.php:1220 — UserController.registerAction has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GtbStrategy.step (cyclomatic 76) · ×1
  • GtbStrategy.step (cyclomatic 76) src/Services/GtbStrategy.php:61 — GtbStrategy.step has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PostFeedManager._populatePostViewModal (cyclomatic 67) · ×1
  • PostFeedManager._populatePostViewModal (cyclomatic 67) saicms/public/assets/client/js/feedmanager.js:1134 — PostFeedManager._populatePostViewModal has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install.generateEnvPairs (cyclomatic 65) · ×1
  • install.generateEnvPairs (cyclomatic 65) REDACTED:427 — install.generateEnvPairs has cyclomatic complexity 65 (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 · PostFeedManager._handleEditPost (cyclomatic 63) · ×1
  • PostFeedManager._handleEditPost (cyclomatic 63) saicms/public/assets/client/js/feedmanager.js:2213 — PostFeedManager._handleEditPost has cyclomatic complexity 63 (threshold 15). Of this number, 31 points are the body's own statements and 32 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SellerController.productCreate (cyclomatic 60) · ×1
  • SellerController.productCreate (cyclomatic 60) src/Controllers/SellerController.php:322 — SellerController.productCreate 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 · SellerController.productUpdate (cyclomatic 60) · ×1
  • SellerController.productUpdate (cyclomatic 60) src/Controllers/SellerController.php:644 — SellerController.productUpdate 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 · PagesController.editScript (cyclomatic 56) · ×1
  • PagesController.editScript (cyclomatic 56) REDACTED:265 — PagesController.editScript 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 · ImageGenHandler.handleSdcpuGeneration (cyclomatic 56) · ×1
  • ImageGenHandler.handleSdcpuGeneration (cyclomatic 56) src/Handlers/ImageGenHandler.php:554 — ImageGenHandler.handleSdcpuGeneration 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 · AcademyController.reconcileBot (cyclomatic 55) · ×1
  • AcademyController.reconcileBot (cyclomatic 55) REDACTED:722 — AcademyController.reconcileBot has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent 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 · startAIGeneration (cyclomatic 55) · ×1
  • startAIGeneration (cyclomatic 55) saicms/public/assets/client/js/feedmanager.js:1991 — startAIGeneration has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent 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 55) · ×1
  • (anonymous) (cyclomatic 55) saicms/public/assets/client/js/typeahead-chat.js:3533 — (anonymous) has cyclomatic complexity 55 (threshold 15). Of this number, 19 points are the body's own statements and 36 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SocialController.post (cyclomatic 54) · ×1
  • SocialController.post (cyclomatic 54) src/Controllers/SocialController.php:38 — SocialController.post has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ChatUIManager.updateSentMessageInChatbox (cyclomatic 54) · ×1
  • ChatUIManager.updateSentMessageInChatbox (cyclomatic 54) saicms/public/assets/client/js/typeahead-chat.js:2733 — ChatUIManager.updateSentMessageInChatbox has cyclomatic complexity 54 (threshold 15). Of this number, 53 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 · typeahead-chat.document.addEventListener("DOMContentLoaded") (cyclomatic 54) · ×1
  • typeahead-chat.document.addEventListener("DOMContentLoaded") (cyclomatic 54) saicms/public/assets/client/js/typeahead-chat.js:3533 — typeahead-chat.document.addEventListener("DOMContentLoaded") has cyclomatic complexity 54 (threshold 15). Of this number, 19 points are the body's own statements and 35 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SandboxController.install (cyclomatic 53) · ×1
  • SandboxController.install (cyclomatic 53) src/Controllers/SandboxController.php:585 — SandboxController.install 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 · MallCommerceService.buildOrderBundle (cyclomatic 53) · ×1
  • MallCommerceService.buildOrderBundle (cyclomatic 53) src/Services/MallCommerceService.php:984 — MallCommerceService.buildOrderBundle 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 · _loadAndDisplayRecentMessages (cyclomatic 52) · ×1
  • _loadAndDisplayRecentMessages (cyclomatic 52) saicms/public/assets/client/js/typeahead-chat.js:2886 — _loadAndDisplayRecentMessages has cyclomatic complexity 52 (threshold 15). Of this number, 51 points are the body's own statements and 1 belongs 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 · loadPosts (cyclomatic 49) · ×1
  • loadPosts (cyclomatic 49) saicms/public/assets/client/js/feedmanager.js:712 — loadPosts has cyclomatic complexity 49 (threshold 15). Of this number, 44 points are the body's own statements and 5 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 · ChatStreamHandler.handle (cyclomatic 47) · ×1
  • ChatStreamHandler.handle (cyclomatic 47) src/Handlers/ChatStreamHandler.php:30 — ChatStreamHandler.handle has cyclomatic complexity 47 (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 · ChatMessageHandler.onMessage (cyclomatic 46) · ×1
  • ChatMessageHandler.onMessage (cyclomatic 46) saicms/app/WebSocket/ChatMessageHandler.php:282 — ChatMessageHandler.onMessage has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnifiedMcpClient.executeToolCall (cyclomatic 45) · ×1
  • UnifiedMcpClient.executeToolCall (cyclomatic 45) src/Core/LLM/UnifiedMcpClient.php:729 — UnifiedMcpClient.executeToolCall has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatUIManager._connectWebSocket (cyclomatic 45) · ×1
  • ChatUIManager._connectWebSocket (cyclomatic 45) saicms/public/assets/client/js/typeahead-chat.js:937 — ChatUIManager._connectWebSocket has cyclomatic complexity 45 (threshold 15). Of this number, 17 points are the body's own statements and 28 belong to 4 function literals 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 · ChatUIManager.startVideoCall (cyclomatic 45) · ×1
  • ChatUIManager.startVideoCall (cyclomatic 45) saicms/public/assets/client/js/typeahead-chat.js:1788 — ChatUIManager.startVideoCall has cyclomatic complexity 45 (threshold 15). Of this number, 19 points are the body's own statements and 26 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 · ChatUIManager.handleVideoOffer (cyclomatic 45) · ×1
  • ChatUIManager.handleVideoOffer (cyclomatic 45) saicms/public/assets/client/js/typeahead-chat.js:2012 — ChatUIManager.handleVideoOffer has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 12 of the 45 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 2048, 2087, 2133, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · ChatController.createGroupConversation (cyclomatic 44) · ×1
  • ChatController.createGroupConversation (cyclomatic 44) saicms/app/Controllers/ChatController.php:1622 — ChatController.createGroupConversation 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 · NotificationManager._populatePostViewModal (cyclomatic 44) · ×1
  • NotificationManager._populatePostViewModal (cyclomatic 44) saicms/public/assets/client/js/notifications.js:778 — NotificationManager._populatePostViewModal has cyclomatic complexity 44 (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 · ApiController.post (cyclomatic 42) · ×1
  • ApiController.post (cyclomatic 42) REDACTED:345 — ApiController.post 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 · ChatStreamHandler.normalizeImageGenResult (cyclomatic 42) · ×1
  • ChatStreamHandler.normalizeImageGenResult (cyclomatic 42) src/Handlers/ChatStreamHandler.php:2961 — ChatStreamHandler.normalizeImageGenResult 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 · SandboxMcp.createDocument (cyclomatic 42) · ×1
  • SandboxMcp.createDocument (cyclomatic 42) src/Handlers/SandboxMcp.php:740 — SandboxMcp.createDocument 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 · HeaderManager._fetchAndDisplayCommentsForModal (cyclomatic 42) · ×1
  • HeaderManager._fetchAndDisplayCommentsForModal (cyclomatic 42) saicms/public/assets/client/js/headmanager.js:759 — HeaderManager._fetchAndDisplayCommentsForModal has cyclomatic complexity 42 (threshold 15). Of this number, 40 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 · _initializeReadOnlyMonacoForFeedPost (cyclomatic 42) · ×1
  • _initializeReadOnlyMonacoForFeedPost (cyclomatic 42) saicms/public/assets/client/js/feedmanager.js:1409 — _initializeReadOnlyMonacoForFeedPost has cyclomatic complexity 42 (threshold 15). Of this number, 26 points are the body's own statements and 16 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 · ApiController.post (cyclomatic 41) · ×1
  • ApiController.post (cyclomatic 41) saicms/app/Controllers/ApiController.php:43 — ApiController.post 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 · ChatController.sendMessageApi (cyclomatic 41) · ×1
  • ChatController.sendMessageApi (cyclomatic 41) saicms/app/Controllers/ChatController.php:436 — ChatController.sendMessageApi 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 · LiveController.imagegenModelStatus (cyclomatic 41) · ×1
  • LiveController.imagegenModelStatus (cyclomatic 41) src/Controllers/LiveController.php:924 — LiveController.imagegenModelStatus 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 · SellerController.submitKyc (cyclomatic 41) · ×1
  • SellerController.submitKyc (cyclomatic 41) src/Controllers/SellerController.php:45 — SellerController.submitKyc has cyclomatic complexity 41 (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 · PlaygroundController.save (cyclomatic 40) · ×1
  • PlaygroundController.save (cyclomatic 40) REDACTED:362 — PlaygroundController.save has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlaygroundController.consoleExec (cyclomatic 40) · ×1
  • PlaygroundController.consoleExec (cyclomatic 40) REDACTED:716 — PlaygroundController.consoleExec has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlaygroundController.paste (cyclomatic 40) · ×1
  • PlaygroundController.paste (cyclomatic 40) REDACTED:1192 — PlaygroundController.paste has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TierController.store (cyclomatic 40) · ×1
  • TierController.store (cyclomatic 40) REDACTED:55 — TierController.store has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveController.updateEnvFile (cyclomatic 39) · ×1
  • LiveController.updateEnvFile (cyclomatic 39) src/Controllers/LiveController.php:567 — LiveController.updateEnvFile 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 · _fetchAndDisplayComments (cyclomatic 39) · ×1
  • _fetchAndDisplayComments (cyclomatic 39) saicms/public/assets/client/js/feedmanager.js:2791 — _fetchAndDisplayComments 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 · AudioController.tts (cyclomatic 38) · ×1
  • AudioController.tts (cyclomatic 38) REDACTED:26 — AudioController.tts has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OpenAICompatibleProvider.chatStreamOnce (cyclomatic 38) · ×1
  • OpenAICompatibleProvider.chatStreamOnce (cyclomatic 38) src/Core/LLM/Providers/OpenAICompatibleProvider.php:660 — OpenAICompatibleProvider.chatStreamOnce has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PostFeedManager._bindModalContentEventListeners (cyclomatic 38) · ×1
  • PostFeedManager._bindModalContentEventListeners (cyclomatic 38) saicms/public/assets/client/js/feedmanager.js:208 — PostFeedManager._bindModalContentEventListeners has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 3 of the 38 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 214, a function literal at line 304, a function literal at line 294, …). 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 · ChatNotificationManager.handleNewMessage (cyclomatic 38) · ×1
  • ChatNotificationManager.handleNewMessage (cyclomatic 38) saicms/public/assets/client/js/typeahead-chat.js:3215 — ChatNotificationManager.handleNewMessage has cyclomatic complexity 38 (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 · ChatNotificationManager.addOrUpdateNotification (cyclomatic 38) · ×1
  • ChatNotificationManager.addOrUpdateNotification (cyclomatic 38) saicms/public/assets/client/js/typeahead-chat.js:3280 — ChatNotificationManager.addOrUpdateNotification has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClientsController.handleSandboxPreview (cyclomatic 37) · ×1
  • ClientsController.handleSandboxPreview (cyclomatic 37) src/Controllers/ClientsController.php:294 — ClientsController.handleSandboxPreview has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatNotificationManager.loadInitialNotifications (cyclomatic 37) · ×1
  • ChatNotificationManager.loadInitialNotifications (cyclomatic 37) saicms/public/assets/client/js/typeahead-chat.js:3448 — ChatNotificationManager.loadInitialNotifications has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 3461, 3510). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · (anonymous).filterAndSort (cyclomatic 37) · ×1
  • (anonymous).filterAndSort (cyclomatic 37) saicms/public/assets/client/js/F.js:826 — (anonymous).filterAndSort has cyclomatic complexity 37 (threshold 15). Of this number, 28 points are the body's own statements and 9 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 · StoriesController.createStoryWithMedia (cyclomatic 36) · ×1
  • StoriesController.createStoryWithMedia (cyclomatic 36) saicms/app/Controllers/StoriesController.php:149 — StoriesController.createStoryWithMedia 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 · ApiKeysRelayController.streamChat (cyclomatic 36) · ×1
  • ApiKeysRelayController.streamChat (cyclomatic 36) src/Controllers/ApiKeysRelayController.php:63 — ApiKeysRelayController.streamChat 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 · bible (cyclomatic 36) · ×1
  • bible (cyclomatic 36) REDACTED:364 — bible has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 4 of the 36 points are its own statements and the rest belongs to 15 function items inside it that branch (tagVersesInElement::acceptNode, showPopupForVerse, a function literal at line 499, …). 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 · ChatController.getOrCreateDirectConversation (cyclomatic 35) · ×1
  • ChatController.getOrCreateDirectConversation (cyclomatic 35) saicms/app/Controllers/ChatController.php:119 — ChatController.getOrCreateDirectConversation has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FriendsController.friends (cyclomatic 35) · ×1
  • FriendsController.friends (cyclomatic 35) REDACTED:75 — FriendsController.friends 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 · GroupController.post (cyclomatic 35) · ×1
  • GroupController.post (cyclomatic 35) saicms/app/Controllers/GroupController.php:51 — GroupController.post has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HomeController.post (cyclomatic 35) · ×1
  • HomeController.post (cyclomatic 35) saicms/app/Controllers/HomeController.php:30 — HomeController.post has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SocialController.post (cyclomatic 35) · ×1
  • SocialController.post (cyclomatic 35) saicms/app/Controllers/SocialController.php:26 — SocialController.post has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StoriesController.createStoryWithMedia (cyclomatic 35) · ×1
  • StoriesController.createStoryWithMedia (cyclomatic 35) src/Controllers/StoriesController.php:167 — StoriesController.createStoryWithMedia 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 · PtyServer.onOpen (cyclomatic 35) · ×1
  • PtyServer.onOpen (cyclomatic 35) src/Playground/PtyServer.php:91 — PtyServer.onOpen 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 · PostFeedManager._bindDelegatedEventListeners (cyclomatic 35) · ×1
  • PostFeedManager._bindDelegatedEventListeners (cyclomatic 35) saicms/public/assets/client/js/feedmanager.js:1678 — PostFeedManager._bindDelegatedEventListeners has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 2 of the 35 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1690, 1782, 1772, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · MallController.apiProducts (cyclomatic 34) · ×1
  • MallController.apiProducts (cyclomatic 34) REDACTED:376 — MallController.apiProducts 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 · ToolCallParser.extract (cyclomatic 34) · ×1
  • ToolCallParser.extract (cyclomatic 34) src/Core/LLM/ToolCallParser.php:21 — ToolCallParser.extract 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 · StandardMcpHost.getAllTools (cyclomatic 34) · ×1
  • StandardMcpHost.getAllTools (cyclomatic 34) src/Core/StandardMcpHost.php:92 — StandardMcpHost.getAllTools 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 · UserController.settingsUpdate (cyclomatic 33) · ×1
  • UserController.settingsUpdate (cyclomatic 33) src/Controllers/UserController.php:492 — UserController.settingsUpdate has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · stealth-browser.generateRaphaelImage (cyclomatic 33) · ×1
  • stealth-browser.generateRaphaelImage (cyclomatic 33) tools/lightpanda-mcp/scripts/stealth-browser.js:513 — stealth-browser.generateRaphaelImage has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 517, 593, 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 · ClientsController.handleClientProxy (cyclomatic 32) · ×1
  • ClientsController.handleClientProxy (cyclomatic 32) src/Controllers/ClientsController.php:68 — ClientsController.handleClientProxy 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 · HostingController.tunnelsApi (cyclomatic 32) · ×1
  • HostingController.tunnelsApi (cyclomatic 32) REDACTED:1359 — HostingController.tunnelsApi 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 · LiveController.fetchHuggingFaceModelSizes (cyclomatic 32) · ×1
  • LiveController.fetchHuggingFaceModelSizes (cyclomatic 32) src/Controllers/LiveController.php:1233 — LiveController.fetchHuggingFaceModelSizes 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 · SandboxController.vnc (cyclomatic 32) · ×1
  • SandboxController.vnc (cyclomatic 32) src/Controllers/SandboxController.php:1109 — SandboxController.vnc 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 · TunnelController.generateAccessKey (cyclomatic 32) · ×1
  • TunnelController.generateAccessKey (cyclomatic 32) REDACTED:1395 — TunnelController.generateAccessKey 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 · HeaderManager._handleModalCommentSubmit (cyclomatic 32) · ×1
  • HeaderManager._handleModalCommentSubmit (cyclomatic 32) saicms/public/assets/client/js/headmanager.js:585 — HeaderManager._handleModalCommentSubmit 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 · LiveStreamUploader._initiateWebRTCConnectionToCF (cyclomatic 32) · ×1
  • LiveStreamUploader._initiateWebRTCConnectionToCF (cyclomatic 32) saicms/public/assets/client/js/mediamanager.js:598 — LiveStreamUploader._initiateWebRTCConnectionToCF has cyclomatic complexity 32 (threshold 15). Of this number, 17 points are the body's own statements and 15 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 · SmartFedApp._initPostModal (cyclomatic 32) · ×1
  • SmartFedApp._initPostModal (cyclomatic 32) saicms/public/assets/client/js/smartfed.js:179 — SmartFedApp._initPostModal has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 212, 193, 184). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SaiStories._createDynamicStoryElement (cyclomatic 32) · ×1
  • SaiStories._createDynamicStoryElement (cyclomatic 32) saicms/public/assets/client/js/stories.js:569 — SaiStories._createDynamicStoryElement has cyclomatic complexity 32 (threshold 15). Of this number, 30 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 · ProfileController.post (cyclomatic 31) · ×1
  • ProfileController.post (cyclomatic 31) saicms/app/Controllers/ProfileController.php:186 — ProfileController.post has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AcademyController.cardInit (cyclomatic 31) · ×1
  • AcademyController.cardInit (cyclomatic 31) REDACTED:1732 — AcademyController.cardInit 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 · ApiController.modelsSet (cyclomatic 31) · ×1
  • ApiController.modelsSet (cyclomatic 31) REDACTED:1487 — ApiController.modelsSet 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 · NotificationManager._bindModalContentEventListeners (cyclomatic 31) · ×1
  • NotificationManager._bindModalContentEventListeners (cyclomatic 31) saicms/public/assets/client/js/notifications.js:901 — NotificationManager._bindModalContentEventListeners has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 906, a function literal at line 958, a function literal at line 949, …). 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 · _initializeMonacoInElement (cyclomatic 31) · ×1
  • _initializeMonacoInElement (cyclomatic 31) saicms/public/assets/client/js/feedmanager.js:1822 — _initializeMonacoInElement 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 10 function literals inside it that branch (lines 1879, 1852, 1939, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · renderStoryInViewer (cyclomatic 31) · ×1
  • renderStoryInViewer (cyclomatic 31) saicms/public/assets/client/js/stories.js:335 — renderStoryInViewer has cyclomatic complexity 31 (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 · install.runDatabaseMigrations (cyclomatic 30) · ×1
  • install.runDatabaseMigrations (cyclomatic 30) REDACTED:619 — install.runDatabaseMigrations 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 · ChatController.sendMessage (cyclomatic 30) · ×1
  • ChatController.sendMessage (cyclomatic 30) saicms/app/Controllers/ChatController.php:738 — ChatController.sendMessage has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminLxcController.stats (cyclomatic 30) · ×1
  • AdminLxcController.stats (cyclomatic 30) REDACTED:646 — AdminLxcController.stats 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 · BarangayController.saveSellerZones (cyclomatic 30) · ×1
  • BarangayController.saveSellerZones (cyclomatic 30) REDACTED:715 — BarangayController.saveSellerZones 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 · TierController.createPaypalPlan (cyclomatic 30) · ×1
  • TierController.createPaypalPlan (cyclomatic 30) REDACTED:486 — TierController.createPaypalPlan has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HeaderManager._renderPostForModal (cyclomatic 30) · ×1
  • HeaderManager._renderPostForModal (cyclomatic 30) saicms/public/assets/client/js/headmanager.js:368 — HeaderManager._renderPostForModal has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AudioController.stt (cyclomatic 29) · ×1
  • AudioController.stt (cyclomatic 29) REDACTED:190 — AudioController.stt 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 · SocialController.fetchCompletePostData (cyclomatic 29) · ×1
  • SocialController.fetchCompletePostData (cyclomatic 29) src/Controllers/SocialController.php:211 — SocialController.fetchCompletePostData 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 · McpUnifier.discoverRuntimeServers (cyclomatic 29) · ×1
  • McpUnifier.discoverRuntimeServers (cyclomatic 29) src/Core/McpUnifier.php:295 — McpUnifier.discoverRuntimeServers 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 · HeaderManager._handleModalDeleteCommentClick (cyclomatic 29) · ×1
  • HeaderManager._handleModalDeleteCommentClick (cyclomatic 29) saicms/public/assets/client/js/headmanager.js:909 — HeaderManager._handleModalDeleteCommentClick 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 · ChatUIManager._updateCallUI (cyclomatic 29) · ×1
  • ChatUIManager._updateCallUI (cyclomatic 29) saicms/public/assets/client/js/typeahead-chat.js:1582 — ChatUIManager._updateCallUI has cyclomatic complexity 29 (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 · FriendsController.searchUserFriendsAPI (cyclomatic 28) · ×1
  • FriendsController.searchUserFriendsAPI (cyclomatic 28) REDACTED:1059 — FriendsController.searchUserFriendsAPI 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 · AdminLxcController.containers (cyclomatic 28) · ×1
  • AdminLxcController.containers (cyclomatic 28) REDACTED:61 — AdminLxcController.containers 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 · PlaygroundController.rename (cyclomatic 28) · ×1
  • PlaygroundController.rename (cyclomatic 28) REDACTED:1009 — PlaygroundController.rename 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 · TunnelController.verifyTunnel (cyclomatic 28) · ×1
  • TunnelController.verifyTunnel (cyclomatic 28) REDACTED:849 — TunnelController.verifyTunnel 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 · McpUnifier.getToolsAsOpenAI (cyclomatic 28) · ×1
  • McpUnifier.getToolsAsOpenAI (cyclomatic 28) src/Core/McpUnifier.php:426 — McpUnifier.getToolsAsOpenAI 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 · ChatStreamHandler.handleRepoDescription (cyclomatic 28) · ×1
  • ChatStreamHandler.handleRepoDescription (cyclomatic 28) src/Handlers/ChatStreamHandler.php:343 — ChatStreamHandler.handleRepoDescription 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 · SandboxManager.ensureSandboxRunning (cyclomatic 28) · ×1
  • SandboxManager.ensureSandboxRunning (cyclomatic 28) src/Helpers/SandboxManager.php:201 — SandboxManager.ensureSandboxRunning 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 · _connectWebSocket · ×1
  • _connectWebSocket::onmessage (cyclomatic 28) saicms/public/assets/client/js/typeahead-chat.js:959 — _connectWebSocket::onmessage 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 · GtbController.saveSettings (cyclomatic 27) · ×1
  • GtbController.saveSettings (cyclomatic 27) REDACTED:215 — GtbController.saveSettings 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 · PlaygroundController.create (cyclomatic 27) · ×1
  • PlaygroundController.create (cyclomatic 27) REDACTED:906 — PlaygroundController.create 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.
D1 · Cyclomatic Complexity · TierController.update (cyclomatic 27) · ×1
  • TierController.update (cyclomatic 27) REDACTED:229 — TierController.update 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 · OpenAICompatibleProvider.ensurePayloadWithinLimit (cyclomatic 27) · ×1
  • OpenAICompatibleProvider.ensurePayloadWithinLimit (cyclomatic 27) src/Core/LLM/Providers/OpenAICompatibleProvider.php:285 — OpenAICompatibleProvider.ensurePayloadWithinLimit 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.
D1 · Cyclomatic Complexity · NotificationManager._loadMoreNotifications (cyclomatic 27) · ×1
  • NotificationManager._loadMoreNotifications (cyclomatic 27) saicms/public/assets/client/js/notifications.js:477 — NotificationManager._loadMoreNotifications has cyclomatic complexity 27 (threshold 15). Of this number, 26 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 · _handleIncomingWebSocketMessage (cyclomatic 27) · ×1
  • _handleIncomingWebSocketMessage (cyclomatic 27) saicms/public/assets/client/js/typeahead-chat.js:1065 — _handleIncomingWebSocketMessage has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 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 · ApiController.fetchOpenAiCompatibleModels (cyclomatic 26) · ×1
  • ApiController.fetchOpenAiCompatibleModels (cyclomatic 26) REDACTED:777 — ApiController.fetchOpenAiCompatibleModels 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 · McpController.chat (cyclomatic 26) · ×1
  • McpController.chat (cyclomatic 26) REDACTED:123 — McpController.chat 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 · McpController.discover (cyclomatic 26) · ×1
  • McpController.discover (cyclomatic 26) REDACTED:263 — McpController.discover 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 · TunnelController.fetchFrpOnlineSubdomainKeyHashes (cyclomatic 26) · ×1
  • TunnelController.fetchFrpOnlineSubdomainKeyHashes (cyclomatic 26) REDACTED:1214 — TunnelController.fetchFrpOnlineSubdomainKeyHashes 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 · ProviderRegistry.fetchModelsFromApi (cyclomatic 26) · ×1
  • ProviderRegistry.fetchModelsFromApi (cyclomatic 26) src/Core/LLM/ProviderRegistry.php:513 — ProviderRegistry.fetchModelsFromApi 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 · Renderer.clean (cyclomatic 26) · ×1
  • Renderer.clean (cyclomatic 26) src/Sites/Renderer.php:23 — Renderer.clean 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 · ajax (cyclomatic 26) · ×1
  • ajax (cyclomatic 26) REDACTED:660 — ajax 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 · _handleChatMessageContextMenu (cyclomatic 26) · ×1
  • _handleChatMessageContextMenu (cyclomatic 26) saicms/public/assets/client/js/typeahead-chat.js:3014 — _handleChatMessageContextMenu has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 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 · install.createConfigurationFiles (cyclomatic 25) · ×1
  • install.createConfigurationFiles (cyclomatic 25) REDACTED:171 — install.createConfigurationFiles has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodeController.codesave (cyclomatic 25) · ×1
  • CodeController.codesave (cyclomatic 25) saicms/app/Controllers/CodeController.php:101 — CodeController.codesave 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 · EditorController.paste (cyclomatic 25) · ×1
  • EditorController.paste (cyclomatic 25) REDACTED:581 — EditorController.paste has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MallController.productPage (cyclomatic 25) · ×1
  • MallController.productPage (cyclomatic 25) REDACTED:481 — MallController.productPage 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 · SettingsController.save (cyclomatic 25) · ×1
  • SettingsController.save (cyclomatic 25) src/Controllers/SettingsController.php:70 — SettingsController.save has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TunnelController.startTunnelClient (cyclomatic 25) · ×1
  • TunnelController.startTunnelClient (cyclomatic 25) REDACTED:587 — TunnelController.startTunnelClient has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UploadController.createPostWithMedia (cyclomatic 25) · ×1
  • UploadController.createPostWithMedia (cyclomatic 25) src/Controllers/UploadController.php:236 — UploadController.createPostWithMedia 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 · startVideoCall · ×1
  • startVideoCall::ontrack (cyclomatic 25) saicms/public/assets/client/js/typeahead-chat.js:1854 — startVideoCall::ontrack has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ActivitiesController.editPostById (cyclomatic 24) · ×1
  • ActivitiesController.editPostById (cyclomatic 24) REDACTED:829 — ActivitiesController.editPostById has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AcademyController.qrphFinalize (cyclomatic 24) · ×1
  • AcademyController.qrphFinalize (cyclomatic 24) REDACTED:1852 — AcademyController.qrphFinalize 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 · ApiController.attemptWriteFile (cyclomatic 24) · ×1
  • ApiController.attemptWriteFile (cyclomatic 24) REDACTED:67 — ApiController.attemptWriteFile has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PaymentController.paypalCapture (cyclomatic 24) · ×1
  • PaymentController.paypalCapture (cyclomatic 24) REDACTED:1191 — PaymentController.paypalCapture has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · UserController.dashboardAction (cyclomatic 24) · ×1
  • UserController.dashboardAction (cyclomatic 24) src/Controllers/UserController.php:122 — UserController.dashboardAction has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UserController.loginAction (cyclomatic 24) · ×1
  • UserController.loginAction (cyclomatic 24) src/Controllers/UserController.php:1705 — UserController.loginAction 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 · ClientSandboxHelper.getOrCreateSandboxId (cyclomatic 24) · ×1
  • ClientSandboxHelper.getOrCreateSandboxId (cyclomatic 24) src/Helpers/ClientSandboxHelper.php:42 — ClientSandboxHelper.getOrCreateSandboxId 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 · DockerSandboxManager.listFiles (cyclomatic 24) · ×1
  • DockerSandboxManager.listFiles (cyclomatic 24) src/Helpers/DockerSandboxManager.php:953 — DockerSandboxManager.listFiles 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 · LxdSandboxManager.sandboxToIp (cyclomatic 24) · ×1
  • LxdSandboxManager.sandboxToIp (cyclomatic 24) src/Helpers/LxdSandboxManager.php:185 — LxdSandboxManager.sandboxToIp 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 · LxdSandboxManager.listFiles (cyclomatic 24) · ×1
  • LxdSandboxManager.listFiles (cyclomatic 24) src/Helpers/LxdSandboxManager.php:1714 — LxdSandboxManager.listFiles 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 · MessengerServer.onMessage (cyclomatic 24) · ×1
  • MessengerServer.onMessage (cyclomatic 24) src/Playground/MessengerServer.php:81 — MessengerServer.onMessage 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 · MessengerServer.handleCallOffer (cyclomatic 24) · ×1
  • MessengerServer.handleCallOffer (cyclomatic 24) src/Playground/MessengerServer.php:595 — MessengerServer.handleCallOffer has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · REDACTED.document.addEventListener("DOMContentLoaded") (cyclomatic 24) · ×1
  • REDACTED.document.addEventListener("DOMContentLoaded") (cyclomatic 24) REDACTED:31 — REDACTED.document.addEventListener("DOMContentLoaded") 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 · ProfileApp._bindEvents (cyclomatic 24) · ×1
  • ProfileApp._bindEvents (cyclomatic 24) saicms/public/assets/client/js/profile.js:132 — ProfileApp._bindEvents has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous).filterClientSideAndTriggerServerSearch (cyclomatic 24) · ×1
  • (anonymous).filterClientSideAndTriggerServerSearch (cyclomatic 24) saicms/public/assets/client/js/F.js:1002 — (anonymous).filterClientSideAndTriggerServerSearch has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · handleVideoOffer · ×1
  • handleVideoOffer::(anonymous)::ontrack (cyclomatic 24) saicms/public/assets/client/js/typeahead-chat.js:2087 — handleVideoOffer::(anonymous)::ontrack 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 · ChatController.notifyWebSocketServerOfNewMessage (cyclomatic 23) · ×1
  • ChatController.notifyWebSocketServerOfNewMessage (cyclomatic 23) saicms/app/Controllers/ChatController.php:594 — ChatController.notifyWebSocketServerOfNewMessage 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 · ChatController.getUserConversations (cyclomatic 23) · ×1
  • ChatController.getUserConversations (cyclomatic 23) saicms/app/Controllers/ChatController.php:1210 — ChatController.getUserConversations 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 · ActivitiesController.editPostById (cyclomatic 23) · ×1
  • ActivitiesController.editPostById (cyclomatic 23) REDACTED:904 — ActivitiesController.editPostById 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 · BarangayController.detect (cyclomatic 23) · ×1
  • BarangayController.detect (cyclomatic 23) REDACTED:36 — BarangayController.detect 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 · BarangayController.set (cyclomatic 23) · ×1
  • BarangayController.set (cyclomatic 23) REDACTED:577 — BarangayController.set 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 · BarangayController.nearby (cyclomatic 23) · ×1
  • BarangayController.nearby (cyclomatic 23) REDACTED:1142 — BarangayController.nearby 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 · FrpController.setSubdomainKey (cyclomatic 23) · ×1
  • FrpController.setSubdomainKey (cyclomatic 23) REDACTED:541 — FrpController.setSubdomainKey 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 · MallController.marketplace (cyclomatic 23) · ×1
  • MallController.marketplace (cyclomatic 23) REDACTED:72 — MallController.marketplace 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 · PaymentController.checkStatus (cyclomatic 23) · ×1
  • PaymentController.checkStatus (cyclomatic 23) REDACTED:855 — PaymentController.checkStatus 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 · TunnelController.proxyToTargetHost (cyclomatic 23) · ×1
  • TunnelController.proxyToTargetHost (cyclomatic 23) REDACTED:100 — TunnelController.proxyToTargetHost 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 · McpInvoker.invoke (cyclomatic 23) · ×1
  • McpInvoker.invoke (cyclomatic 23) src/Core/McpInvoker.php:27 — McpInvoker.invoke 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 · ChatStreamHandler.buildSystemPrompt (cyclomatic 23) · ×1
  • ChatStreamHandler.buildSystemPrompt (cyclomatic 23) src/Handlers/ChatStreamHandler.php:2043 — ChatStreamHandler.buildSystemPrompt 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 · SandboxManager.execInSandbox (cyclomatic 23) · ×1
  • SandboxManager.execInSandbox (cyclomatic 23) src/Helpers/SandboxManager.php:95 — SandboxManager.execInSandbox 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 · Subscriptions.checkout (cyclomatic 23) · ×1
  • Subscriptions.checkout (cyclomatic 23) src/Sites/Subscriptions.php:86 — Subscriptions.checkout 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 · Subscriptions.confirm (cyclomatic 23) · ×1
  • Subscriptions.confirm (cyclomatic 23) src/Sites/Subscriptions.php:157 — Subscriptions.confirm 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 · turnstile_bypass.analyze_page (cyclomatic 23) · ×1
  • turnstile_bypass.analyze_page (cyclomatic 23) tools/lightpanda-mcp/scripts/turnstile_bypass.py:53 — turnstile_bypass.analyze_page 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 · NotificationManager._handleFriendRequestAction (cyclomatic 23) · ×1
  • NotificationManager._handleFriendRequestAction (cyclomatic 23) saicms/public/assets/client/js/notifications.js:665 — NotificationManager._handleFriendRequestAction has cyclomatic complexity 23 (threshold 15). 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, separate the cases: extract each independent 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 · SmartFedApp._initDropdowns (cyclomatic 23) · ×1
  • SmartFedApp._initDropdowns (cyclomatic 23) saicms/public/assets/client/js/smartfed.js:130 — SmartFedApp._initDropdowns has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 136, setupDropdownToggle, a function literal at line 139, …). 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 · setCurrentUserDetails (cyclomatic 23) · ×1
  • setCurrentUserDetails (cyclomatic 23) saicms/public/assets/client/js/typeahead-chat.js:904 — setCurrentUserDetails 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.
D1 · Cyclomatic Complexity · geo_import.importCountry (cyclomatic 22) · ×1
  • geo_import.importCountry (cyclomatic 22) bin/geo_import.php:219 — geo_import.importCountry 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 · install.createAdminAccountStep (cyclomatic 22) · ×1
  • install.createAdminAccountStep (cyclomatic 22) REDACTED:924 — install.createAdminAccountStep 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 · ActivitiesController.updatePost (cyclomatic 22) · ×1
  • ActivitiesController.updatePost (cyclomatic 22) REDACTED:431 — ActivitiesController.updatePost 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 · ActivitiesController.addComment (cyclomatic 22) · ×1
  • ActivitiesController.addComment (cyclomatic 22) REDACTED:335 — ActivitiesController.addComment 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 · ActivitiesController.editCommentById (cyclomatic 22) · ×1
  • ActivitiesController.editCommentById (cyclomatic 22) REDACTED:760 — ActivitiesController.editCommentById 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 · AudioController.handlePythonStt (cyclomatic 22) · ×1
  • AudioController.handlePythonStt (cyclomatic 22) REDACTED:416 — AudioController.handlePythonStt 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 · EditorController.toggleSandbox (cyclomatic 22) · ×1
  • EditorController.toggleSandbox (cyclomatic 22) REDACTED:70 — EditorController.toggleSandbox 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 · HostingController.listDomains (cyclomatic 22) · ×1
  • HostingController.listDomains (cyclomatic 22) REDACTED:2081 — HostingController.listDomains 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 · PagesController.routes (cyclomatic 22) · ×1
  • PagesController.routes (cyclomatic 22) REDACTED:172 — PagesController.routes 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 · PaymentController.cryptoPayments (cyclomatic 22) · ×1
  • PaymentController.cryptoPayments (cyclomatic 22) REDACTED:618 — PaymentController.cryptoPayments 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 · PlaygroundController.delete (cyclomatic 22) · ×1
  • PlaygroundController.delete (cyclomatic 22) REDACTED:1107 — PlaygroundController.delete 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 · TunnelController.fetchFrpOnlineSubdomains (cyclomatic 22) · ×1
  • TunnelController.fetchFrpOnlineSubdomains (cyclomatic 22) REDACTED:1075 — TunnelController.fetchFrpOnlineSubdomains 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 · OpenAICompatibleProvider.normalizeContentPayloadToText (cyclomatic 22) · ×1
  • OpenAICompatibleProvider.normalizeContentPayloadToText (cyclomatic 22) src/Core/LLM/Providers/OpenAICompatibleProvider.php:933 — OpenAICompatibleProvider.normalizeContentPayloadToText 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 · StandardMcpHost.runTool (cyclomatic 22) · ×1
  • StandardMcpHost.runTool (cyclomatic 22) src/Core/StandardMcpHost.php:367 — StandardMcpHost.runTool 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 · ChatStreamHandler.truncateMessagesForProvider (cyclomatic 22) · ×1
  • ChatStreamHandler.truncateMessagesForProvider (cyclomatic 22) src/Handlers/ChatStreamHandler.php:461 — ChatStreamHandler.truncateMessagesForProvider 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 · ImageGenHandler.normalizeImageResult (cyclomatic 22) · ×1
  • ImageGenHandler.normalizeImageResult (cyclomatic 22) src/Handlers/ImageGenHandler.php:265 — ImageGenHandler.normalizeImageResult 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 · Product.list (cyclomatic 22) · ×1
  • Product.list (cyclomatic 22) src/Models/Product.php:132 — Product.list 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 · GtbStrategy.reconcileLive (cyclomatic 22) · ×1
  • GtbStrategy.reconcileLive (cyclomatic 22) src/Services/GtbStrategy.php:588 — GtbStrategy.reconcileLive 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 · MallCommerceService.recordStorefrontImpression (cyclomatic 22) · ×1
  • MallCommerceService.recordStorefrontImpression (cyclomatic 22) src/Services/MallCommerceService.php:808 — MallCommerceService.recordStorefrontImpression 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 · MallCommerceService.estimateCheckoutFees (cyclomatic 22) · ×1
  • MallCommerceService.estimateCheckoutFees (cyclomatic 22) src/Services/MallCommerceService.php:1273 — MallCommerceService.estimateCheckoutFees 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 · ProfileApp._bindEvents (cyclomatic 22) · ×1
  • ProfileApp._bindEvents (cyclomatic 22) saicms/public/assets/client/js/dashboard.js:67 — ProfileApp._bindEvents 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 2 function literals inside it that branch (lines 68, 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 · PostFeedManager._updatePostElementUI (cyclomatic 22) · ×1
  • PostFeedManager._updatePostElementUI (cyclomatic 22) saicms/public/assets/client/js/feedmanager.js:2463 — PostFeedManager._updatePostElementUI 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 · SmartFedApp.openPostModal (cyclomatic 22) · ×1
  • SmartFedApp.openPostModal (cyclomatic 22) saicms/public/assets/client/js/smartfed.js:322 — SmartFedApp.openPostModal 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 · ChatUIManager.constructor (cyclomatic 22) · ×1
  • ChatUIManager.constructor (cyclomatic 22) saicms/public/assets/client/js/typeahead-chat.js:249 — ChatUIManager.constructor has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 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 · websearch.search (cyclomatic 22) · ×1
  • websearch.search (cyclomatic 22) REDACTED:311 — websearch.search 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 4 function literals inside it that branch (lines 327, 344, 323, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · ActivitiesController.createSharePost (cyclomatic 21) · ×1
  • ActivitiesController.createSharePost (cyclomatic 21) REDACTED:1034 — ActivitiesController.createSharePost 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 · ActivitiesController.updatePost (cyclomatic 21) · ×1
  • ActivitiesController.updatePost (cyclomatic 21) REDACTED:466 — ActivitiesController.updatePost 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 · ApiController.parseFileDirective (cyclomatic 21) · ×1
  • ApiController.parseFileDirective (cyclomatic 21) REDACTED:153 — ApiController.parseFileDirective 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 · AuthController.loginMobile (cyclomatic 21) · ×1
  • AuthController.loginMobile (cyclomatic 21) REDACTED:156 — AuthController.loginMobile 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 · HostingController.tunnelKeysBulkReactivate (cyclomatic 21) · ×1
  • HostingController.tunnelKeysBulkReactivate (cyclomatic 21) REDACTED:1055 — HostingController.tunnelKeysBulkReactivate 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 · MallCheckoutController.buyerRegisterAction (cyclomatic 21) · ×1
  • MallCheckoutController.buyerRegisterAction (cyclomatic 21) src/Controllers/MallCheckoutController.php:605 — MallCheckoutController.buyerRegisterAction 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 · MessengerController.createGroupConversation (cyclomatic 21) · ×1
  • MessengerController.createGroupConversation (cyclomatic 21) REDACTED:533 — MessengerController.createGroupConversation 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 · WebhookController.paymongoWebhook (cyclomatic 21) · ×1
  • WebhookController.paymongoWebhook (cyclomatic 21) src/Controllers/WebhookController.php:858 — WebhookController.paymongoWebhook has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ChatStreamHandler.handleOllamaRequest (cyclomatic 21) · ×1
  • ChatStreamHandler.handleOllamaRequest (cyclomatic 21) src/Handlers/ChatStreamHandler.php:717 — ChatStreamHandler.handleOllamaRequest 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 · LightpandaSearchHandler.getReasoningLLM (cyclomatic 21) · ×1
  • LightpandaSearchHandler.getReasoningLLM (cyclomatic 21) src/Handlers/LightpandaSearchHandler.php:1117 — LightpandaSearchHandler.getReasoningLLM 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 · FixedPtyServer.onOpen (cyclomatic 21) · ×1
  • FixedPtyServer.onOpen (cyclomatic 21) src/Playground/FixedPtyServer.php:17 — FixedPtyServer.onOpen 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 · UsdtBep20Verifier.verify (cyclomatic 21) · ×1
  • UsdtBep20Verifier.verify (cyclomatic 21) src/Services/UsdtBep20Verifier.php:80 — UsdtBep20Verifier.verify 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 · CustomerChat.reply (cyclomatic 21) · ×1
  • CustomerChat.reply (cyclomatic 21) src/Sites/CustomerChat.php:39 — CustomerChat.reply 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 · dashboard.document.addEventListener("DOMContentLoaded") (cyclomatic 21) · ×1
  • dashboard.document.addEventListener("DOMContentLoaded") (cyclomatic 21) saicms/public/assets/client/js/dashboard.js:240 — dashboard.document.addEventListener("DOMContentLoaded") has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 317, 349). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · PostFeedManager._handleEditComment (cyclomatic 21) · ×1
  • PostFeedManager._handleEditComment (cyclomatic 21) saicms/public/assets/client/js/feedmanager.js:1565 — PostFeedManager._handleEditComment has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 1616, closeEditUI). 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 · PostFeedManager._updatePostCommentCountsUI (cyclomatic 21) · ×1
  • PostFeedManager._updatePostCommentCountsUI (cyclomatic 21) saicms/public/assets/client/js/feedmanager.js:3003 — PostFeedManager._updatePostCommentCountsUI 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 · mediamanager.document.addEventListener("DOMContentLoaded") (cyclomatic 21) · ×1
  • mediamanager.document.addEventListener("DOMContentLoaded") (cyclomatic 21) saicms/public/assets/client/js/mediamanager.js:967 — mediamanager.document.addEventListener("DOMContentLoaded") has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1047, 978). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · UserTypeahead._bindEvents (cyclomatic 21) · ×1
  • UserTypeahead._bindEvents (cyclomatic 21) saicms/public/assets/client/js/typeahead-chat.js:65 — UserTypeahead._bindEvents 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 3 function literals inside it that branch (lines 86, 71, 98). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · ChatUIManager._handleGlobalClick (cyclomatic 21) · ×1
  • ChatUIManager._handleGlobalClick (cyclomatic 21) saicms/public/assets/client/js/typeahead-chat.js:873 — ChatUIManager._handleGlobalClick 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 · typing.document.addEventListener("DOMContentLoaded") · ×1
  • typing.document.addEventListener("DOMContentLoaded")::handleKeyDown (cyclomatic 21) saicms/public/assets/gaming/typing/js/typing.js:337 — typing.document.addEventListener("DOMContentLoaded")::handleKeyDown 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 · sandbox-proxy.sandboxToIp (cyclomatic 21) · ×1
  • sandbox-proxy.sandboxToIp (cyclomatic 21) REDACTED:163 — sandbox-proxy.sandboxToIp 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 · (anonymous) (cyclomatic 21) · ×1
  • (anonymous) (cyclomatic 21) saicms/public/assets/client/js/dashboard.js:240 — (anonymous) has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 317, 349, 342, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · ActivitiesController.editCommentById (cyclomatic 20) · ×1
  • ActivitiesController.editCommentById (cyclomatic 20) REDACTED:703 — ActivitiesController.editCommentById 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 · FriendsController.fetchUserAcceptedFriendsInternal (cyclomatic 20) · ×1
  • FriendsController.fetchUserAcceptedFriendsInternal (cyclomatic 20) REDACTED:255 — FriendsController.fetchUserAcceptedFriendsInternal 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 · FriendsController.mutualFriendsAPI (cyclomatic 20) · ×1
  • FriendsController.mutualFriendsAPI (cyclomatic 20) REDACTED:1315 — FriendsController.mutualFriendsAPI 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 · AcademyController.runAnalysis (cyclomatic 20) · ×1
  • AcademyController.runAnalysis (cyclomatic 20) REDACTED:317 — AcademyController.runAnalysis 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 · ActivitiesController.deletePost (cyclomatic 20) · ×1
  • ActivitiesController.deletePost (cyclomatic 20) REDACTED:543 — ActivitiesController.deletePost 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 · ActivitiesController.createSharePost (cyclomatic 20) · ×1
  • ActivitiesController.createSharePost (cyclomatic 20) REDACTED:1105 — ActivitiesController.createSharePost 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 · SandboxController.status (cyclomatic 20) · ×1
  • SandboxController.status (cyclomatic 20) src/Controllers/SandboxController.php:144 — SandboxController.status 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 · SandboxController.openwebuiStatus (cyclomatic 20) · ×1
  • SandboxController.openwebuiStatus (cyclomatic 20) src/Controllers/SandboxController.php:1367 — SandboxController.openwebuiStatus 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 · RateLimitService.canMakeTtsRequest (cyclomatic 20) · ×1
  • RateLimitService.canMakeTtsRequest (cyclomatic 20) src/Core/RateLimitService.php:504 — RateLimitService.canMakeTtsRequest 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 · LxdSandboxManager.migrateContainerNetworkIfNeeded (cyclomatic 20) · ×1
  • LxdSandboxManager.migrateContainerNetworkIfNeeded (cyclomatic 20) src/Helpers/LxdSandboxManager.php:478 — LxdSandboxManager.migrateContainerNetworkIfNeeded 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 · Product.create (cyclomatic 20) · ×1
  • Product.create (cyclomatic 20) src/Models/Product.php:22 — Product.create 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 · turnstile_bypass.generate_raphael_image (cyclomatic 20) · ×1
  • turnstile_bypass.generate_raphael_image (cyclomatic 20) tools/lightpanda-mcp/scripts/turnstile_bypass.py:171 — turnstile_bypass.generate_raphael_image 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 · REDACTED.loadExistingEnvValues (cyclomatic 20) · ×1
  • REDACTED.loadExistingEnvValues (cyclomatic 20) REDACTED:1404 — REDACTED.loadExistingEnvValues 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 · F.F.extend (cyclomatic 20) · ×1
  • F.F.extend (cyclomatic 20) saicms/public/assets/client/js/F.js:247 — F.F.extend 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 · PostFeedManager._createAICodePostElement (cyclomatic 20) · ×1
  • PostFeedManager._createAICodePostElement (cyclomatic 20) saicms/public/assets/client/js/feedmanager.js:1807 — PostFeedManager._createAICodePostElement 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · HeaderManager._bindDelegatedModalEvents (cyclomatic 20) · ×1
  • HeaderManager._bindDelegatedModalEvents (cyclomatic 20) saicms/public/assets/client/js/headmanager.js:226 — HeaderManager._bindDelegatedModalEvents 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 232, 258). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MediaUploader._populateUploadForm (cyclomatic 20) · ×1
  • MediaUploader._populateUploadForm (cyclomatic 20) saicms/public/assets/client/js/mediamanager.js:92 — MediaUploader._populateUploadForm has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 222, a function literal at line 176, updatePostButtonState, …). 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).renderCard (cyclomatic 20) · ×1
  • (anonymous).renderCard (cyclomatic 20) saicms/public/assets/client/js/F.js:713 — (anonymous).renderCard has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · StoriesController.deleteStory (cyclomatic 19) · ×1
  • StoriesController.deleteStory (cyclomatic 19) saicms/app/Controllers/StoriesController.php:271 — StoriesController.deleteStory 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 · AcademyController.movers (cyclomatic 19) · ×1
  • AcademyController.movers (cyclomatic 19) REDACTED:580 — AcademyController.movers 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 · AdminController.dashboardLogs (cyclomatic 19) · ×1
  • AdminController.dashboardLogs (cyclomatic 19) src/Controllers/AdminController.php:57 — AdminController.dashboardLogs 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 · AdminController.dashboard (cyclomatic 19) · ×1
  • AdminController.dashboard (cyclomatic 19) src/Controllers/AdminController.php:154 — AdminController.dashboard 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 · AdminLxcController.vncConnect (cyclomatic 19) · ×1
  • AdminLxcController.vncConnect (cyclomatic 19) REDACTED:816 — AdminLxcController.vncConnect 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 · ApiController.extractFileContentFromText (cyclomatic 19) · ×1
  • ApiController.extractFileContentFromText (cyclomatic 19) REDACTED:217 — ApiController.extractFileContentFromText 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 · AudioController.transcribe (cyclomatic 19) · ×1
  • AudioController.transcribe (cyclomatic 19) REDACTED:315 — AudioController.transcribe 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 · LiveController.runDatabaseMigrations (cyclomatic 19) · ×1
  • LiveController.runDatabaseMigrations (cyclomatic 19) src/Controllers/LiveController.php:212 — LiveController.runDatabaseMigrations 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 · MallController.upload (cyclomatic 19) · ×1
  • MallController.upload (cyclomatic 19) REDACTED:157 — MallController.upload 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 · SandboxController.health (cyclomatic 19) · ×1
  • SandboxController.health (cyclomatic 19) src/Controllers/SandboxController.php:252 — SandboxController.health 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 · SqetchChatController.handle (cyclomatic 19) · ×1
  • SqetchChatController.handle (cyclomatic 19) src/Controllers/SqetchChatController.php:11 — SqetchChatController.handle has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TierController.deletePaypalPlan (cyclomatic 19) · ×1
  • TierController.deletePaypalPlan (cyclomatic 19) REDACTED:367 — TierController.deletePaypalPlan 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 · TunnelController.startSshTunnel (cyclomatic 19) · ×1
  • TunnelController.startSshTunnel (cyclomatic 19) REDACTED:466 — TunnelController.startSshTunnel 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 · UserController.capturePaymentAction (cyclomatic 19) · ×1
  • UserController.capturePaymentAction (cyclomatic 19) src/Controllers/UserController.php:1076 — UserController.capturePaymentAction 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 · AbstractLLMProvider.postStream (cyclomatic 19) · ×1
  • AbstractLLMProvider.postStream (cyclomatic 19) src/Core/LLM/AbstractLLMProvider.php:113 — AbstractLLMProvider.postStream 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 · AnthropicProvider.chatStream (cyclomatic 19) · ×1
  • AnthropicProvider.chatStream (cyclomatic 19) src/Core/LLM/Providers/AnthropicProvider.php:189 — AnthropicProvider.chatStream 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 · OpenAICompatibleProvider.parseResponse (cyclomatic 19) · ×1
  • OpenAICompatibleProvider.parseResponse (cyclomatic 19) src/Core/LLM/Providers/OpenAICompatibleProvider.php:851 — OpenAICompatibleProvider.parseResponse 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 · LightpandaSearchHandler.executeInterleavedSearch (cyclomatic 19) · ×1
  • LightpandaSearchHandler.executeInterleavedSearch (cyclomatic 19) src/Handlers/LightpandaSearchHandler.php:756 — LightpandaSearchHandler.executeInterleavedSearch 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 · ClientSandboxHelper.getSandboxIdIfExists (cyclomatic 19) · ×1
  • ClientSandboxHelper.getSandboxIdIfExists (cyclomatic 19) src/Helpers/ClientSandboxHelper.php:150 — ClientSandboxHelper.getSandboxIdIfExists 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 · dashboard.document.addEventListener("DOMContentLoaded") (cyclomatic 19) · ×1
  • dashboard.document.addEventListener("DOMContentLoaded") (cyclomatic 19) saicms/public/assets/client/js/dashboard.js:359 — dashboard.document.addEventListener("DOMContentLoaded") has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PostFeedManager._handleDeletePost (cyclomatic 19) · ×1
  • PostFeedManager._handleDeletePost (cyclomatic 19) saicms/public/assets/client/js/feedmanager.js:2534 — PostFeedManager._handleDeletePost has cyclomatic complexity 19 (threshold 15). Of this number, 12 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 · NotificationManager.updateNotificationsDisplay (cyclomatic 19) · ×1
  • NotificationManager.updateNotificationsDisplay (cyclomatic 19) saicms/public/assets/client/js/notifications.js:287 — NotificationManager.updateNotificationsDisplay has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · UserTypeahead._fetchUsers (cyclomatic 19) · ×1
  • UserTypeahead._fetchUsers (cyclomatic 19) saicms/public/assets/client/js/typeahead-chat.js:150 — UserTypeahead._fetchUsers 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 · ChatUIManager._createChatboxDOM (cyclomatic 19) · ×1
  • ChatUIManager._createChatboxDOM (cyclomatic 19) saicms/public/assets/client/js/typeahead-chat.js:1403 — ChatUIManager._createChatboxDOM has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 1535, a function literal at line 1520, a function literal at line 1493, …). 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 · ChatUIManager._showRemoteUserTypingIndicator (cyclomatic 19) · ×1
  • ChatUIManager._showRemoteUserTypingIndicator (cyclomatic 19) saicms/public/assets/client/js/typeahead-chat.js:2388 — ChatUIManager._showRemoteUserTypingIndicator has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · typeahead.document.addEventListener("DOMContentLoaded") (cyclomatic 19) · ×1
  • typeahead.document.addEventListener("DOMContentLoaded") (cyclomatic 19) saicms/public/assets/client/js/typeahead.js:1 — typeahead.document.addEventListener("DOMContentLoaded") has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (fetchUsers, a function literal at line 20, displayResults, …). 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 · ajax · ×1
  • ajax::onreadystatechange (cyclomatic 19) REDACTED:709 — ajax::onreadystatechange 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 · (anonymous) (cyclomatic 19) · ×1
  • (anonymous) (cyclomatic 19) saicms/public/assets/client/js/dashboard.js:359 — (anonymous) has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 10 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 · FriendsController.sendRequest (cyclomatic 18) · ×1
  • FriendsController.sendRequest (cyclomatic 18) REDACTED:355 — FriendsController.sendRequest 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 · MigrationsController.install (cyclomatic 18) · ×1
  • MigrationsController.install (cyclomatic 18) saicms/app/Controllers/MigrationsController.php:17 — MigrationsController.install 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 · UploadController.createPostWithMedia (cyclomatic 18) · ×1
  • UploadController.createPostWithMedia (cyclomatic 18) saicms/app/Controllers/UploadController.php:232 — UploadController.createPostWithMedia 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 · AcademyController.adminSave (cyclomatic 18) · ×1
  • AcademyController.adminSave (cyclomatic 18) REDACTED:526 — AcademyController.adminSave 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 · AcademyController.qrphInit (cyclomatic 18) · ×1
  • AcademyController.qrphInit (cyclomatic 18) REDACTED:1668 — AcademyController.qrphInit 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 · BarangayController.saveProductZones (cyclomatic 18) · ×1
  • BarangayController.saveProductZones (cyclomatic 18) REDACTED:880 — BarangayController.saveProductZones 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 · DebugController.llm (cyclomatic 18) · ×1
  • DebugController.llm (cyclomatic 18) REDACTED:48 — DebugController.llm 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 · HostingController.getAvailableLxcContainers (cyclomatic 18) · ×1
  • HostingController.getAvailableLxcContainers (cyclomatic 18) REDACTED:2190 — HostingController.getAvailableLxcContainers 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 · NetworkController.getAllContainersFallback (cyclomatic 18) · ×1
  • NetworkController.getAllContainersFallback (cyclomatic 18) REDACTED:619 — NetworkController.getAllContainersFallback 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 · PaymentController.paypalOrder (cyclomatic 18) · ×1
  • PaymentController.paypalOrder (cyclomatic 18) REDACTED:1040 — PaymentController.paypalOrder 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 · PaymentController.validatePromoCode (cyclomatic 18) · ×1
  • PaymentController.validatePromoCode (cyclomatic 18) REDACTED:1368 — PaymentController.validatePromoCode 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 · PaymentController.gintoPayStandaloneInit (cyclomatic 18) · ×1
  • PaymentController.gintoPayStandaloneInit (cyclomatic 18) REDACTED:1831 — PaymentController.gintoPayStandaloneInit 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 · PromoCodesAdminController.validate (cyclomatic 18) · ×1
  • PromoCodesAdminController.validate (cyclomatic 18) REDACTED:225 — PromoCodesAdminController.validate 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 · SandboxController.call (cyclomatic 18) · ×1
  • SandboxController.call (cyclomatic 18) src/Controllers/SandboxController.php:966 — SandboxController.call 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 · SitesCardController.state (cyclomatic 18) · ×1
  • SitesCardController.state (cyclomatic 18) src/Controllers/SitesCardController.php:231 — SitesCardController.state 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 · StoriesController.deleteStory (cyclomatic 18) · ×1
  • StoriesController.deleteStory (cyclomatic 18) src/Controllers/StoriesController.php:299 — StoriesController.deleteStory 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 · TunnelController.verifyTunnelAccessKey (cyclomatic 18) · ×1
  • TunnelController.verifyTunnelAccessKey (cyclomatic 18) REDACTED:2229 — TunnelController.verifyTunnelAccessKey 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 · UnifiedMcpClient.sanitizeToolResult (cyclomatic 18) · ×1
  • UnifiedMcpClient.sanitizeToolResult (cyclomatic 18) src/Core/LLM/UnifiedMcpClient.php:603 — UnifiedMcpClient.sanitizeToolResult 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 · ChatStreamHandler.handleStreamError (cyclomatic 18) · ×1
  • ChatStreamHandler.handleStreamError (cyclomatic 18) src/Handlers/ChatStreamHandler.php:2266 — ChatStreamHandler.handleStreamError 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 · LightpandaSearchHandler.fetchDirectUrls (cyclomatic 18) · ×1
  • LightpandaSearchHandler.fetchDirectUrls (cyclomatic 18) src/Handlers/LightpandaSearchHandler.php:1024 — LightpandaSearchHandler.fetchDirectUrls 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 · CsrfMiddleware.handle (cyclomatic 18) · ×1
  • CsrfMiddleware.handle (cyclomatic 18) src/Middleware/CsrfMiddleware.php:141 — CsrfMiddleware.handle 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 · Previews.create (cyclomatic 18) · ×1
  • Previews.create (cyclomatic 18) src/Sites/Previews.php:34 — Previews.create 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 · Showcase.of (cyclomatic 18) · ×1
  • Showcase.of (cyclomatic 18) src/Sites/Showcase.php:25 — Showcase.of 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 · icon_helpers.iconColorAttr (cyclomatic 18) · ×1
  • icon_helpers.iconColorAttr (cyclomatic 18) src/Views/admin/parts/icon_helpers.php:172 — icon_helpers.iconColorAttr 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 · HeaderManager._handleModalViewComments (cyclomatic 18) · ×1
  • HeaderManager._handleModalViewComments (cyclomatic 18) saicms/public/assets/client/js/headmanager.js:712 — HeaderManager._handleModalViewComments 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 · (anonymous).performServerSearch (cyclomatic 18) · ×1
  • (anonymous).performServerSearch (cyclomatic 18) saicms/public/assets/client/js/F.js:966 — (anonymous).performServerSearch has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ActivitiesController.addComment (cyclomatic 17) · ×1
  • ActivitiesController.addComment (cyclomatic 17) REDACTED:300 — ActivitiesController.addComment 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 · ActivitiesController.deleteCommentById (cyclomatic 17) · ×1
  • ActivitiesController.deleteCommentById (cyclomatic 17) REDACTED:618 — ActivitiesController.deleteCommentById 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 · StreamController.getCloudflareWebRTCInputDetails (cyclomatic 17) · ×1
  • StreamController.getCloudflareWebRTCInputDetails (cyclomatic 17) REDACTED:56 — StreamController.getCloudflareWebRTCInputDetails 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 · ChatMessageHandler.initializeDb (cyclomatic 17) · ×1
  • ChatMessageHandler.initializeDb (cyclomatic 17) saicms/app/WebSocket/ChatMessageHandler.php:56 — ChatMessageHandler.initializeDb 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 · AdminLxcController.containerAction (cyclomatic 17) · ×1
  • AdminLxcController.containerAction (cyclomatic 17) REDACTED:224 — AdminLxcController.containerAction 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 · CommissionsController.batchLoadAmounts (cyclomatic 17) · ×1
  • CommissionsController.batchLoadAmounts (cyclomatic 17) REDACTED:219 — CommissionsController.batchLoadAmounts 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 · EditorController.file (cyclomatic 17) · ×1
  • EditorController.file (cyclomatic 17) REDACTED:784 — EditorController.file has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GtbController.analyzeCoin (cyclomatic 17) · ×1
  • GtbController.analyzeCoin (cyclomatic 17) REDACTED:620 — GtbController.analyzeCoin 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 · MallCheckoutController.uploadDeliveryProof (cyclomatic 17) · ×1
  • MallCheckoutController.uploadDeliveryProof (cyclomatic 17) src/Controllers/MallCheckoutController.php:934 — MallCheckoutController.uploadDeliveryProof 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 · PaymentController.gintoPayInit (cyclomatic 17) · ×1
  • PaymentController.gintoPayInit (cyclomatic 17) REDACTED:2064 — PaymentController.gintoPayInit 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 · SitesController.create (cyclomatic 17) · ×1
  • SitesController.create (cyclomatic 17) src/Controllers/SitesController.php:150 — SitesController.create 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 · SitesController.me (cyclomatic 17) · ×1
  • SitesController.me (cyclomatic 17) src/Controllers/SitesController.php:341 — SitesController.me 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 · SocialController.feed (cyclomatic 17) · ×1
  • SocialController.feed (cyclomatic 17) src/Controllers/SocialController.php:368 — SocialController.feed 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 · SubscriptionController.activate (cyclomatic 17) · ×1
  • SubscriptionController.activate (cyclomatic 17) src/Controllers/SubscriptionController.php:154 — SubscriptionController.activate 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 · TunnelController.reactivateAccessKey (cyclomatic 17) · ×1
  • TunnelController.reactivateAccessKey (cyclomatic 17) REDACTED:1744 — TunnelController.reactivateAccessKey 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 · McpUnifier.discoverHandlersViaAttributes (cyclomatic 17) · ×1
  • McpUnifier.discoverHandlersViaAttributes (cyclomatic 17) src/Core/McpUnifier.php:43 — McpUnifier.discoverHandlersViaAttributes 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 · DevTools.walkFiles (cyclomatic 17) · ×1
  • DevTools.walkFiles (cyclomatic 17) src/Handlers/DevTools.php:480 — DevTools.walkFiles 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 · LxdSandboxManager.queryContainerIp (cyclomatic 17) · ×1
  • LxdSandboxManager.queryContainerIp (cyclomatic 17) src/Helpers/LxdSandboxManager.php:714 — LxdSandboxManager.queryContainerIp 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 · User.register (cyclomatic 17) · ×1
  • User.register (cyclomatic 17) src/Models/User.php:60 — User.register 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 · MessengerServer.saveCallEvent (cyclomatic 17) · ×1
  • MessengerServer.saveCallEvent (cyclomatic 17) src/Playground/MessengerServer.php:490 — MessengerServer.saveCallEvent 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 · PtyServer.onMessage (cyclomatic 17) · ×1
  • PtyServer.onMessage (cyclomatic 17) src/Playground/PtyServer.php:295 — PtyServer.onMessage 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 · MallCommerceService.calculateDeliveryFee (cyclomatic 17) · ×1
  • MallCommerceService.calculateDeliveryFee (cyclomatic 17) src/Services/MallCommerceService.php:2071 — MallCommerceService.calculateDeliveryFee 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 · Indexing.check (cyclomatic 17) · ×1
  • Indexing.check (cyclomatic 17) src/Sites/Indexing.php:124 — Indexing.check 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 · Insights.weekly (cyclomatic 17) · ×1
  • Insights.weekly (cyclomatic 17) src/Sites/Insights.php:85 — Insights.weekly 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 · icon_helpers.activeIconClass (cyclomatic 17) · ×1
  • icon_helpers.activeIconClass (cyclomatic 17) src/Views/admin/parts/icon_helpers.php:128 — icon_helpers.activeIconClass has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (icon_helpers.iconClassForAdmin) 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.
D1 · Cyclomatic Complexity · icon_helpers.iconClassForAdmin (cyclomatic 17) · ×1
  • icon_helpers.iconClassForAdmin (cyclomatic 17) src/Views/admin/parts/icon_helpers.php:212 — icon_helpers.iconClassForAdmin has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (icon_helpers.activeIconClass) 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.
D1 · Cyclomatic Complexity · REDACTED.startInstallation (cyclomatic 17) · ×1
  • REDACTED.startInstallation (cyclomatic 17) REDACTED:1706 — REDACTED.startInstallation 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 · PostFeedManager.stopAIGeneration (cyclomatic 17) · ×1
  • PostFeedManager.stopAIGeneration (cyclomatic 17) saicms/public/assets/client/js/feedmanager.js:2133 — PostFeedManager.stopAIGeneration 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 · PostFeedManager._handleSubmitComment (cyclomatic 17) · ×1
  • PostFeedManager._handleSubmitComment (cyclomatic 17) saicms/public/assets/client/js/feedmanager.js:2715 — PostFeedManager._handleSubmitComment 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 · UserTypeahead._renderUsers (cyclomatic 17) · ×1
  • UserTypeahead._renderUsers (cyclomatic 17) saicms/public/assets/client/js/typeahead-chat.js:181 — UserTypeahead._renderUsers 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 192). 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 · ChatUIManager._loadOpenChatboxesState (cyclomatic 17) · ×1
  • ChatUIManager._loadOpenChatboxesState (cyclomatic 17) saicms/public/assets/client/js/typeahead-chat.js:828 — ChatUIManager._loadOpenChatboxesState 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 · ChatUIManager._toggleMinimizeChatbox (cyclomatic 17) · ×1
  • ChatUIManager._toggleMinimizeChatbox (cyclomatic 17) saicms/public/assets/client/js/typeahead-chat.js:2317 — ChatUIManager._toggleMinimizeChatbox 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 · generateInitialsSVGDataURI (cyclomatic 17) · ×1
  • generateInitialsSVGDataURI (cyclomatic 17) saicms/public/assets/client/js/F.js:418 — generateInitialsSVGDataURI 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 · (anonymous).performServerSearch (cyclomatic 17) · ×1
  • (anonymous).performServerSearch (cyclomatic 17) saicms/public/assets/client/js/F.js:789 — (anonymous).performServerSearch 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 · _fetchAndDisplayComments (cyclomatic 17) · ×1
  • _fetchAndDisplayComments (cyclomatic 17) saicms/public/assets/client/js/notifications.js:1261 — _fetchAndDisplayComments 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 · ProfileController.fetchCompletePostData (cyclomatic 16) · ×1
  • ProfileController.fetchCompletePostData (cyclomatic 16) saicms/app/Controllers/ProfileController.php:478 — ProfileController.fetchCompletePostData 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 · SmartFiController.processTierPurchase (cyclomatic 16) · ×1
  • SmartFiController.processTierPurchase (cyclomatic 16) saicms/app/Controllers/SmartFiController.php:111 — SmartFiController.processTierPurchase 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 · StreamController.createPostWithStream (cyclomatic 16) · ×1
  • StreamController.createPostWithStream (cyclomatic 16) REDACTED:173 — StreamController.createPostWithStream 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 · ChatMessageHandler._saveAndBroadcastSystemMessage (cyclomatic 16) · ×1
  • ChatMessageHandler._saveAndBroadcastSystemMessage (cyclomatic 16) saicms/app/WebSocket/ChatMessageHandler.php:909 — ChatMessageHandler._saveAndBroadcastSystemMessage 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 · ActivitiesController.deleteCommentById (cyclomatic 16) · ×1
  • ActivitiesController.deleteCommentById (cyclomatic 16) REDACTED:679 — ActivitiesController.deleteCommentById 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 · ApiController.parseTasksFromText (cyclomatic 16) · ×1
  • ApiController.parseTasksFromText (cyclomatic 16) REDACTED:261 — ApiController.parseTasksFromText 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 · ChatController.index (cyclomatic 16) · ×1
  • ChatController.index (cyclomatic 16) REDACTED:712 — ChatController.index 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 · EditorController.create (cyclomatic 16) · ×1
  • EditorController.create (cyclomatic 16) REDACTED:346 — EditorController.create 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 · EditorController.save (cyclomatic 16) · ×1
  • EditorController.save (cyclomatic 16) REDACTED:698 — EditorController.save 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 · HostingController.provisionRelayDomainConfig (cyclomatic 16) · ×1
  • HostingController.provisionRelayDomainConfig (cyclomatic 16) REDACTED:903 — HostingController.provisionRelayDomainConfig 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 · PaymentController.paymongoPayments (cyclomatic 16) · ×1
  • PaymentController.paymongoPayments (cyclomatic 16) REDACTED:1627 — PaymentController.paymongoPayments 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 · UserController.decryptApiTokenEncrypted (cyclomatic 16) · ×1
  • UserController.decryptApiTokenEncrypted (cyclomatic 16) src/Controllers/UserController.php:723 — UserController.decryptApiTokenEncrypted 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 · ProviderRegistry.resolveProviderBaseUrl (cyclomatic 16) · ×1
  • ProviderRegistry.resolveProviderBaseUrl (cyclomatic 16) src/Core/LLM/ProviderRegistry.php:284 — ProviderRegistry.resolveProviderBaseUrl 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 · OllamaProvider.chatStream (cyclomatic 16) · ×1
  • OllamaProvider.chatStream (cyclomatic 16) src/Core/LLM/Providers/OllamaProvider.php:255 — OllamaProvider.chatStream 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 · OpenAICompatibleProvider.routed (cyclomatic 16) · ×1
  • OpenAICompatibleProvider.routed (cyclomatic 16) src/Core/LLM/Providers/OpenAICompatibleProvider.php:544 — OpenAICompatibleProvider.routed 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 · GainerHunter.entryCandidate (cyclomatic 16) · ×1
  • GainerHunter.entryCandidate (cyclomatic 16) src/Services/Strategies/GainerHunter.php:63 — GainerHunter.entryCandidate 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 · Publisher.push (cyclomatic 16) · ×1
  • Publisher.push (cyclomatic 16) src/Sites/Publisher.php:67 — Publisher.push 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 · EnvFile.set (cyclomatic 16) · ×1
  • EnvFile.set (cyclomatic 16) src/Support/EnvFile.php:19 — EnvFile.set 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 · verse.getVerse (cyclomatic 16) · ×1
  • verse.getVerse (cyclomatic 16) src/Views/bible/verse.php:553 — verse.getVerse 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 · ChatUIManager._generateSimpleLocalSvgFallback (cyclomatic 16) · ×1
  • ChatUIManager._generateSimpleLocalSvgFallback (cyclomatic 16) saicms/public/assets/client/js/typeahead-chat.js:751 — ChatUIManager._generateSimpleLocalSvgFallback has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ChatUIManager._handleChatOptionAction (cyclomatic 17) 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 · ChatUIManager._expandVideoToFullScreen (cyclomatic 16) · ×1
  • ChatUIManager._expandVideoToFullScreen (cyclomatic 16) saicms/public/assets/client/js/typeahead-chat.js:1708 — ChatUIManager._expandVideoToFullScreen 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. This is NOT this file's highest cyclomatic complexity: ChatUIManager._handleChatOptionAction (cyclomatic 17) 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 · ChatUIManager._handleSelfTyping (cyclomatic 16) · ×1
  • ChatUIManager._handleSelfTyping (cyclomatic 16) saicms/public/assets/client/js/typeahead-chat.js:2357 — ChatUIManager._handleSelfTyping has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ChatUIManager._handleChatOptionAction (cyclomatic 17) 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 · ChatUIManager._startPollingForChat (cyclomatic 16) · ×1
  • ChatUIManager._startPollingForChat (cyclomatic 16) saicms/public/assets/client/js/typeahead-chat.js:2956 — ChatUIManager._startPollingForChat has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a 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: ChatUIManager._handleChatOptionAction (cyclomatic 17) 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.
D2 · Cognitive Complexity · ChatStreamHandler.handleMainRequest (cognitive 407) · ×1
  • ChatStreamHandler.handleMainRequest (cognitive 407) src/Handlers/ChatStreamHandler.php:827 — ChatStreamHandler.handleMainRequest has cognitive complexity 407 (threshold 15). Drivers by points: if/else 112 (195 pts), ternaries 44 (99 pts), boolean chains 85, error handling 11 (18 pts), loops 5 (10 pts) (nesting depth added 150). To reduce it, split the body into named stages: move each independent 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 · ApiController.providerKeys (cognitive 312) · ×1
  • ApiController.providerKeys (cognitive 312) REDACTED:1617 — ApiController.providerKeys has cognitive complexity 312 (threshold 15). Drivers by points: if/else 43 (162 pts), ternaries 13 (69 pts), error handling 14 (62 pts), boolean chains 14, loops 2 (5 pts) (nesting depth added 226). 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 · ApiController.models (cognitive 239) · ×1
  • ApiController.models (cognitive 239) REDACTED:1014 — ApiController.models has cognitive complexity 239 (threshold 15). Drivers by points: if/else 51 (133 pts), ternaries 10 (36 pts), boolean chains 31, loops 11 (31 pts), error handling 4 (8 pts) (nesting depth added 132). 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 · GtbStrategy.step (cognitive 207) · ×1
  • GtbStrategy.step (cognitive 207) src/Services/GtbStrategy.php:61 — GtbStrategy.step has cognitive complexity 207 (threshold 15). Drivers by points: if/else 42 (122 pts), ternaries 18 (61 pts), loops 5 (14 pts), boolean chains 10 (nesting depth added 132). 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 · addMessageToChatbox (cognitive 135) · ×1
  • addMessageToChatbox (cognitive 135) saicms/public/assets/client/js/typeahead-chat.js:2595 — addMessageToChatbox has cognitive complexity 135 (threshold 15). Drivers by points: if/else 40 (64 pts), ternaries 14 (36 pts), boolean chains 31, loops 1 (4 pts) (nesting depth added 49). Of this number, 132 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 · UserController.registerAction (cognitive 132) · ×1
  • UserController.registerAction (cognitive 132) src/Controllers/UserController.php:1220 — UserController.registerAction has cognitive complexity 132 (threshold 15). Drivers by points: if/else 62 (98 pts), boolean chains 21, ternaries 8, error handling 4 (5 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateSentMessageInChatbox (cognitive 130) · ×1
  • updateSentMessageInChatbox (cognitive 130) saicms/public/assets/client/js/typeahead-chat.js:2733 — updateSentMessageInChatbox has cognitive complexity 130 (threshold 15). Drivers by points: if/else 28 (64 pts), ternaries 11 (42 pts), boolean chains 16, loops 2 (8 pts) (nesting depth added 73). Of this number, 128 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · openChat (cognitive 124) · ×1
  • openChat (cognitive 124) saicms/public/assets/client/js/typeahead-chat.js:1154 — openChat has cognitive complexity 124 (threshold 15). Drivers by points: if/else 46 (75 pts), boolean chains 34, ternaries 5 (10 pts), error handling 2 (5 pts) (nesting depth added 37). Of this number, 122 points are the body's own statements and 2 belong to 5 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 · _createPostElement (cognitive 120) · ×1
  • _createPostElement (cognitive 120) saicms/public/assets/client/js/feedmanager.js:896 — _createPostElement has cognitive complexity 120 (threshold 15). Drivers by points: if/else 33 (60 pts), boolean chains 29, ternaries 15 (28 pts), match/switch 1 (3 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiController.post (cognitive 119) · ×1
  • ApiController.post (cognitive 119) REDACTED:345 — ApiController.post has cognitive complexity 119 (threshold 15). Drivers by points: if/else 35 (92 pts), ternaries 4 (14 pts), loops 3 (10 pts), boolean chains 3 (nesting depth added 74). 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 · ApiController.post (cognitive 114) · ×1
  • ApiController.post (cognitive 114) saicms/app/Controllers/ApiController.php:43 — ApiController.post has cognitive complexity 114 (threshold 15). Drivers by points: if/else 33 (87 pts), ternaries 4 (14 pts), loops 3 (10 pts), boolean chains 3 (nesting depth added 71). 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 · PagesController.editScript (cognitive 113) · ×1
  • PagesController.editScript (cognitive 113) REDACTED:265 — PagesController.editScript has cognitive complexity 113 (threshold 15). Drivers by points: if/else 34 (67 pts), ternaries 6 (16 pts), loops 5 (12 pts), boolean chains 9, error handling 4 (9 pts) (nesting depth added 55). 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 · UnifiedMcpClient.executeToolCall (cognitive 112) · ×1
  • UnifiedMcpClient.executeToolCall (cognitive 112) src/Core/LLM/UnifiedMcpClient.php:729 — UnifiedMcpClient.executeToolCall has cognitive complexity 112 (threshold 15). Drivers by points: if/else 22 (70 pts), error handling 9 (24 pts), boolean chains 14, loops 1 (4 pts) (nesting depth added 66). 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 · ChatStreamHandler.executeImageGeneration (cognitive 111) · ×1
  • ChatStreamHandler.executeImageGeneration (cognitive 111) src/Handlers/ChatStreamHandler.php:3045 — ChatStreamHandler.executeImageGeneration has cognitive complexity 111 (threshold 15). Drivers by points: if/else 34 (52 pts), boolean chains 42, ternaries 9 (17 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startAIGeneration (cognitive 108) · ×1
  • startAIGeneration (cognitive 108) saicms/public/assets/client/js/feedmanager.js:1991 — startAIGeneration has cognitive complexity 108 (threshold 15). Drivers by points: if/else 45 (92 pts), boolean chains 12, error handling 2 (3 pts), loops 1 (nesting depth added 48). 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 · ImageGenHandler.handleSdcpuGeneration (cognitive 102) · ×1
  • ImageGenHandler.handleSdcpuGeneration (cognitive 102) src/Handlers/ImageGenHandler.php:554 — ImageGenHandler.handleSdcpuGeneration has cognitive complexity 102 (threshold 15). Drivers by points: if/else 25 (46 pts), ternaries 15 (38 pts), boolean chains 17, loops 1 (nesting depth added 44). 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 101) · ×1
  • (anonymous) (cognitive 101) saicms/public/assets/client/js/typeahead-chat.js:3533 — (anonymous) has cognitive complexity 101 (threshold 15). Drivers by points: if/else 34 (73 pts), boolean chains 21, error handling 2 (7 pts) (nesting depth added 44). Of this number, 27 points are the body's own statements and 74 belong to 7 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SellerController.productCreate (cognitive 95) · ×1
  • SellerController.productCreate (cognitive 95) src/Controllers/SellerController.php:322 — SellerController.productCreate has cognitive complexity 95 (threshold 15). Drivers by points: if/else 21 (43 pts), ternaries 22 (30 pts), boolean chains 12, error handling 3 (6 pts), loops 2 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SellerController.productUpdate (cognitive 95) · ×1
  • SellerController.productUpdate (cognitive 95) src/Controllers/SellerController.php:644 — SellerController.productUpdate has cognitive complexity 95 (threshold 15). Drivers by points: if/else 22 (44 pts), ternaries 24 (31 pts), boolean chains 12, error handling 1 (4 pts), loops 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · typeahead-chat.document.addEventListener("DOMContentLoaded") (cognitive 95) · ×1
  • typeahead-chat.document.addEventListener("DOMContentLoaded") (cognitive 95) saicms/public/assets/client/js/typeahead-chat.js:3533 — typeahead-chat.document.addEventListener("DOMContentLoaded") has cognitive complexity 95 (threshold 15). Drivers by points: if/else 34 (73 pts), boolean chains 20, error handling 1 (2 pts) (nesting depth added 40). Of this number, 26 points are the body's own statements and 69 belong to 6 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · websearch.generateImage (cognitive 95) · ×1
  • websearch.generateImage (cognitive 95) REDACTED:583 — websearch.generateImage has cognitive complexity 95 (threshold 15). Drivers by points: boolean chains 35, if/else 19 (35 pts), loops 9 (10 pts), ternaries 4 (10 pts), error handling 3 (5 pts) (nesting depth added 25). None of this is in the body itself: all 95 points belong to 12 function literals inside it that branch (lines 587, 810, 740, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Renderer.html (cognitive 94) · ×1
  • Renderer.html (cognitive 94) src/Sites/Renderer.php:100 — Renderer.html has cognitive complexity 94 (threshold 15). Drivers by points: ternaries 54 (67 pts), if/else 8 (11 pts), boolean chains 10, loops 3, match/switch 2 (3 pts) (nesting depth added 17). 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 · loadPosts (cognitive 91) · ×1
  • loadPosts (cognitive 91) saicms/public/assets/client/js/feedmanager.js:712 — loadPosts has cognitive complexity 91 (threshold 15). Drivers by points: if/else 27 (62 pts), boolean chains 21, error handling 3 (5 pts), loops 1 (3 pts) (nesting depth added 39). Of this number, 83 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AcademyController.reconcileBot (cognitive 90) · ×1
  • AcademyController.reconcileBot (cognitive 90) REDACTED:722 — AcademyController.reconcileBot has cognitive complexity 90 (threshold 15). Drivers by points: if/else 22 (41 pts), ternaries 12 (25 pts), loops 9 (13 pts), boolean chains 10, error handling 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent 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 · ChatMessageHandler.onMessage (cognitive 86) · ×1
  • ChatMessageHandler.onMessage (cognitive 86) saicms/app/WebSocket/ChatMessageHandler.php:282 — ChatMessageHandler.onMessage has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (50 pts), ternaries 9 (25 pts), boolean chains 10, match/switch 1 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ChatController.sendMessageApi (cognitive 83) · ×1
  • ChatController.sendMessageApi (cognitive 83) saicms/app/Controllers/ChatController.php:436 — ChatController.sendMessageApi has cognitive complexity 83 (threshold 15). Drivers by points: if/else 26 (53 pts), ternaries 5 (18 pts), boolean chains 12 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SandboxController.install (cognitive 83) · ×1
  • SandboxController.install (cognitive 83) src/Controllers/SandboxController.php:585 — SandboxController.install has cognitive complexity 83 (threshold 15). Drivers by points: if/else 29 (50 pts), boolean chains 19, ternaries 2 (8 pts), error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent 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 · McpUnifier.discoverRuntimeServers (cognitive 83) · ×1
  • McpUnifier.discoverRuntimeServers (cognitive 83) src/Core/McpUnifier.php:295 — McpUnifier.discoverRuntimeServers has cognitive complexity 83 (threshold 15). Drivers by points: if/else 12 (48 pts), ternaries 5 (15 pts), error handling 4 (12 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MallCommerceService.buildOrderBundle (cognitive 83) · ×1
  • MallCommerceService.buildOrderBundle (cognitive 83) src/Services/MallCommerceService.php:984 — MallCommerceService.buildOrderBundle has cognitive complexity 83 (threshold 15). Drivers by points: if/else 18 (30 pts), ternaries 14 (30 pts), loops 9 (12 pts), boolean chains 10, error handling 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StandardMcpHost.getAllTools (cognitive 81) · ×1
  • StandardMcpHost.getAllTools (cognitive 81) src/Core/StandardMcpHost.php:92 — StandardMcpHost.getAllTools has cognitive complexity 81 (threshold 15). Drivers by points: if/else 8 (31 pts), ternaries 7 (21 pts), loops 7 (14 pts), match/switch 1 (7 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent 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 · SandboxMcp.createDocument (cognitive 77) · ×1
  • SandboxMcp.createDocument (cognitive 77) src/Handlers/SandboxMcp.php:740 — SandboxMcp.createDocument has cognitive complexity 77 (threshold 15). Drivers by points: if/else 28 (57 pts), ternaries 5 (13 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 39). 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 · _populatePostViewModal (cognitive 76) · ×1
  • _populatePostViewModal (cognitive 76) saicms/public/assets/client/js/feedmanager.js:1134 — _populatePostViewModal has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (29 pts), ternaries 16 (24 pts), boolean chains 23 (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 · install.generateEnvPairs (cognitive 74) · ×1
  • install.generateEnvPairs (cognitive 74) REDACTED:427 — install.generateEnvPairs has cognitive complexity 74 (threshold 15). Drivers by points: if/else 59 (64 pts), ternaries 5 (9 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · PlaygroundController.paste (cognitive 71) · ×1
  • PlaygroundController.paste (cognitive 71) REDACTED:1192 — PlaygroundController.paste has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (37 pts), error handling 5 (14 pts), loops 5 (11 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 30). To reduce it, split the body into named stages: move each independent 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 · PlaygroundController.save (cognitive 70) · ×1
  • PlaygroundController.save (cognitive 70) REDACTED:362 — PlaygroundController.save has cognitive complexity 70 (threshold 15). Drivers by points: if/else 24 (39 pts), error handling 6 (17 pts), loops 3 (6 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent 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 · OpenAICompatibleProvider.chatStreamOnce (cognitive 70) · ×1
  • OpenAICompatibleProvider.chatStreamOnce (cognitive 70) src/Core/LLM/Providers/OpenAICompatibleProvider.php:660 — OpenAICompatibleProvider.chatStreamOnce has cognitive complexity 70 (threshold 15). Drivers by points: if/else 23 (48 pts), boolean chains 8, ternaries 1 (6 pts), loops 2 (5 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _handleEditPost (cognitive 70) · ×1
  • _handleEditPost (cognitive 70) saicms/public/assets/client/js/feedmanager.js:2213 — _handleEditPost has cognitive complexity 70 (threshold 15). Drivers by points: if/else 40 (49 pts), boolean chains 13, ternaries 6, error handling 2 (nesting depth added 9). Of this number, 32 points are the body's own statements and 38 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, 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 · SocialController.post (cognitive 68) · ×1
  • SocialController.post (cognitive 68) src/Controllers/SocialController.php:38 — SocialController.post has cognitive complexity 68 (threshold 15). Drivers by points: if/else 30 (43 pts), boolean chains 18, ternaries 3 (5 pts), error handling 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveController.imagegenModelStatus (cognitive 65) · ×1
  • LiveController.imagegenModelStatus (cognitive 65) src/Controllers/LiveController.php:924 — LiveController.imagegenModelStatus has cognitive complexity 65 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 13, loops 5 (12 pts), ternaries 3 (5 pts), error handling 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PtyServer.onOpen (cognitive 65) · ×1
  • PtyServer.onOpen (cognitive 65) src/Playground/PtyServer.php:91 — PtyServer.onOpen has cognitive complexity 65 (threshold 15). Drivers by points: if/else 27 (45 pts), error handling 6 (15 pts), boolean chains 3, ternaries 2 (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 · _initializeReadOnlyMonacoForFeedPost (cognitive 64) · ×1
  • _initializeReadOnlyMonacoForFeedPost (cognitive 64) saicms/public/assets/client/js/feedmanager.js:1409 — _initializeReadOnlyMonacoForFeedPost has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (35 pts), ternaries 10 (14 pts), boolean chains 9, error handling 3 (6 pts) (nesting depth added 20). Of this number, 29 points are the body's own statements and 35 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 · PlaygroundController.consoleExec (cognitive 62) · ×1
  • PlaygroundController.consoleExec (cognitive 62) REDACTED:716 — PlaygroundController.consoleExec has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (40 pts), error handling 5 (7 pts), ternaries 5 (6 pts), loops 3 (5 pts), boolean chains 4 (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 · McpUnifier.getToolsAsOpenAI (cognitive 61) · ×1
  • McpUnifier.getToolsAsOpenAI (cognitive 61) src/Core/McpUnifier.php:426 — McpUnifier.getToolsAsOpenAI has cognitive complexity 61 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 4 (10 pts), ternaries 3 (8 pts), boolean chains 5, match/switch 1 (5 pts), error handling 2 (4 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatController.createGroupConversation (cognitive 60) · ×1
  • ChatController.createGroupConversation (cognitive 60) saicms/app/Controllers/ChatController.php:1622 — ChatController.createGroupConversation has cognitive complexity 60 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 17, ternaries 7 (11 pts), error handling 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 · LiveController.fetchHuggingFaceModelSizes (cognitive 60) · ×1
  • LiveController.fetchHuggingFaceModelSizes (cognitive 60) src/Controllers/LiveController.php:1233 — LiveController.fetchHuggingFaceModelSizes has cognitive complexity 60 (threshold 15). Drivers by points: if/else 13 (33 pts), boolean chains 12, loops 5 (12 pts), ternaries 2 (3 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TierController.store (cognitive 60) · ×1
  • TierController.store (cognitive 60) REDACTED:55 — TierController.store has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (32 pts), ternaries 15 (17 pts), error handling 3 (7 pts), boolean chains 3, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SmartFedApp._initPostModal (cognitive 59) · ×1
  • SmartFedApp._initPostModal (cognitive 59) saicms/public/assets/client/js/smartfed.js:179 — SmartFedApp._initPostModal has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (34 pts), ternaries 5 (15 pts), boolean chains 8, error handling 1 (2 pts) (nesting depth added 25). Most of this is not in the body itself: 5 of the 59 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 212, 193, 184). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · PagesController.routes (cognitive 58) · ×1
  • PagesController.routes (cognitive 58) REDACTED:172 — PagesController.routes has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 4 (12 pts), ternaries 1 (4 pts), boolean chains 1, error handling 1 (nesting depth added 38). 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 · FriendsController.friends (cognitive 57) · ×1
  • FriendsController.friends (cognitive 57) REDACTED:75 — FriendsController.friends has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (43 pts), ternaries 7 (8 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiKeysRelayController.streamChat (cognitive 57) · ×1
  • ApiKeysRelayController.streamChat (cognitive 57) src/Controllers/ApiKeysRelayController.php:63 — ApiKeysRelayController.streamChat has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 11, loops 5 (7 pts), ternaries 4 (7 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 · DockerSandboxManager.listFiles (cognitive 57) · ×1
  • DockerSandboxManager.listFiles (cognitive 57) src/Helpers/DockerSandboxManager.php:953 — DockerSandboxManager.listFiles has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (38 pts), ternaries 3 (10 pts), loops 4 (6 pts), boolean chains 3 (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 · _loadAndDisplayRecentMessages (cognitive 57) · ×1
  • _loadAndDisplayRecentMessages (cognitive 57) saicms/public/assets/client/js/typeahead-chat.js:2886 — _loadAndDisplayRecentMessages has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 21, ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 12). Of this number, 55 points are the body's own statements and 2 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 · LxdSandboxManager.listFiles (cognitive 56) · ×1
  • LxdSandboxManager.listFiles (cognitive 56) src/Helpers/LxdSandboxManager.php:1714 — LxdSandboxManager.listFiles has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (40 pts), ternaries 2 (8 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent 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 · LiveController.updateEnvFile (cognitive 55) · ×1
  • LiveController.updateEnvFile (cognitive 55) src/Controllers/LiveController.php:567 — LiveController.updateEnvFile has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 10, boolean chains 8, loops 5 (7 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 · TunnelController.fetchFrpOnlineSubdomainKeyHashes (cognitive 55) · ×1
  • TunnelController.fetchFrpOnlineSubdomainKeyHashes (cognitive 55) REDACTED:1214 — TunnelController.fetchFrpOnlineSubdomainKeyHashes has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 3 (7 pts), boolean chains 6, ternaries 3 (6 pts) (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 · UserController.settingsUpdate (cognitive 55) · ×1
  • UserController.settingsUpdate (cognitive 55) src/Controllers/UserController.php:492 — UserController.settingsUpdate has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 9 (18 pts), error handling 5 (10 pts), boolean chains 3 (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 · loadInitialNotifications (cognitive 55) · ×1
  • loadInitialNotifications (cognitive 55) saicms/public/assets/client/js/typeahead-chat.js:3448 — loadInitialNotifications has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 15, ternaries 5 (14 pts), error handling 1 (nesting depth added 18). Most of this is not in the body itself: 10 of the 55 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 3461, 3510, 3515). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · AdminLxcController.containers (cognitive 54) · ×1
  • AdminLxcController.containers (cognitive 54) REDACTED:61 — AdminLxcController.containers has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 3 (8 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatStreamHandler.normalizeImageGenResult (cognitive 54) · ×1
  • ChatStreamHandler.normalizeImageGenResult (cognitive 54) src/Handlers/ChatStreamHandler.php:2961 — ChatStreamHandler.normalizeImageGenResult has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 22, 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 · ChatController.getUserConversations (cognitive 53) · ×1
  • ChatController.getUserConversations (cognitive 53) saicms/app/Controllers/ChatController.php:1210 — ChatController.getUserConversations has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (42 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FriendsController.searchUserFriendsAPI (cognitive 53) · ×1
  • FriendsController.searchUserFriendsAPI (cognitive 53) REDACTED:1059 — FriendsController.searchUserFriendsAPI has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (33 pts), ternaries 8 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HeaderManager._fetchAndDisplayCommentsForModal (cognitive 53) · ×1
  • HeaderManager._fetchAndDisplayCommentsForModal (cognitive 53) saicms/public/assets/client/js/headmanager.js:759 — HeaderManager._fetchAndDisplayCommentsForModal has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 16, error handling 1 (nesting depth added 12). Of this number, 51 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _handleModalDeleteCommentClick (cognitive 53) · ×1
  • _handleModalDeleteCommentClick (cognitive 53) saicms/public/assets/client/js/headmanager.js:909 — _handleModalDeleteCommentClick has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (39 pts), ternaries 2 (7 pts), boolean chains 6, error handling 1 (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 · ChatStreamHandler.handle (cognitive 52) · ×1
  • ChatStreamHandler.handle (cognitive 52) src/Handlers/ChatStreamHandler.php:30 — ChatStreamHandler.handle has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 16, ternaries 8, error handling 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SandboxManager.ensureSandboxRunning (cognitive 52) · ×1
  • SandboxManager.ensureSandboxRunning (cognitive 52) src/Helpers/SandboxManager.php:201 — SandboxManager.ensureSandboxRunning has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessengerServer.handleCallOffer (cognitive 52) · ×1
  • MessengerServer.handleCallOffer (cognitive 52) src/Playground/MessengerServer.php:595 — MessengerServer.handleCallOffer has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 4 (13 pts), loops 5 (13 pts), ternaries 2 (5 pts), boolean chains 3 (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 · PostFeedManager._bindModalContentEventListeners (cognitive 52) · ×1
  • PostFeedManager._bindModalContentEventListeners (cognitive 52) saicms/public/assets/client/js/feedmanager.js:208 — PostFeedManager._bindModalContentEventListeners has cognitive complexity 52 (threshold 15). Drivers by points: if/else 30 (45 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 16). Most of this is not in the body itself: 2 of the 52 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 214, a function literal at line 304, a function literal at line 294, …). 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 · SellerController.submitKyc (cognitive 51) · ×1
  • SellerController.submitKyc (cognitive 51) src/Controllers/SellerController.php:45 — SellerController.submitKyc has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 22 (25 pts), if/else 11 (17 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · McpInvoker.invoke (cognitive 51) · ×1
  • McpInvoker.invoke (cognitive 51) src/Core/McpInvoker.php:27 — McpInvoker.invoke has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 4 (9 pts), boolean chains 5, error handling 2 (4 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 · ChatUIManager._loadOpenChatboxesState (cognitive 51) · ×1
  • ChatUIManager._loadOpenChatboxesState (cognitive 51) saicms/public/assets/client/js/typeahead-chat.js:828 — ChatUIManager._loadOpenChatboxesState has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (31 pts), ternaries 2 (12 pts), boolean chains 3, loops 1 (3 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · addOrUpdateNotification (cognitive 51) · ×1
  • addOrUpdateNotification (cognitive 51) saicms/public/assets/client/js/typeahead-chat.js:3280 — addOrUpdateNotification has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 15, ternaries 5 (10 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 · ClientsController.handleSandboxPreview (cognitive 50) · ×1
  • ClientsController.handleSandboxPreview (cognitive 50) src/Controllers/ClientsController.php:294 — ClientsController.handleSandboxPreview has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 11, error handling 3 (7 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _initializeMonacoInElement (cognitive 50) · ×1
  • _initializeMonacoInElement (cognitive 50) saicms/public/assets/client/js/feedmanager.js:1822 — _initializeMonacoInElement has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (32 pts), error handling 4 (8 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 19). Most of this is not in the body itself: 12 of the 50 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 1879, 1852, 1939, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · _fetchAndDisplayComments (cognitive 50) · ×1
  • _fetchAndDisplayComments (cognitive 50) saicms/public/assets/client/js/feedmanager.js:2791 — _fetchAndDisplayComments has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 16, error handling 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 · ApiController.modelsSet (cognitive 49) · ×1
  • ApiController.modelsSet (cognitive 49) REDACTED:1487 — ApiController.modelsSet has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 11, ternaries 2 (8 pts), error handling 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 · NetworkController.getAllContainersFallback (cognitive 48) · ×1
  • NetworkController.getAllContainersFallback (cognitive 48) REDACTED:619 — NetworkController.getAllContainersFallback has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 6 (18 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.runDatabaseMigrations (cognitive 47) · ×1
  • install.runDatabaseMigrations (cognitive 47) REDACTED:619 — install.runDatabaseMigrations has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (33 pts), error handling 3 (6 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StoriesController.createStoryWithMedia (cognitive 47) · ×1
  • StoriesController.createStoryWithMedia (cognitive 47) saicms/app/Controllers/StoriesController.php:149 — StoriesController.createStoryWithMedia has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 9, ternaries 6 (8 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaygroundController.create (cognitive 47) · ×1
  • PlaygroundController.create (cognitive 47) REDACTED:906 — PlaygroundController.create has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (33 pts), error handling 2 (8 pts), boolean chains 3, ternaries 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunnelController.fetchFrpOnlineSubdomains (cognitive 47) · ×1
  • TunnelController.fetchFrpOnlineSubdomains (cognitive 47) REDACTED:1075 — TunnelController.fetchFrpOnlineSubdomains has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 3 (7 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 26). 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).filterAndSort (cognitive 47) · ×1
  • (anonymous).filterAndSort (cognitive 47) saicms/public/assets/client/js/F.js:826 — (anonymous).filterAndSort has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 11, ternaries 2, match/switch 1 (nesting depth added 16). Of this number, 41 points are the body's own statements and 6 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 · ApiController.parseFileDirective (cognitive 46) · ×1
  • ApiController.parseFileDirective (cognitive 46) REDACTED:153 — ApiController.parseFileDirective has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 4 (17 pts), boolean chains 2 (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 · PaymentController.checkStatus (cognitive 46) · ×1
  • PaymentController.checkStatus (cognitive 46) REDACTED:855 — PaymentController.checkStatus has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 3 (9 pts), match/switch 2 (7 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StoriesController.createStoryWithMedia (cognitive 46) · ×1
  • StoriesController.createStoryWithMedia (cognitive 46) src/Controllers/StoriesController.php:167 — StoriesController.createStoryWithMedia has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 9, ternaries 6 (8 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatController.getOrCreateDirectConversation (cognitive 45) · ×1
  • ChatController.getOrCreateDirectConversation (cognitive 45) saicms/app/Controllers/ChatController.php:119 — ChatController.getOrCreateDirectConversation has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 13, error handling 4 (8 pts), ternaries 2 (3 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · AdminLxcController.stats (cognitive 45) · ×1
  • AdminLxcController.stats (cognitive 45) REDACTED:646 — AdminLxcController.stats has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 8, error handling 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 · BarangayController.saveSellerZones (cognitive 45) · ×1
  • BarangayController.saveSellerZones (cognitive 45) REDACTED:715 — BarangayController.saveSellerZones has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 8 (17 pts), error handling 2 (4 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 · MallController.apiProducts (cognitive 45) · ×1
  • MallController.apiProducts (cognitive 45) REDACTED:376 — MallController.apiProducts has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 6 (9 pts), boolean chains 8, loops 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkController.getAllContainers (cognitive 45) · ×1
  • NetworkController.getAllContainers (cognitive 45) REDACTED:539 — NetworkController.getAllContainers has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 6 (18 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 · StandardMcpHost.runTool (cognitive 45) · ×1
  • StandardMcpHost.runTool (cognitive 45) src/Core/StandardMcpHost.php:367 — StandardMcpHost.runTool has cognitive complexity 45 (threshold 15). Drivers by points: if/else 7 (23 pts), boolean chains 8, error handling 3 (7 pts), loops 2 (7 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PostFeedManager._bindDelegatedEventListeners (cognitive 45) · ×1
  • PostFeedManager._bindDelegatedEventListeners (cognitive 45) saicms/public/assets/client/js/feedmanager.js:1678 — PostFeedManager._bindDelegatedEventListeners has cognitive complexity 45 (threshold 15). Drivers by points: if/else 29 (41 pts), boolean chains 4 (nesting depth added 12). 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 1690, 1782, 1772, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · verse.getVerse (cognitive 44) · ×1
  • verse.getVerse (cognitive 44) src/Views/bible/verse.php:553 — verse.getVerse has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (11 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 26). 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 · _handleModalCommentSubmit (cognitive 44) · ×1
  • _handleModalCommentSubmit (cognitive 44) saicms/public/assets/client/js/headmanager.js:585 — _handleModalCommentSubmit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 11, ternaries 2 (6 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditorController.paste (cognitive 43) · ×1
  • EditorController.paste (cognitive 43) REDACTED:581 — EditorController.paste has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 13 (16 pts), loops 2 (5 pts), boolean chains 4, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaygroundController.rename (cognitive 43) · ×1
  • PlaygroundController.rename (cognitive 43) REDACTED:1009 — PlaygroundController.rename has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (27 pts), error handling 2 (8 pts), boolean chains 5, ternaries 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SandboxManager.execInSandbox (cognitive 43) · ×1
  • SandboxManager.execInSandbox (cognitive 43) src/Helpers/SandboxManager.php:95 — SandboxManager.execInSandbox has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 4 (6 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _handleIncomingWebSocketMessage (cognitive 43) · ×1
  • _handleIncomingWebSocketMessage (cognitive 43) saicms/public/assets/client/js/typeahead-chat.js:1065 — _handleIncomingWebSocketMessage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 10, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 16). Of this number, 37 points are the body's own statements and 6 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 · AdminController.dashboardLogs (cognitive 42) · ×1
  • AdminController.dashboardLogs (cognitive 42) src/Controllers/AdminController.php:57 — AdminController.dashboardLogs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 3 (10 pts), boolean chains 4, ternaries 3 (4 pts), error handling 2 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AudioController.stt (cognitive 42) · ×1
  • AudioController.stt (cognitive 42) REDACTED:190 — AudioController.stt has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 8, ternaries 4 (7 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 · SandboxController.vnc (cognitive 42) · ×1
  • SandboxController.vnc (cognitive 42) src/Controllers/SandboxController.php:1109 — SandboxController.vnc has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 5, loops 3 (4 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extend (cognitive 42) · ×1
  • extend (cognitive 42) saicms/public/assets/client/js/F.js:247 — extend has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 2 (12 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ajax · ×1
  • ajax::onreadystatechange (cognitive 42) REDACTED:709 — ajax::onreadystatechange has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 5, error handling 1 (4 pts), ternaries 1 (3 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClientsController.handleClientProxy (cognitive 41) · ×1
  • ClientsController.handleClientProxy (cognitive 41) src/Controllers/ClientsController.php:68 — ClientsController.handleClientProxy has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 4, ternaries 3 (4 pts), error handling 2 (3 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openPostModal (cognitive 41) · ×1
  • openPostModal (cognitive 41) saicms/public/assets/client/js/smartfed.js:322 — openPostModal has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 7, ternaries 1 (5 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AudioController.tts (cognitive 40) · ×1
  • AudioController.tts (cognitive 40) REDACTED:26 — AudioController.tts has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 11 (12 pts), boolean chains 9, error handling 2, loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · HostingController.tunnelsApi (cognitive 40) · ×1
  • HostingController.tunnelsApi (cognitive 40) REDACTED:1359 — HostingController.tunnelsApi has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 9 (11 pts), boolean chains 8, loops 4 (7 pts), 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 · McpController.discover (cognitive 40) · ×1
  • McpController.discover (cognitive 40) REDACTED:263 — McpController.discover has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 6, loops 3 (5 pts), error handling 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 · PlaygroundController.delete (cognitive 40) · ×1
  • PlaygroundController.delete (cognitive 40) REDACTED:1107 — PlaygroundController.delete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (22 pts), error handling 3 (10 pts), loops 2 (5 pts), boolean chains 3 (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 · TunnelController.startTunnelClient (cognitive 40) · ×1
  • TunnelController.startTunnelClient (cognitive 40) REDACTED:587 — TunnelController.startTunnelClient has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (25 pts), ternaries 3 (7 pts), boolean chains 5, 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 · TunnelController.generateAccessKey (cognitive 40) · ×1
  • TunnelController.generateAccessKey (cognitive 40) REDACTED:1395 — TunnelController.generateAccessKey has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (17 pts), error handling 7 (11 pts), boolean chains 6, ternaries 5 (6 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ToolCallParser.extract (cognitive 40) · ×1
  • ToolCallParser.extract (cognitive 40) src/Core/LLM/ToolCallParser.php:21 — ToolCallParser.extract has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 14, ternaries 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatStreamHandler.buildSystemPrompt (cognitive 40) · ×1
  • ChatStreamHandler.buildSystemPrompt (cognitive 40) src/Handlers/ChatStreamHandler.php:2043 — ChatStreamHandler.buildSystemPrompt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (24 pts), error handling 3 (9 pts), boolean chains 7 (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 · AcademyController.cardInit (cognitive 39) · ×1
  • AcademyController.cardInit (cognitive 39) REDACTED:1732 — AcademyController.cardInit has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 9, ternaries 3 (5 pts), 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 · CsrfMiddleware.handle (cognitive 39) · ×1
  • CsrfMiddleware.handle (cognitive 39) src/Middleware/CsrfMiddleware.php:141 — CsrfMiddleware.handle has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (31 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 21). 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 · NotificationManager._bindModalContentEventListeners (cognitive 39) · ×1
  • NotificationManager._bindModalContentEventListeners (cognitive 39) saicms/public/assets/client/js/notifications.js:901 — NotificationManager._bindModalContentEventListeners has cognitive complexity 39 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 5 (nesting depth added 10). Most of this is not in the body itself: 2 of the 39 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 906, a function literal at line 958, a function literal at line 949, …). 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 · ChatController.sendMessage (cognitive 38) · ×1
  • ChatController.sendMessage (cognitive 38) saicms/app/Controllers/ChatController.php:738 — ChatController.sendMessage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 8, error handling 4 (8 pts), ternaries 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HostingController.listDomains (cognitive 38) · ×1
  • HostingController.listDomains (cognitive 38) REDACTED:2081 — HostingController.listDomains has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (13 pts), boolean chains 6, ternaries 2 (4 pts), error handling 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 · SocialController.fetchCompletePostData (cognitive 38) · ×1
  • SocialController.fetchCompletePostData (cognitive 38) src/Controllers/SocialController.php:211 — SocialController.fetchCompletePostData has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 5, error handling 3 (5 pts), ternaries 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 · TierController.createPaypalPlan (cognitive 38) · ×1
  • TierController.createPaypalPlan (cognitive 38) REDACTED:486 — TierController.createPaypalPlan has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 10 (15 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ChatStreamHandler.truncateMessagesForProvider (cognitive 38) · ×1
  • ChatStreamHandler.truncateMessagesForProvider (cognitive 38) src/Handlers/ChatStreamHandler.php:461 — ChatStreamHandler.truncateMessagesForProvider has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 5 (7 pts), boolean chains 3, 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 · PostFeedManager._updatePostElementUI (cognitive 38) · ×1
  • PostFeedManager._updatePostElementUI (cognitive 38) saicms/public/assets/client/js/feedmanager.js:2463 — PostFeedManager._updatePostElementUI has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _populatePostViewModal (cognitive 38) · ×1
  • _populatePostViewModal (cognitive 38) saicms/public/assets/client/js/notifications.js:778 — _populatePostViewModal has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 17, ternaries 11 (13 pts), if/else 6 (8 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · GroupController.post (cognitive 37) · ×1
  • GroupController.post (cognitive 37) saicms/app/Controllers/GroupController.php:51 — GroupController.post has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 13, ternaries 3 (5 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · HomeController.post (cognitive 37) · ×1
  • HomeController.post (cognitive 37) saicms/app/Controllers/HomeController.php:30 — HomeController.post has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 13, ternaries 3 (5 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SocialController.post (cognitive 37) · ×1
  • SocialController.post (cognitive 37) saicms/app/Controllers/SocialController.php:26 — SocialController.post has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 13, ternaries 3 (5 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BarangayController.detect (cognitive 37) · ×1
  • BarangayController.detect (cognitive 37) REDACTED:36 — BarangayController.detect has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 4 (8 pts), boolean chains 7, error handling 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 · AbstractLLMProvider.postStream (cognitive 37) · ×1
  • AbstractLLMProvider.postStream (cognitive 37) src/Core/LLM/AbstractLLMProvider.php:113 — AbstractLLMProvider.postStream has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 2 (5 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stealth-browser.generateRaphaelImage (cognitive 37) · ×1
  • stealth-browser.generateRaphaelImage (cognitive 37) tools/lightpanda-mcp/scripts/stealth-browser.js:513 — stealth-browser.generateRaphaelImage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 7, loops 3 (5 pts), error handling 2 (4 pts) (nesting depth added 13). None of this is in the body itself: all 37 points belong to 7 function literals inside it that branch (lines 517, 624, 534, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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) (cognitive 37) · ×1
  • (anonymous) (cognitive 37) saicms/public/assets/client/js/dashboard.js:240 — (anonymous) has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 16 (32 pts), if/else 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 17). Most of this is not in the body itself: 8 of the 37 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 317, 349, 342, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · McpController.chat (cognitive 36) · ×1
  • McpController.chat (cognitive 36) REDACTED:123 — McpController.chat has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 7, ternaries 3 (4 pts), error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatibleProvider.normalizeContentPayloadToText (cognitive 36) · ×1
  • OpenAICompatibleProvider.normalizeContentPayloadToText (cognitive 36) src/Core/LLM/Providers/OpenAICompatibleProvider.php:933 — OpenAICompatibleProvider.normalizeContentPayloadToText has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientSandboxHelper.getOrCreateSandboxId (cognitive 36) · ×1
  • ClientSandboxHelper.getOrCreateSandboxId (cognitive 36) src/Helpers/ClientSandboxHelper.php:42 — ClientSandboxHelper.getOrCreateSandboxId has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 3 (5 pts), boolean chains 4, error handling 1 (2 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 · install.createAdminAccountStep (cognitive 35) · ×1
  • install.createAdminAccountStep (cognitive 35) REDACTED:924 — install.createAdminAccountStep has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (23 pts), ternaries 3 (6 pts), error handling 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AcademyController.movers (cognitive 35) · ×1
  • AcademyController.movers (cognitive 35) REDACTED:580 — AcademyController.movers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (8 pts), boolean chains 4, error handling 1, ternaries 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 · HostingController.getAvailableLxcContainers (cognitive 35) · ×1
  • HostingController.getAvailableLxcContainers (cognitive 35) REDACTED:2190 — HostingController.getAvailableLxcContainers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, error handling 1 (4 pts), loops 2 (4 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 · SocialController.feed (cognitive 35) · ×1
  • SocialController.feed (cognitive 35) src/Controllers/SocialController.php:368 — SocialController.feed has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 2 (5 pts), error handling 3 (4 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunnelController.verifyTunnel (cognitive 35) · ×1
  • TunnelController.verifyTunnel (cognitive 35) REDACTED:849 — TunnelController.verifyTunnel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 6, ternaries 3 (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 · OpenAICompatibleProvider.ensurePayloadWithinLimit (cognitive 35) · ×1
  • OpenAICompatibleProvider.ensurePayloadWithinLimit (cognitive 35) src/Core/LLM/Providers/OpenAICompatibleProvider.php:285 — OpenAICompatibleProvider.ensurePayloadWithinLimit has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (3 pts), ternaries 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 · ChatStreamHandler.handleRepoDescription (cognitive 35) · ×1
  • ChatStreamHandler.handleRepoDescription (cognitive 35) src/Handlers/ChatStreamHandler.php:343 — ChatStreamHandler.handleRepoDescription has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 7, boolean chains 4, loops 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 · Previews.create (cognitive 35) · ×1
  • Previews.create (cognitive 35) src/Sites/Previews.php:34 — Previews.create has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 8 (12 pts), boolean chains 3 (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 · (anonymous).filterClientSideAndTriggerServerSearch (cognitive 35) · ×1
  • (anonymous).filterClientSideAndTriggerServerSearch (cognitive 35) saicms/public/assets/client/js/F.js:1002 — (anonymous).filterClientSideAndTriggerServerSearch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 9, ternaries 2 (3 pts) (nesting depth added 11). Of this number, 30 points are the body's own statements and 5 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 · bible (cognitive 35) · ×1
  • bible (cognitive 35) REDACTED:364 — bible has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 9, loops 3, error handling 2, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 15 function items inside it that branch (tagVersesInElement::acceptNode, showPopupForVerse, a function literal at line 499, …). 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 · renderStoryInViewer (cognitive 35) · ×1
  • renderStoryInViewer (cognitive 35) saicms/public/assets/client/js/stories.js:335 — renderStoryInViewer has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, if/else 8 (12 pts), ternaries 2 (4 pts), error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startVideoCall · ×1
  • startVideoCall::ontrack (cognitive 35) saicms/public/assets/client/js/typeahead-chat.js:1854 — startVideoCall::ontrack has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 9, 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 · BarangayController.nearby (cognitive 34) · ×1
  • BarangayController.nearby (cognitive 34) REDACTED:1142 — BarangayController.nearby has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 8, loops 2 (4 pts), ternaries 2, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SandboxController.openwebuiStatus (cognitive 34) · ×1
  • SandboxController.openwebuiStatus (cognitive 34) src/Controllers/SandboxController.php:1367 — SandboxController.openwebuiStatus has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 8 (12 pts), error handling 2 (4 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 · OpenAICompatibleProvider.parseResponse (cognitive 34) · ×1
  • OpenAICompatibleProvider.parseResponse (cognitive 34) src/Core/LLM/Providers/OpenAICompatibleProvider.php:851 — OpenAICompatibleProvider.parseResponse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 2 (8 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · McpUnifier.discoverHandlersViaAttributes (cognitive 34) · ×1
  • McpUnifier.discoverHandlersViaAttributes (cognitive 34) src/Core/McpUnifier.php:43 — McpUnifier.discoverHandlersViaAttributes has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (6 pts), error handling 2 (4 pts), ternaries 2 (3 pts), boolean chains 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 · LightpandaSearchHandler.getReasoningLLM (cognitive 34) · ×1
  • LightpandaSearchHandler.getReasoningLLM (cognitive 34) src/Handlers/LightpandaSearchHandler.php:1117 — LightpandaSearchHandler.getReasoningLLM has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 10 (15 pts), boolean chains 1, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LxdSandboxManager.sandboxToIp (cognitive 34) · ×1
  • LxdSandboxManager.sandboxToIp (cognitive 34) src/Helpers/LxdSandboxManager.php:185 — LxdSandboxManager.sandboxToIp has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 6, ternaries 3 (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 · GtbStrategy.reconcileLive (cognitive 34) · ×1
  • GtbStrategy.reconcileLive (cognitive 34) src/Services/GtbStrategy.php:588 — GtbStrategy.reconcileLive has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 6 (12 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 · turnstile_bypass.analyze_page (cognitive 34) · ×1
  • turnstile_bypass.analyze_page (cognitive 34) tools/lightpanda-mcp/scripts/turnstile_bypass.py:53 — turnstile_bypass.analyze_page has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (7 pts), boolean chains 5, error handling 3 (5 pts), ternaries 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProfileApp._bindEvents (cognitive 34) · ×1
  • ProfileApp._bindEvents (cognitive 34) saicms/public/assets/client/js/profile.js:132 — ProfileApp._bindEvents has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (34 pts) (nesting depth added 11). 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 into named stages: move each independent 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 · _loadMoreNotifications (cognitive 34) · ×1
  • _loadMoreNotifications (cognitive 34) saicms/public/assets/client/js/notifications.js:477 — _loadMoreNotifications has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 11, error handling 1 (nesting depth added 7). 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 · handleVideoOffer · ×1
  • handleVideoOffer::(anonymous)::ontrack (cognitive 34) saicms/public/assets/client/js/typeahead-chat.js:2087 — handleVideoOffer::(anonymous)::ontrack has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 9, error handling 1 (2 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiController.extractFileContentFromText (cognitive 33) · ×1
  • ApiController.extractFileContentFromText (cognitive 33) REDACTED:217 — ApiController.extractFileContentFromText has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 5, error handling 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MessengerController.getConversations (cognitive 33) · ×1
  • MessengerController.getConversations (cognitive 33) REDACTED:125 — MessengerController.getConversations has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 5 (18 pts), if/else 6 (12 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkController.getContainerInfo (cognitive 33) · ×1
  • NetworkController.getContainerInfo (cognitive 33) REDACTED:711 — NetworkController.getContainerInfo has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (12 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 · SettingsController.save (cognitive 33) · ×1
  • SettingsController.save (cognitive 33) src/Controllers/SettingsController.php:70 — SettingsController.save has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 8, 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 · constructor (cognitive 33) · ×1
  • constructor (cognitive 33) saicms/public/assets/client/js/typeahead-chat.js:249 — constructor has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 6, error handling 1 (nesting depth added 11). Most of this is not in the body itself: 12 of the 33 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 343, 350, 337, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · install.createConfigurationFiles (cognitive 32) · ×1
  • install.createConfigurationFiles (cognitive 32) REDACTED:171 — install.createConfigurationFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (7 pts), boolean chains 6, 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 · ActivitiesController.updatePost (cognitive 32) · ×1
  • ActivitiesController.updatePost (cognitive 32) REDACTED:431 — ActivitiesController.updatePost has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 4 (12 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TierController.update (cognitive 32) · ×1
  • TierController.update (cognitive 32) REDACTED:229 — TierController.update has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 15 (17 pts), if/else 10 (13 pts), boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TunnelController.proxyToTargetHost (cognitive 32) · ×1
  • TunnelController.proxyToTargetHost (cognitive 32) REDACTED:100 — TunnelController.proxyToTargetHost has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 8 (11 pts), boolean chains 3, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedMcpClient.sanitizeToolResult (cognitive 32) · ×1
  • UnifiedMcpClient.sanitizeToolResult (cognitive 32) src/Core/LLM/UnifiedMcpClient.php:603 — UnifiedMcpClient.sanitizeToolResult has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevTools.walkFiles (cognitive 32) · ×1
  • DevTools.walkFiles (cognitive 32) src/Handlers/DevTools.php:480 — DevTools.walkFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · turnstile_bypass.generate_raphael_image (cognitive 32) · ×1
  • turnstile_bypass.generate_raphael_image (cognitive 32) tools/lightpanda-mcp/scripts/turnstile_bypass.py:171 — turnstile_bypass.generate_raphael_image has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (6 pts), error handling 3 (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 · ChatUIManager.handleVideoOffer (cognitive 32) · ×1
  • ChatUIManager.handleVideoOffer (cognitive 32) saicms/public/assets/client/js/typeahead-chat.js:2012 — ChatUIManager.handleVideoOffer has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, if/else 9 (12 pts), ternaries 3 (6 pts), error handling 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 14 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sandbox-proxy.sandboxToIp (cognitive 32) · ×1
  • sandbox-proxy.sandboxToIp (cognitive 32) REDACTED:163 — sandbox-proxy.sandboxToIp has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (27 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 · ajax (cognitive 32) · ×1
  • ajax (cognitive 32) REDACTED:660 — ajax has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30 (57 pts), boolean chains 9, ternaries 3 (7 pts), error handling 1 (4 pts), loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geo_import.importCountry (cognitive 31) · ×1
  • geo_import.importCountry (cognitive 31) bin/geo_import.php:219 — geo_import.importCountry has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProfileController.post (cognitive 31) · ×1
  • ProfileController.post (cognitive 31) saicms/app/Controllers/ProfileController.php:186 — ProfileController.post has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13, boolean chains 12, ternaries 3 (5 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AcademyController.adminSave (cognitive 31) · ×1
  • AcademyController.adminSave (cognitive 31) REDACTED:526 — AcademyController.adminSave has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 3 (6 pts), loops 1 (2 pts), boolean chains 1, error handling 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 · ActivitiesController.updatePost (cognitive 31) · ×1
  • ActivitiesController.updatePost (cognitive 31) REDACTED:466 — ActivitiesController.updatePost has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 4 (12 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioController.outputSttResponse (cognitive 31) · ×1
  • AudioController.outputSttResponse (cognitive 31) REDACTED:595 — AudioController.outputSttResponse has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 3 (11 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _renderPostForModal (cognitive 31) · ×1
  • _renderPostForModal (cognitive 31) saicms/public/assets/client/js/headmanager.js:368 — _renderPostForModal has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 10, if/else 8 (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 · _bindEvents (cognitive 31) · ×1
  • _bindEvents (cognitive 31) saicms/public/assets/client/js/typeahead-chat.js:65 — _bindEvents has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 5 (nesting depth added 9). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 71, 86, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · handleNewMessage (cognitive 31) · ×1
  • handleNewMessage (cognitive 31) saicms/public/assets/client/js/typeahead-chat.js:3215 — handleNewMessage has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 19, if/else 11, 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 · ActivitiesController.editPostById (cognitive 30) · ×1
  • ActivitiesController.editPostById (cognitive 30) REDACTED:829 — ActivitiesController.editPostById has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 6, ternaries 2 (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, 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 · ChatController.notifyWebSocketServerOfNewMessage (cognitive 30) · ×1
  • ChatController.notifyWebSocketServerOfNewMessage (cognitive 30) saicms/app/Controllers/ChatController.php:594 — ChatController.notifyWebSocketServerOfNewMessage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 4 (8 pts), boolean chains 4, error handling 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 · CodeController.codesave (cognitive 30) · ×1
  • CodeController.codesave (cognitive 30) saicms/app/Controllers/CodeController.php:101 — CodeController.codesave has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 4, ternaries 2 (3 pts), error handling 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AudioController.handlePythonStt (cognitive 30) · ×1
  • AudioController.handlePythonStt (cognitive 30) REDACTED:416 — AudioController.handlePythonStt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 5 (8 pts), boolean chains 7, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LiveController.runDatabaseMigrations (cognitive 30) · ×1
  • LiveController.runDatabaseMigrations (cognitive 30) src/Controllers/LiveController.php:212 — LiveController.runDatabaseMigrations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 4 (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 · UnifiedMcpClient.__construct (cognitive 30) · ×1
  • UnifiedMcpClient.__construct (cognitive 30) src/Core/LLM/UnifiedMcpClient.php:51 — UnifiedMcpClient.__construct has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TransactionHelper.getClientIp (cognitive 30) · ×1
  • TransactionHelper.getClientIp (cognitive 30) src/Helpers/TransactionHelper.php:80 — TransactionHelper.getClientIp has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (5 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 · Product.list (cognitive 30) · ×1
  • Product.list (cognitive 30) src/Models/Product.php:132 — Product.list has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), ternaries 3, boolean chains 1, 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 · Insights.weekly (cognitive 30) · ×1
  • Insights.weekly (cognitive 30) src/Sites/Insights.php:85 — Insights.weekly has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 4 (9 pts), boolean chains 1, 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 · Renderer.clean (cognitive 30) · ×1
  • Renderer.clean (cognitive 30) src/Sites/Renderer.php:23 — Renderer.clean has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 5 (8 pts), boolean chains 7, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · websearch.search (cognitive 30) · ×1
  • websearch.search (cognitive 30) REDACTED:311 — websearch.search has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 7, error handling 1 (3 pts) (nesting depth added 11). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 327, 344, 323, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · _handleFriendRequestAction (cognitive 30) · ×1
  • _handleFriendRequestAction (cognitive 30) saicms/public/assets/client/js/notifications.js:665 — _handleFriendRequestAction has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, ternaries 5 (7 pts), error handling 1 (nesting depth added 7). Of this number, 25 points are the body's own statements and 5 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 · StoriesController.deleteStory (cognitive 29) · ×1
  • StoriesController.deleteStory (cognitive 29) saicms/app/Controllers/StoriesController.php:271 — StoriesController.deleteStory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 3, 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 · AcademyController.qrphFinalize (cognitive 29) · ×1
  • AcademyController.qrphFinalize (cognitive 29) REDACTED:1852 — AcademyController.qrphFinalize has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActivitiesController.editPostById (cognitive 29) · ×1
  • ActivitiesController.editPostById (cognitive 29) REDACTED:904 — ActivitiesController.editPostById has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 6, ternaries 2 (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, 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 · ApiController.fetchOpenAiCompatibleModels (cognitive 29) · ×1
  • ApiController.fetchOpenAiCompatibleModels (cognitive 29) REDACTED:777 — ApiController.fetchOpenAiCompatibleModels has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, ternaries 3 (6 pts), error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BarangayController.set (cognitive 29) · ×1
  • BarangayController.set (cognitive 29) REDACTED:577 — BarangayController.set has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 2 (5 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PaymentController.cryptoPayments (cognitive 29) · ×1
  • PaymentController.cryptoPayments (cognitive 29) REDACTED:618 — PaymentController.cryptoPayments has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 2, error handling 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 · UploadController.createPostWithMedia (cognitive 29) · ×1
  • UploadController.createPostWithMedia (cognitive 29) src/Controllers/UploadController.php:236 — UploadController.createPostWithMedia has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 5, error handling 3, 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 · UserController.capturePaymentAction (cognitive 29) · ×1
  • UserController.capturePaymentAction (cognitive 29) src/Controllers/UserController.php:1076 — UserController.capturePaymentAction has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 6 (12 pts), boolean chains 4, 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 · UserController.loginAction (cognitive 29) · ×1
  • UserController.loginAction (cognitive 29) src/Controllers/UserController.php:1705 — UserController.loginAction has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 7, error handling 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LxdSandboxManager.queryContainerIp (cognitive 29) · ×1
  • LxdSandboxManager.queryContainerIp (cognitive 29) src/Helpers/LxdSandboxManager.php:714 — LxdSandboxManager.queryContainerIp has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (9 pts), boolean chains 2, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MallCommerceService.estimateCheckoutFees (cognitive 29) · ×1
  • MallCommerceService.estimateCheckoutFees (cognitive 29) src/Services/MallCommerceService.php:1273 — MallCommerceService.estimateCheckoutFees has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 5 (7 pts), boolean chains 3, loops 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 · SmartFedApp._initDropdowns (cognitive 29) · ×1
  • SmartFedApp._initDropdowns (cognitive 29) saicms/public/assets/client/js/smartfed.js:130 — SmartFedApp._initDropdowns has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (setupDropdownToggle, a function literal at line 136, a function literal at line 139, …). 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 · FriendsController.mutualFriendsAPI (cognitive 28) · ×1
  • FriendsController.mutualFriendsAPI (cognitive 28) REDACTED:1315 — FriendsController.mutualFriendsAPI has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (6 pts), ternaries 3, 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 · AcademyController.runAnalysis (cognitive 28) · ×1
  • AcademyController.runAnalysis (cognitive 28) REDACTED:317 — AcademyController.runAnalysis has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 6 (8 pts), loops 1 (3 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 · ActivitiesController.addComment (cognitive 28) · ×1
  • ActivitiesController.addComment (cognitive 28) REDACTED:335 — ActivitiesController.addComment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 5 (10 pts), boolean chains 4, 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 · AudioController.transcribe (cognitive 28) · ×1
  • AudioController.transcribe (cognitive 28) REDACTED:315 — AudioController.transcribe has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5, 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 · HostingController.tunnelKeysBulkReactivate (cognitive 28) · ×1
  • HostingController.tunnelKeysBulkReactivate (cognitive 28) REDACTED:1055 — HostingController.tunnelKeysBulkReactivate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, ternaries 2 (4 pts), error handling 2 (3 pts), loops 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 · StoriesController.deleteStory (cognitive 28) · ×1
  • StoriesController.deleteStory (cognitive 28) src/Controllers/StoriesController.php:299 — StoriesController.deleteStory has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, 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 · ProviderRegistry.fetchModelsFromApi (cognitive 28) · ×1
  • ProviderRegistry.fetchModelsFromApi (cognitive 28) src/Core/LLM/ProviderRegistry.php:513 — ProviderRegistry.fetchModelsFromApi has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedMcpClient.chatStream (cognitive 28) · ×1
  • UnifiedMcpClient.chatStream (cognitive 28) src/Core/LLM/UnifiedMcpClient.php:1179 — UnifiedMcpClient.chatStream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (10 pts), loops 3 (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 · LightpandaSearchHandler.fetchDirectUrls (cognitive 28) · ×1
  • LightpandaSearchHandler.fetchDirectUrls (cognitive 28) src/Handlers/LightpandaSearchHandler.php:1024 — LightpandaSearchHandler.fetchDirectUrls has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 3 (8 pts), boolean chains 4, loops 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 · UnifiedSandbox.deleteCompletely (cognitive 28) · ×1
  • UnifiedSandbox.deleteCompletely (cognitive 28) src/Helpers/UnifiedSandbox.php:609 — UnifiedSandbox.deleteCompletely has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 2 (6 pts), 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 · Subscriptions.confirm (cognitive 28) · ×1
  • Subscriptions.confirm (cognitive 28) src/Sites/Subscriptions.php:157 — Subscriptions.confirm has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (9 pts), if/else 5 (8 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 · _createDynamicStoryElement (cognitive 28) · ×1
  • _createDynamicStoryElement (cognitive 28) saicms/public/assets/client/js/stories.js:569 — _createDynamicStoryElement has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 17, ternaries 4 (6 pts), if/else 3 (4 pts), match/switch 1 (nesting depth added 3). Of this number, 26 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · _updateMinimizedBadge (cognitive 28) · ×1
  • _updateMinimizedBadge (cognitive 28) saicms/public/assets/client/js/typeahead-chat.js:1116 — _updateMinimizedBadge has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 2 (6 pts), boolean chains 4 (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 · FriendsController.fetchUserAcceptedFriendsInternal (cognitive 27) · ×1
  • FriendsController.fetchUserAcceptedFriendsInternal (cognitive 27) REDACTED:255 — FriendsController.fetchUserAcceptedFriendsInternal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrpController.setSubdomainKey (cognitive 27) · ×1
  • FrpController.setSubdomainKey (cognitive 27) REDACTED:541 — FrpController.setSubdomainKey has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 4, ternaries 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · MallController.marketplace (cognitive 27) · ×1
  • MallController.marketplace (cognitive 27) REDACTED:72 — MallController.marketplace has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 7 (8 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · UserController.dashboardAction (cognitive 27) · ×1
  • UserController.dashboardAction (cognitive 27) src/Controllers/UserController.php:122 — UserController.dashboardAction has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 4 (5 pts), error handling 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · UnifiedMcpClient.chat (cognitive 27) · ×1
  • UnifiedMcpClient.chat (cognitive 27) src/Core/LLM/UnifiedMcpClient.php:1038 — UnifiedMcpClient.chat has cognitive complexity 27 (threshold 15). Drivers by points: error handling 5 (14 pts), if/else 4 (7 pts), loops 3 (5 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 · Router.dispatch (cognitive 27) · ×1
  • Router.dispatch (cognitive 27) REDACTED:141 — Router.dispatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ClientSandboxHelper.getSandboxIdIfExists (cognitive 27) · ×1
  • ClientSandboxHelper.getSandboxIdIfExists (cognitive 27) src/Helpers/ClientSandboxHelper.php:150 — ClientSandboxHelper.getSandboxIdIfExists has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, error handling 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MallCommerceService.recordStorefrontImpression (cognitive 27) · ×1
  • MallCommerceService.recordStorefrontImpression (cognitive 27) src/Services/MallCommerceService.php:808 — MallCommerceService.recordStorefrontImpression has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 6 (10 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · UsdtBep20Verifier.verify (cognitive 27) · ×1
  • UsdtBep20Verifier.verify (cognitive 27) src/Services/UsdtBep20Verifier.php:80 — UsdtBep20Verifier.verify has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · REDACTED.loadExistingEnvValues (cognitive 27) · ×1
  • REDACTED.loadExistingEnvValues (cognitive 27) REDACTED:1404 — REDACTED.loadExistingEnvValues has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (26 pts), 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 · PostFeedManager._updatePostCommentCountsUI (cognitive 27) · ×1
  • PostFeedManager._updatePostCommentCountsUI (cognitive 27) saicms/public/assets/client/js/feedmanager.js:3003 — PostFeedManager._updatePostCommentCountsUI has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, 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 · HeaderManager._handleModalViewComments (cognitive 27) · ×1
  • HeaderManager._handleModalViewComments (cognitive 27) saicms/public/assets/client/js/headmanager.js:712 — HeaderManager._handleModalViewComments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8 (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 · _fetchAndDisplayComments (cognitive 27) · ×1
  • _fetchAndDisplayComments (cognitive 27) saicms/public/assets/client/js/notifications.js:1261 — _fetchAndDisplayComments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _fetchUsers (cognitive 27) · ×1
  • _fetchUsers (cognitive 27) saicms/public/assets/client/js/typeahead-chat.js:150 — _fetchUsers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiController.attemptWriteFile (cognitive 26) · ×1
  • ApiController.attemptWriteFile (cognitive 26) REDACTED:67 — ApiController.attemptWriteFile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 8, ternaries 3 (4 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ApiController.parseTasksFromText (cognitive 26) · ×1
  • ApiController.parseTasksFromText (cognitive 26) REDACTED:261 — ApiController.parseTasksFromText has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditorController.toggleSandbox (cognitive 26) · ×1
  • EditorController.toggleSandbox (cognitive 26) REDACTED:70 — EditorController.toggleSandbox has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, error handling 4 (6 pts), ternaries 3 (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 · GtbController.saveSettings (cognitive 26) · ×1
  • GtbController.saveSettings (cognitive 26) REDACTED:215 — GtbController.saveSettings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, ternaries 8, boolean chains 4, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HostingController.syncZoneToPowerDNS (cognitive 26) · ×1
  • HostingController.syncZoneToPowerDNS (cognitive 26) REDACTED:2993 — HostingController.syncZoneToPowerDNS has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 1, 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 · TunnelController.startSshTunnel (cognitive 26) · ×1
  • TunnelController.startSshTunnel (cognitive 26) REDACTED:466 — TunnelController.startSshTunnel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OllamaProvider.chatStream (cognitive 26) · ×1
  • OllamaProvider.chatStream (cognitive 26) src/Core/LLM/Providers/OllamaProvider.php:255 — OllamaProvider.chatStream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (5 pts), loops 2 (4 pts), boolean chains 1, 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 · RateLimitService.canMakeTtsRequest (cognitive 26) · ×1
  • RateLimitService.canMakeTtsRequest (cognitive 26) src/Core/RateLimitService.php:504 — RateLimitService.canMakeTtsRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 6 (7 pts), error handling 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ChatStreamHandler.handleOllamaRequest (cognitive 26) · ×1
  • ChatStreamHandler.handleOllamaRequest (cognitive 26) src/Handlers/ChatStreamHandler.php:717 — ChatStreamHandler.handleOllamaRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 1 (3 pts), ternaries 3, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageGenHandler.normalizeImageResult (cognitive 26) · ×1
  • ImageGenHandler.normalizeImageResult (cognitive 26) src/Handlers/ImageGenHandler.php:265 — ImageGenHandler.normalizeImageResult has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 8 (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 · FixedPtyServer.onOpen (cognitive 26) · ×1
  • FixedPtyServer.onOpen (cognitive 26) src/Playground/FixedPtyServer.php:17 — FixedPtyServer.onOpen has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 4 (6 pts), ternaries 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GainerHunter.entryCandidate (cognitive 26) · ×1
  • GainerHunter.entryCandidate (cognitive 26) src/Services/Strategies/GainerHunter.php:63 — GainerHunter.entryCandidate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 4 (7 pts), boolean chains 2, loops 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 · Pipeline.run (cognitive 26) · ×1
  • Pipeline.run (cognitive 26) src/Sites/Vision/Pipeline.php:31 — Pipeline.run has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 5 (11 pts), boolean chains 2 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PostFeedManager._handleEditComment (cognitive 26) · ×1
  • PostFeedManager._handleEditComment (cognitive 26) saicms/public/assets/client/js/feedmanager.js:1565 — PostFeedManager._handleEditComment has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 1616, closeEditUI). 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 · PostFeedManager.stopAIGeneration (cognitive 26) · ×1
  • PostFeedManager.stopAIGeneration (cognitive 26) saicms/public/assets/client/js/feedmanager.js:2133 — PostFeedManager.stopAIGeneration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 7 (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 · setCurrentUserDetails (cognitive 26) · ×1
  • setCurrentUserDetails (cognitive 26) saicms/public/assets/client/js/typeahead-chat.js:904 — setCurrentUserDetails has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 10 (11 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _connectWebSocket · ×1
  • _connectWebSocket::onmessage (cognitive 26) saicms/public/assets/client/js/typeahead-chat.js:959 — _connectWebSocket::onmessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, error handling 1, match/switch 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 · ChatMessageHandler._saveAndBroadcastSystemMessage (cognitive 25) · ×1
  • ChatMessageHandler._saveAndBroadcastSystemMessage (cognitive 25) saicms/app/WebSocket/ChatMessageHandler.php:909 — ChatMessageHandler._saveAndBroadcastSystemMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, error handling 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActivitiesController.editCommentById (cognitive 25) · ×1
  • ActivitiesController.editCommentById (cognitive 25) REDACTED:760 — ActivitiesController.editCommentById has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 7, ternaries 1 (3 pts), error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · EditorController.create (cognitive 25) · ×1
  • EditorController.create (cognitive 25) REDACTED:346 — EditorController.create has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MallController.upload (cognitive 25) · ×1
  • MallController.upload (cognitive 25) REDACTED:157 — MallController.upload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 6 (10 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MallController.productPage (cognitive 25) · ×1
  • MallController.productPage (cognitive 25) REDACTED:481 — MallController.productPage has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 14, if/else 6 (7 pts), boolean chains 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MallDeliveryController.getRecentShipments (cognitive 25) · ×1
  • MallDeliveryController.getRecentShipments (cognitive 25) src/Controllers/MallDeliveryController.php:656 — MallDeliveryController.getRecentShipments has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 2 (4 pts), error handling 1, 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 · MessengerController.createGroupConversation (cognitive 25) · ×1
  • MessengerController.createGroupConversation (cognitive 25) REDACTED:533 — MessengerController.createGroupConversation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5 (9 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SandboxController.status (cognitive 25) · ×1
  • SandboxController.status (cognitive 25) src/Controllers/SandboxController.php:144 — SandboxController.status has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 6, error handling 2 (4 pts), boolean chains 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, 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 · TierController.deletePaypalPlan (cognitive 25) · ×1
  • TierController.deletePaypalPlan (cognitive 25) REDACTED:367 — TierController.deletePaypalPlan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5 (9 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightpandaSearchHandler.executeInterleavedSearch (cognitive 25) · ×1
  • LightpandaSearchHandler.executeInterleavedSearch (cognitive 25) src/Handlers/LightpandaSearchHandler.php:756 — LightpandaSearchHandler.executeInterleavedSearch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LxdSandboxManager.deleteSandboxCompletely (cognitive 25) · ×1
  • LxdSandboxManager.deleteSandboxCompletely (cognitive 25) src/Helpers/LxdSandboxManager.php:1520 — LxdSandboxManager.deleteSandboxCompletely has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), error handling 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MessengerServer.saveCallEvent (cognitive 25) · ×1
  • MessengerServer.saveCallEvent (cognitive 25) src/Playground/MessengerServer.php:490 — MessengerServer.saveCallEvent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 2 (5 pts), ternaries 3 (5 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Subscriptions.checkout (cognitive 25) · ×1
  • Subscriptions.checkout (cognitive 25) src/Sites/Subscriptions.php:86 — Subscriptions.checkout has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 5 (6 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 · edit_script._ginto_build_repo_tree (cognitive 25) · ×1
  • edit_script._ginto_build_repo_tree (cognitive 25) src/Views/admin/pages/edit_script.php:8 — edit_script._ginto_build_repo_tree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 pts), error handling 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 · PostFeedManager._handleDeletePost (cognitive 25) · ×1
  • PostFeedManager._handleDeletePost (cognitive 25) saicms/public/assets/client/js/feedmanager.js:2534 — PostFeedManager._handleDeletePost has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (nesting depth added 7). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 2576). 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).performServerSearch (cognitive 25) · ×1
  • (anonymous).performServerSearch (cognitive 25) saicms/public/assets/client/js/F.js:966 — (anonymous).performServerSearch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2, error handling 1 (nesting depth added 7). Of this number, 23 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 · _handleGlobalClick (cognitive 25) · ×1
  • _handleGlobalClick (cognitive 25) saicms/public/assets/client/js/typeahead-chat.js:873 — _handleGlobalClick has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 12 (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 · _toggleMinimizeChatbox (cognitive 25) · ×1
  • _toggleMinimizeChatbox (cognitive 25) saicms/public/assets/client/js/typeahead-chat.js:2317 — _toggleMinimizeChatbox has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 7, ternaries 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 · FriendsController.sendRequest (cognitive 24) · ×1
  • FriendsController.sendRequest (cognitive 24) REDACTED:355 — FriendsController.sendRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2 (6 pts), boolean chains 4, 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 · StreamController.getCloudflareWebRTCInputDetails (cognitive 24) · ×1
  • StreamController.getCloudflareWebRTCInputDetails (cognitive 24) REDACTED:56 — StreamController.getCloudflareWebRTCInputDetails has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminLxcController.vncConnect (cognitive 24) · ×1
  • AdminLxcController.vncConnect (cognitive 24) REDACTED:816 — AdminLxcController.vncConnect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 pts), boolean chains 2, ternaries 2, 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 · ChatStreamHandler.formatReasoningHtml (cognitive 24) · ×1
  • ChatStreamHandler.formatReasoningHtml (cognitive 24) src/Handlers/ChatStreamHandler.php:2404 — ChatStreamHandler.formatReasoningHtml has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LxdApiClient.getInstanceIp (cognitive 24) · ×1
  • LxdApiClient.getInstanceIp (cognitive 24) src/Helpers/LxdApiClient.php:362 — LxdApiClient.getInstanceIp has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (9 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 · LxdSandboxManager.migrateContainerNetworkIfNeeded (cognitive 24) · ×1
  • LxdSandboxManager.migrateContainerNetworkIfNeeded (cognitive 24) src/Helpers/LxdSandboxManager.php:478 — LxdSandboxManager.migrateContainerNetworkIfNeeded has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, 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 · PtyServer.onMessage (cognitive 24) · ×1
  • PtyServer.onMessage (cognitive 24) src/Playground/PtyServer.php:295 — PtyServer.onMessage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, error handling 3 (6 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 · CustomerChat.reply (cognitive 24) · ×1
  • CustomerChat.reply (cognitive 24) src/Sites/CustomerChat.php:39 — CustomerChat.reply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (7 pts), boolean chains 5, error handling 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 · dashboard.document.addEventListener("DOMContentLoaded") (cognitive 24) · ×1
  • dashboard.document.addEventListener("DOMContentLoaded") (cognitive 24) saicms/public/assets/client/js/dashboard.js:359 — dashboard.document.addEventListener("DOMContentLoaded") has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 5 (nesting depth added 3). Of this number, 16 points are the body's own statements and 8 belong to 4 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 · (anonymous).performServerSearch (cognitive 24) · ×1
  • (anonymous).performServerSearch (cognitive 24) saicms/public/assets/client/js/F.js:789 — (anonymous).performServerSearch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 2, error handling 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent 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 24) · ×1
  • (anonymous) (cognitive 24) saicms/public/assets/client/js/dashboard.js:359 — (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 5 (nesting depth added 3). Of this number, 16 points are the body's own statements and 8 belong to 10 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 · _populateUploadForm (cognitive 24) · ×1
  • _populateUploadForm (cognitive 24) saicms/public/assets/client/js/mediamanager.js:92 — _populateUploadForm has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (onclick, a function literal at line 176, updatePostButtonState, …). 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 · _handleChatMessageContextMenu (cognitive 24) · ×1
  • _handleChatMessageContextMenu (cognitive 24) saicms/public/assets/client/js/typeahead-chat.js:3014 — _handleChatMessageContextMenu has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, boolean chains 8, error handling 1 (2 pts), ternaries 2 (nesting depth added 1). Of this number, 15 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ActivitiesController.editCommentById (cognitive 23) · ×1
  • ActivitiesController.editCommentById (cognitive 23) REDACTED:703 — ActivitiesController.editCommentById has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 7, ternaries 1 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ActivitiesController.createSharePost (cognitive 23) · ×1
  • ActivitiesController.createSharePost (cognitive 23) REDACTED:1034 — ActivitiesController.createSharePost has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, error handling 2, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MigrationsController.install (cognitive 23) · ×1
  • MigrationsController.install (cognitive 23) saicms/app/Controllers/MigrationsController.php:17 — MigrationsController.install has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Router.dispatch (cognitive 23) · ×1
  • Router.dispatch (cognitive 23) REDACTED:82 — Router.dispatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditorController.file (cognitive 23) · ×1
  • EditorController.file (cognitive 23) REDACTED:784 — EditorController.file has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · PlaygroundController.consoleEnvironment (cognitive 23) · ×1
  • PlaygroundController.consoleEnvironment (cognitive 23) REDACTED:641 — PlaygroundController.consoleEnvironment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 2 (4 pts), boolean chains 3, 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 · SandboxController.health (cognitive 23) · ×1
  • SandboxController.health (cognitive 23) src/Controllers/SandboxController.php:252 — SandboxController.health has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqetchChatController.handle (cognitive 23) · ×1
  • SqetchChatController.handle (cognitive 23) src/Controllers/SqetchChatController.php:11 — SqetchChatController.handle has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunnelController.verifyTunnelAccessKey (cognitive 23) · ×1
  • TunnelController.verifyTunnelAccessKey (cognitive 23) REDACTED:2229 — TunnelController.verifyTunnelAccessKey has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, 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 · OllamaProvider.postStreamOllama (cognitive 23) · ×1
  • OllamaProvider.postStreamOllama (cognitive 23) src/Core/LLM/Providers/OllamaProvider.php:344 — OllamaProvider.postStreamOllama has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 2 (4 pts), loops 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatStreamHandler.buildHistory (cognitive 23) · ×1
  • ChatStreamHandler.buildHistory (cognitive 23) src/Handlers/ChatStreamHandler.php:414 — ChatStreamHandler.buildHistory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 1 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · MessengerServer.onMessage (cognitive 23) · ×1
  • MessengerServer.onMessage (cognitive 23) src/Playground/MessengerServer.php:81 — MessengerServer.onMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MallCommerceService.createCheckoutSession (cognitive 23) · ×1
  • MallCommerceService.createCheckoutSession (cognitive 23) src/Services/MallCommerceService.php:260 — MallCommerceService.createCheckoutSession has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Renderer.pageAndStore (cognitive 23) · ×1
  • Renderer.pageAndStore (cognitive 23) src/Sites/Renderer.php:273 — Renderer.pageAndStore has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 4 (7 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 · PostFeedManager._bindGlobalAIEditorEventListeners (cognitive 23) · ×1
  • PostFeedManager._bindGlobalAIEditorEventListeners (cognitive 23) saicms/public/assets/client/js/feedmanager.js:2180 — PostFeedManager._bindGlobalAIEditorEventListeners has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 3 (nesting depth added 12). None of this is in the body itself: all 23 points belong to 2 function literals inside it that branch (lines 2181, 2199). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · _bindEvents (cognitive 23) · ×1
  • _bindEvents (cognitive 23) saicms/public/assets/client/js/dashboard.js:67 — _bindEvents has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (10 pts) (nesting depth added 2). None of this is in the body itself: all 23 points belong to 3 function literals inside it that branch (lines 68, 86, 88). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · _expandVideoToFullScreen (cognitive 23) · ×1
  • _expandVideoToFullScreen (cognitive 23) saicms/public/assets/client/js/typeahead-chat.js:1708 — _expandVideoToFullScreen has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 7 (nesting depth added 5). Of this number, 19 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 · markMessageAsFailed (cognitive 23) · ×1
  • markMessageAsFailed (cognitive 23) saicms/public/assets/client/js/typeahead-chat.js:2856 — markMessageAsFailed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 9). Of this number, 22 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 · FriendsController.searchSuggestionsAPI (cognitive 22) · ×1
  • FriendsController.searchSuggestionsAPI (cognitive 22) REDACTED:1181 — FriendsController.searchSuggestionsAPI has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UploadController.createPostWithMedia (cognitive 22) · ×1
  • UploadController.createPostWithMedia (cognitive 22) saicms/app/Controllers/UploadController.php:232 — UploadController.createPostWithMedia has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AcademyController.qrphInit (cognitive 22) · ×1
  • AcademyController.qrphInit (cognitive 22) REDACTED:1668 — AcademyController.qrphInit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ActivitiesController.createSharePost (cognitive 22) · ×1
  • ActivitiesController.createSharePost (cognitive 22) REDACTED:1105 — ActivitiesController.createSharePost has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, error handling 2, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AuthController.loginMobile (cognitive 22) · ×1
  • AuthController.loginMobile (cognitive 22) REDACTED:156 — AuthController.loginMobile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, error handling 3, 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 · BarangayController.saveProductZones (cognitive 22) · ×1
  • BarangayController.saveProductZones (cognitive 22) REDACTED:880 — BarangayController.saveProductZones has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 3 (4 pts), boolean chains 2, loops 1 (2 pts), error handling 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 · PagesController.buildViewScriptsTree (cognitive 22) · ×1
  • PagesController.buildViewScriptsTree (cognitive 22) REDACTED:46 — PagesController.buildViewScriptsTree has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (5 pts), error handling 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 · SitesCardController.hold (cognitive 22) · ×1
  • SitesCardController.hold (cognitive 22) src/Controllers/SitesCardController.php:79 — SitesCardController.hold has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (9 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 · McpUnifier.discoverStaticViaScript (cognitive 22) · ×1
  • McpUnifier.discoverStaticViaScript (cognitive 22) src/Core/McpUnifier.php:191 — McpUnifier.discoverStaticViaScript has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (5 pts), loops 2 (4 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 · DevTools.findUsages (cognitive 22) · ×1
  • DevTools.findUsages (cognitive 22) src/Handlers/DevTools.php:87 — DevTools.findUsages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 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 · DevTools.explainCode (cognitive 22) · ×1
  • DevTools.explainCode (cognitive 22) src/Handlers/DevTools.php:290 — DevTools.explainCode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 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 · Showcase.of (cognitive 22) · ×1
  • Showcase.of (cognitive 22) src/Sites/Showcase.php:25 — Showcase.of has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 5 (8 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EnvFile.set (cognitive 22) · ×1
  • EnvFile.set (cognitive 22) src/Support/EnvFile.php:19 — EnvFile.set has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (8 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 · REDACTED.document.addEventListener("DOMContentLoaded") (cognitive 22) · ×1
  • REDACTED.document.addEventListener("DOMContentLoaded") (cognitive 22) REDACTED:31 — REDACTED.document.addEventListener("DOMContentLoaded") has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (8 pts), error handling 3, ternaries 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · generateInitialsSVGDataURI (cognitive 22) · ×1
  • generateInitialsSVGDataURI (cognitive 22) saicms/public/assets/client/js/F.js:418 — generateInitialsSVGDataURI has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _updateCallUI (cognitive 22) · ×1
  • _updateCallUI (cognitive 22) saicms/public/assets/client/js/typeahead-chat.js:1582 — _updateCallUI has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 2 (4 pts), match/switch 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 · install.finalizeInstallationStep (cognitive 21) · ×1
  • install.finalizeInstallationStep (cognitive 21) REDACTED:1181 — install.finalizeInstallationStep has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (6 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 · FriendsController.fetchFriendSuggestions (cognitive 21) · ×1
  • FriendsController.fetchFriendSuggestions (cognitive 21) REDACTED:825 — FriendsController.fetchFriendSuggestions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentController.paypalCapture (cognitive 21) · ×1
  • PaymentController.paypalCapture (cognitive 21) REDACTED:1191 — PaymentController.paypalCapture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, error handling 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AnthropicProvider.formatMessages (cognitive 21) · ×1
  • AnthropicProvider.formatMessages (cognitive 21) src/Core/LLM/Providers/AnthropicProvider.php:84 — AnthropicProvider.formatMessages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (7 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatibleProvider.routed (cognitive 21) · ×1
  • OpenAICompatibleProvider.routed (cognitive 21) src/Core/LLM/Providers/OpenAICompatibleProvider.php:544 — OpenAICompatibleProvider.routed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, ternaries 3 (5 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 · McpUnifier.discoverToolsFolders (cognitive 21) · ×1
  • McpUnifier.discoverToolsFolders (cognitive 21) src/Core/McpUnifier.php:238 — McpUnifier.discoverToolsFolders has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), loops 2 (5 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 · StandardMcpHost.chatLegacy (cognitive 21) · ×1
  • StandardMcpHost.chatLegacy (cognitive 21) src/Core/StandardMcpHost.php:249 — StandardMcpHost.chatLegacy has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 2 (4 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserRateLimiter.checkLimit (cognitive 21) · ×1
  • UserRateLimiter.checkLimit (cognitive 21) src/Core/UserRateLimiter.php:178 — UserRateLimiter.checkLimit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 1 (2 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 · DevTools.findRelatedFiles (cognitive 21) · ×1
  • DevTools.findRelatedFiles (cognitive 21) src/Handlers/DevTools.php:362 — DevTools.findRelatedFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 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 · PandaSearchHandler.getReasoningLLM (cognitive 21) · ×1
  • PandaSearchHandler.getReasoningLLM (cognitive 21) src/Handlers/PandaSearchHandler.php:479 — PandaSearchHandler.getReasoningLLM has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SandboxMcp.createProject (cognitive 21) · ×1
  • SandboxMcp.createProject (cognitive 21) src/Handlers/SandboxMcp.php:614 — SandboxMcp.createProject has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (7 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 · GtbStrategy.configureCapital (cognitive 21) · ×1
  • GtbStrategy.configureCapital (cognitive 21) src/Services/GtbStrategy.php:476 — GtbStrategy.configureCapital has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MallCommerceService.completePaymentSession (cognitive 21) · ×1
  • MallCommerceService.completePaymentSession (cognitive 21) src/Services/MallCommerceService.php:620 — MallCommerceService.completePaymentSession has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1, 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 · MallCommerceService.calculateDeliveryFee (cognitive 21) · ×1
  • MallCommerceService.calculateDeliveryFee (cognitive 21) src/Services/MallCommerceService.php:2071 — MallCommerceService.calculateDeliveryFee has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, loops 2 (3 pts), 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, 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 · Indexing.tick (cognitive 21) · ×1
  • Indexing.tick (cognitive 21) src/Sites/Indexing.php:94 — Indexing.tick has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (9 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostFeedManager._setAIGeneratingStateInternal (cognitive 21) · ×1
  • PostFeedManager._setAIGeneratingStateInternal (cognitive 21) saicms/public/assets/client/js/feedmanager.js:1965 — PostFeedManager._setAIGeneratingStateInternal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 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 · HeaderManager._bindDelegatedModalEvents (cognitive 21) · ×1
  • HeaderManager._bindDelegatedModalEvents (cognitive 21) saicms/public/assets/client/js/headmanager.js:226 — HeaderManager._bindDelegatedModalEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7 (nesting depth added 3). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 232, 258). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · typing.document.addEventListener("DOMContentLoaded") · ×1
  • typing.document.addEventListener("DOMContentLoaded")::handleKeyDown (cognitive 21) saicms/public/assets/gaming/typing/js/typing.js:337 — typing.document.addEventListener("DOMContentLoaded")::handleKeyDown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 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.
D2 · Cognitive Complexity · updateNotificationsDisplay (cognitive 21) · ×1
  • updateNotificationsDisplay (cognitive 21) saicms/public/assets/client/js/notifications.js:287 — updateNotificationsDisplay has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (9 pts), ternaries 1 (2 pts) (nesting depth added 2). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · _createChatboxDOM (cognitive 21) · ×1
  • _createChatboxDOM (cognitive 21) saicms/public/assets/client/js/typeahead-chat.js:1403 — _createChatboxDOM has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5 (7 pts), boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 1520, a function literal at line 1535, a function literal at line 1546, …). 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 · ContactsController.generateFallbackAvatar (cognitive 20) · ×1
  • ContactsController.generateFallbackAvatar (cognitive 20) saicms/app/Controllers/ContactsController.php:198 — ContactsController.generateFallbackAvatar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProfileController.profile (cognitive 20) · ×1
  • ProfileController.profile (cognitive 20) saicms/app/Controllers/ProfileController.php:37 — ProfileController.profile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 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 · ChatMessageHandler.initializeDb (cognitive 20) · ×1
  • ChatMessageHandler.initializeDb (cognitive 20) saicms/app/WebSocket/ChatMessageHandler.php:56 — ChatMessageHandler.initializeDb has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 2, loops 1 (2 pts), 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.
D2 · Cognitive Complexity · ActivitiesController.deletePost (cognitive 20) · ×1
  • ActivitiesController.deletePost (cognitive 20) REDACTED:543 — ActivitiesController.deletePost has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · AdminLxcController.containerAction (cognitive 20) · ×1
  • AdminLxcController.containerAction (cognitive 20) REDACTED:224 — AdminLxcController.containerAction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 2 (4 pts), 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.
D2 · Cognitive Complexity · MallCheckoutController.buyerRegisterAction (cognitive 20) · ×1
  • MallCheckoutController.buyerRegisterAction (cognitive 20) src/Controllers/MallCheckoutController.php:605 — MallCheckoutController.buyerRegisterAction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 5, error handling 2, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PlaygroundController.index (cognitive 20) · ×1
  • PlaygroundController.index (cognitive 20) REDACTED:26 — PlaygroundController.index has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (7 pts), error handling 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 · Database.isInstalled (cognitive 20) · ×1
  • Database.isInstalled (cognitive 20) src/Core/Database.php:128 — Database.isInstalled has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicProvider.chatStream (cognitive 20) · ×1
  • AnthropicProvider.chatStream (cognitive 20) src/Core/LLM/Providers/AnthropicProvider.php:189 — AnthropicProvider.chatStream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 2 (3 pts), boolean chains 1, 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 · ToolCall.fromProvider (cognitive 20) · ×1
  • ToolCall.fromProvider (cognitive 20) src/Core/LLM/ToolCall.php:148 — ToolCall.fromProvider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Migration.rollback (cognitive 20) · ×1
  • Migration.rollback (cognitive 20) src/Core/Migration.php:203 — Migration.rollback has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts), error handling 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatStreamHandler.normalizeOpenAiDeltaContentImages (cognitive 20) · ×1
  • ChatStreamHandler.normalizeOpenAiDeltaContentImages (cognitive 20) src/Handlers/ChatStreamHandler.php:3391 — ChatStreamHandler.normalizeOpenAiDeltaContentImages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, 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 · BinanceClient.klinesMulti (cognitive 20) · ×1
  • BinanceClient.klinesMulti (cognitive 20) src/Services/BinanceClient.php:49 — BinanceClient.klinesMulti has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (7 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 · Photos.palette (cognitive 20) · ×1
  • Photos.palette (cognitive 20) src/Sites/Photos.php:126 — Photos.palette has cognitive complexity 20 (threshold 15). Drivers by points: loops 7 (12 pts), if/else 3 (8 pts) (nesting depth added 10). 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 · icon_helpers.iconColorAttr (cognitive 20) · ×1
  • icon_helpers.iconColorAttr (cognitive 20) src/Views/admin/parts/icon_helpers.php:172 — icon_helpers.iconColorAttr has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 4, loops 1 (2 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 · ChatUIManager._minimizeFullScreenVideo (cognitive 20) · ×1
  • ChatUIManager._minimizeFullScreenVideo (cognitive 20) saicms/public/assets/client/js/typeahead-chat.js:1738 — ChatUIManager._minimizeFullScreenVideo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatUIManager.startVideoCall (cognitive 20) · ×1
  • ChatUIManager.startVideoCall (cognitive 20) saicms/public/assets/client/js/typeahead-chat.js:1788 — ChatUIManager.startVideoCall has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 1 (2 pts), error handling 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 · _fetchHeaderData (cognitive 20) · ×1
  • _fetchHeaderData (cognitive 20) saicms/public/assets/client/js/headmanager.js:271 — _fetchHeaderData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, 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 · _showRemoteUserTypingIndicator (cognitive 20) · ×1
  • _showRemoteUserTypingIndicator (cognitive 20) saicms/public/assets/client/js/typeahead-chat.js:2388 — _showRemoteUserTypingIndicator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7 (nesting depth added 3). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: 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 · ActivitiesController.addComment (cognitive 19) · ×1
  • ActivitiesController.addComment (cognitive 19) REDACTED:300 — ActivitiesController.addComment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BarangayController.list (cognitive 19) · ×1
  • BarangayController.list (cognitive 19) REDACTED:323 — BarangayController.list has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (9 pts), loops 2 (4 pts), if/else 3, boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BibleController.search (cognitive 19) · ×1
  • BibleController.search (cognitive 19) REDACTED:68 — BibleController.search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 3, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatController.uploadImage (cognitive 19) · ×1
  • ChatController.uploadImage (cognitive 19) REDACTED:71 — ChatController.uploadImage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatController.index (cognitive 19) · ×1
  • ChatController.index (cognitive 19) REDACTED:712 — ChatController.index has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · EditorController.tree (cognitive 19) · ×1
  • EditorController.tree (cognitive 19) REDACTED:216 — EditorController.tree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditorController.rename (cognitive 19) · ×1
  • EditorController.rename (cognitive 19) REDACTED:432 — EditorController.rename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, 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, 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 · EditorController.save (cognitive 19) · ×1
  • EditorController.save (cognitive 19) REDACTED:698 — EditorController.save has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GtbController.updateEnvKeys (cognitive 19) · ×1
  • GtbController.updateEnvKeys (cognitive 19) REDACTED:928 — GtbController.updateEnvKeys has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (4 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.
D2 · Cognitive Complexity · McpController.probe (cognitive 19) · ×1
  • McpController.probe (cognitive 19) REDACTED:83 — McpController.probe has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 3 (7 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaygroundController.logs (cognitive 19) · ×1
  • PlaygroundController.logs (cognitive 19) REDACTED:86 — PlaygroundController.logs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 pts), error handling 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 · PromoCodesAdminController.validate (cognitive 19) · ×1
  • PromoCodesAdminController.validate (cognitive 19) REDACTED:225 — PromoCodesAdminController.validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, 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 · SandboxController.call (cognitive 19) · ×1
  • SandboxController.call (cognitive 19) src/Controllers/SandboxController.php:966 — SandboxController.call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, error handling 1, 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 · SqMallRelayController.provisionShop (cognitive 19) · ×1
  • SqMallRelayController.provisionShop (cognitive 19) src/Controllers/SqMallRelayController.php:116 — SqMallRelayController.provisionShop has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 5 (7 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 · OpenAICompatibleProvider.extractImageContentBlocks (cognitive 19) · ×1
  • OpenAICompatibleProvider.extractImageContentBlocks (cognitive 19) src/Core/LLM/Providers/OpenAICompatibleProvider.php:1041 — OpenAICompatibleProvider.extractImageContentBlocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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 · GtbStrategy.openPositionsState (cognitive 19) · ×1
  • GtbStrategy.openPositionsState (cognitive 19) src/Services/GtbStrategy.php:407 — GtbStrategy.openPositionsState has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 3, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · icon_helpers.activeIconClass (cognitive 19) · ×1
  • icon_helpers.activeIconClass (cognitive 19) src/Views/admin/parts/icon_helpers.php:128 — icon_helpers.activeIconClass has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 3, loops 1 (2 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. This shape REPEATS in the file: one other method here (icon_helpers.iconClassForAdmin) 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 · icon_helpers.iconClassForAdmin (cognitive 19) · ×1
  • icon_helpers.iconClassForAdmin (cognitive 19) src/Views/admin/parts/icon_helpers.php:212 — icon_helpers.iconClassForAdmin has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 3, loops 1 (2 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. This shape REPEATS in the file: one other method here (icon_helpers.activeIconClass) 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 · REDACTED.updateFallbackProviders (cognitive 19) · ×1
  • REDACTED.updateFallbackProviders (cognitive 19) REDACTED:1226 — REDACTED.updateFallbackProviders has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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 · REDACTED.checkInstallationStatus (cognitive 19) · ×1
  • REDACTED.checkInstallationStatus (cognitive 19) REDACTED:1337 — REDACTED.checkInstallationStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, error handling 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 · REDACTED.startInstallation (cognitive 19) · ×1
  • REDACTED.startInstallation (cognitive 19) REDACTED:1706 — REDACTED.startInstallation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PostFeedManager._createAICodePostElement (cognitive 19) · ×1
  • PostFeedManager._createAICodePostElement (cognitive 19) saicms/public/assets/client/js/feedmanager.js:1807 — PostFeedManager._createAICodePostElement has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 18, if/else 1. Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatNotificationManager._bindEvents (cognitive 19) · ×1
  • ChatNotificationManager._bindEvents (cognitive 19) saicms/public/assets/client/js/typeahead-chat.js:3148 — ChatNotificationManager._bindEvents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1 (nesting depth added 9). 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 literals inside it that branch (lines 3150, 3173, 3159). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · websearch.solveTurnstile (cognitive 19) · ×1
  • websearch.solveTurnstile (cognitive 19) REDACTED:225 — websearch.solveTurnstile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 1 (nesting depth added 8). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 239, 283, 228). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · prependNewPost (cognitive 19) · ×1
  • prependNewPost (cognitive 19) saicms/public/assets/client/js/feedmanager.js:861 — prependNewPost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _loadPostIntoModal (cognitive 19) · ×1
  • _loadPostIntoModal (cognitive 19) saicms/public/assets/client/js/headmanager.js:484 — _loadPostIntoModal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, 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 · ActivitiesController.deleteCommentById (cognitive 18) · ×1
  • ActivitiesController.deleteCommentById (cognitive 18) REDACTED:618 — ActivitiesController.deleteCommentById has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatController.getConversationMessages (cognitive 18) · ×1
  • ChatController.getConversationMessages (cognitive 18) saicms/app/Controllers/ChatController.php:1054 — ChatController.getConversationMessages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatController.notifyWebSocketOfGroupCreation (cognitive 18) · ×1
  • ChatController.notifyWebSocketOfGroupCreation (cognitive 18) saicms/app/Controllers/ChatController.php:1818 — ChatController.notifyWebSocketOfGroupCreation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (6 pts), ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FriendsController.fetchUserAcceptedFriends (cognitive 18) · ×1
  • FriendsController.fetchUserAcceptedFriends (cognitive 18) REDACTED:807 — FriendsController.fetchUserAcceptedFriends has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GroupController.generateFallbackAvatar (cognitive 18) · ×1
  • GroupController.generateFallbackAvatar (cognitive 18) saicms/app/Controllers/GroupController.php:244 — GroupController.generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HomeController.generateFallbackAvatar (cognitive 18) · ×1
  • HomeController.generateFallbackAvatar (cognitive 18) saicms/app/Controllers/HomeController.php:223 — HomeController.generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProfileController.generateFallbackAvatar (cognitive 18) · ×1
  • ProfileController.generateFallbackAvatar (cognitive 18) saicms/app/Controllers/ProfileController.php:315 — ProfileController.generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProfileController.updateIntro (cognitive 18) · ×1
  • ProfileController.updateIntro (cognitive 18) saicms/app/Controllers/ProfileController.php:613 — ProfileController.updateIntro has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamController._pm_generateFallbackAvatar (cognitive 18) · ×1
  • StreamController._pm_generateFallbackAvatar (cognitive 18) REDACTED:349 — StreamController._pm_generateFallbackAvatar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · helpers.isActiveNav (cognitive 18) · ×1
  • helpers.isActiveNav (cognitive 18) saicms/config/helpers.php:84 — helpers.isActiveNav has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, 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 · AcademyController.grantSubscription (cognitive 18) · ×1
  • AcademyController.grantSubscription (cognitive 18) REDACTED:469 — AcademyController.grantSubscription has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (4 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AdminController.dashboard (cognitive 18) · ×1
  • AdminController.dashboard (cognitive 18) src/Controllers/AdminController.php:154 — AdminController.dashboard has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 12, error handling 5, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ApiController.consoleLogs (cognitive 18) · ×1
  • ApiController.consoleLogs (cognitive 18) REDACTED:1375 — ApiController.consoleLogs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4, ternaries 2 (3 pts), loops 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 · BarangayController.detectByIp (cognitive 18) · ×1
  • BarangayController.detectByIp (cognitive 18) REDACTED:234 — BarangayController.detectByIp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 2 (3 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BarangayController.runnerRegister (cognitive 18) · ×1
  • BarangayController.runnerRegister (cognitive 18) REDACTED:1037 — BarangayController.runnerRegister has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 7, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · CommissionsController.batchLoadAmounts (cognitive 18) · ×1
  • CommissionsController.batchLoadAmounts (cognitive 18) REDACTED:219 — CommissionsController.batchLoadAmounts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 5, ternaries 4, boolean chains 2, error handling 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 · GtbController.account (cognitive 18) · ×1
  • GtbController.account (cognitive 18) REDACTED:454 — GtbController.account has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 1 (3 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GtbController.analyzeCoin (cognitive 18) · ×1
  • GtbController.analyzeCoin (cognitive 18) REDACTED:620 — GtbController.analyzeCoin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, loops 1 (2 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PaymentController.paypalOrder (cognitive 18) · ×1
  • PaymentController.paypalOrder (cognitive 18) REDACTED:1040 — PaymentController.paypalOrder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 7, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PaymentController.validatePromoCode (cognitive 18) · ×1
  • PaymentController.validatePromoCode (cognitive 18) REDACTED:1368 — PaymentController.validatePromoCode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, 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 · PaymentController.gintoPayStandaloneInit (cognitive 18) · ×1
  • PaymentController.gintoPayStandaloneInit (cognitive 18) REDACTED:1831 — PaymentController.gintoPayStandaloneInit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, error handling 1, 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 · UsersAdminController.containerInfo (cognitive 18) · ×1
  • UsersAdminController.containerInfo (cognitive 18) REDACTED:269 — UsersAdminController.containerInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderRegistry.resolveProviderBaseUrl (cognitive 18) · ×1
  • ProviderRegistry.resolveProviderBaseUrl (cognitive 18) src/Core/LLM/ProviderRegistry.php:284 — ProviderRegistry.resolveProviderBaseUrl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 5 (6 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ProviderRegistry.getLocalModels (cognitive 18) · ×1
  • ProviderRegistry.getLocalModels (cognitive 18) src/Core/LLM/ProviderRegistry.php:628 — ProviderRegistry.getLocalModels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), 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 · LightpandaSearchHandler.analyzeSourceIncrementally (cognitive 18) · ×1
  • LightpandaSearchHandler.analyzeSourceIncrementally (cognitive 18) src/Handlers/LightpandaSearchHandler.php:883 — LightpandaSearchHandler.analyzeSourceIncrementally has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (7 pts), boolean chains 1, 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 · PandaSearchHandler.fetchDirectUrls (cognitive 18) · ×1
  • PandaSearchHandler.fetchDirectUrls (cognitive 18) src/Handlers/PandaSearchHandler.php:366 — PandaSearchHandler.fetchDirectUrls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CurrencyHelper.detectCurrency (cognitive 18) · ×1
  • CurrencyHelper.detectCurrency (cognitive 18) REDACTED:19 — CurrencyHelper.detectCurrency has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (2 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 · LxdSandboxManager.createSandbox (cognitive 18) · ×1
  • LxdSandboxManager.createSandbox (cognitive 18) src/Helpers/LxdSandboxManager.php:1058 — LxdSandboxManager.createSandbox has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Product.create (cognitive 18) · ×1
  • Product.create (cognitive 18) src/Models/Product.php:22 — Product.create has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10, boolean chains 5, if/else 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 · User.register (cognitive 18) · ×1
  • User.register (cognitive 18) src/Models/User.php:60 — User.register has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (3 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MallNotifyServer.handleGps (cognitive 18) · ×1
  • MallNotifyServer.handleGps (cognitive 18) src/Playground/MallNotifyServer.php:237 — MallNotifyServer.handleGps has cognitive complexity 18 (threshold 15). Drivers by points: error handling 2 (5 pts), if/else 5, ternaries 4, boolean chains 2, loops 1 (2 pts) (nesting depth added 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 · PullbackDip.entryCandidate (cognitive 18) · ×1
  • PullbackDip.entryCandidate (cognitive 18) src/Services/Strategies/PullbackDip.php:33 — PullbackDip.entryCandidate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Ai.chat (cognitive 18) · ×1
  • Ai.chat (cognitive 18) src/Sites/Ai.php:48 — Ai.chat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (5 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 · Insights.creditVisits (cognitive 18) · ×1
  • Insights.creditVisits (cognitive 18) src/Sites/Insights.php:29 — Insights.creditVisits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Previews.build (cognitive 18) · ×1
  • Previews.build (cognitive 18) src/Sites/Previews.php:105 — Previews.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (6 pts), error handling 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveStreamUploader._initiateWebRTCConnectionToCF (cognitive 18) · ×1
  • LiveStreamUploader._initiateWebRTCConnectionToCF (cognitive 18) saicms/public/assets/client/js/mediamanager.js:598 — LiveStreamUploader._initiateWebRTCConnectionToCF has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SaiStories.handleDeleteStory (cognitive 18) · ×1
  • SaiStories.handleDeleteStory (cognitive 18) saicms/public/assets/client/js/stories.js:624 — SaiStories.handleDeleteStory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, 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 · typeahead.document.addEventListener("DOMContentLoaded") (cognitive 18) · ×1
  • typeahead.document.addEventListener("DOMContentLoaded") (cognitive 18) saicms/public/assets/client/js/typeahead.js:1 — typeahead.document.addEventListener("DOMContentLoaded") has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (fetchUsers, displayResults, a function literal at line 102, …). 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).initialize (cognitive 18) · ×1
  • (anonymous).initialize (cognitive 18) saicms/public/assets/client/js/F.js:528 — (anonymous).initialize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 1 (nesting depth added 3). None of this is in the body itself: all 18 points belong to 3 function items inside it that branch (a function literal at line 529, (anonymous)::generateAndReplace, (anonymous)::onerror). 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 18) · ×1
  • (anonymous) (cognitive 18) REDACTED:552 — (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 1 (nesting depth added 4). None of this is in the body itself: all 18 points belong to 14 function items inside it that branch (_handleVisibilityChange, _checkIdleStatus, _handleActivity, …). 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 · _bindGlobalEvents (cognitive 18) · ×1
  • _bindGlobalEvents (cognitive 18) saicms/public/assets/client/js/smartfed.js:82 — _bindGlobalEvents 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: 2 of the 18 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 100, 85, 84, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · updateModalUIAfterAIStateChange (cognitive 18) · ×1
  • updateModalUIAfterAIStateChange (cognitive 18) saicms/public/assets/client/js/smartfed.js:290 — updateModalUIAfterAIStateChange has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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 · _generateSimpleLocalSvgFallback (cognitive 18) · ×1
  • _generateSimpleLocalSvgFallback (cognitive 18) saicms/public/assets/client/js/typeahead-chat.js:751 — _generateSimpleLocalSvgFallback has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 3, 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 · _handleSelfTyping (cognitive 18) · ×1
  • _handleSelfTyping (cognitive 18) saicms/public/assets/client/js/typeahead-chat.js:2357 — _handleSelfTyping has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7 (nesting depth added 3). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GameController.game (cognitive 17) · ×1
  • GameController.game (cognitive 17) saicms/app/Controllers/GameController.php:37 — GameController.game has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4 (nesting depth added 8). 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 · ProfileController.feed (cognitive 17) · ×1
  • ProfileController.feed (cognitive 17) saicms/app/Controllers/ProfileController.php:380 — ProfileController.feed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 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 · SmartFiController.processTierPurchase (cognitive 17) · ×1
  • SmartFiController.processTierPurchase (cognitive 17) saicms/app/Controllers/SmartFiController.php:111 — SmartFiController.processTierPurchase has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · StreamController.createPostWithStream (cognitive 17) · ×1
  • StreamController.createPostWithStream (cognitive 17) REDACTED:173 — StreamController.createPostWithStream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ChatMessageHandler._broadcastToConversation (cognitive 17) · ×1
  • ChatMessageHandler._broadcastToConversation (cognitive 17) saicms/app/WebSocket/ChatMessageHandler.php:869 — ChatMessageHandler._broadcastToConversation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (4 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActivitiesController.deleteCommentById (cognitive 17) · ×1
  • ActivitiesController.deleteCommentById (cognitive 17) REDACTED:679 — ActivitiesController.deleteCommentById has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DebugController.llm (cognitive 17) · ×1
  • DebugController.llm (cognitive 17) REDACTED:48 — DebugController.llm has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, ternaries 6, if/else 3, error handling 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 · HostingController.provisionRelayDomainConfig (cognitive 17) · ×1
  • HostingController.provisionRelayDomainConfig (cognitive 17) REDACTED:903 — HostingController.provisionRelayDomainConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 2). 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 · HostingController.createDomain (cognitive 17) · ×1
  • HostingController.createDomain (cognitive 17) REDACTED:2344 — HostingController.createDomain has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3, boolean chains 1, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MallController.apiCartRefresh (cognitive 17) · ×1
  • MallController.apiCartRefresh (cognitive 17) REDACTED:295 — MallController.apiCartRefresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (6 pts), boolean chains 2, 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 · PaymentController.gintoPayInit (cognitive 17) · ×1
  • PaymentController.gintoPayInit (cognitive 17) REDACTED:2064 — PaymentController.gintoPayInit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 1, 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 · SitesCardController.state (cognitive 17) · ×1
  • SitesCardController.state (cognitive 17) src/Controllers/SitesCardController.php:231 — SitesCardController.state has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 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 · SitesController.create (cognitive 17) · ×1
  • SitesController.create (cognitive 17) src/Controllers/SitesController.php:150 — SitesController.create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 5, boolean chains 4, error handling 1, 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 · UserController.deleteAccountConfirm (cognitive 17) · ×1
  • UserController.deleteAccountConfirm (cognitive 17) src/Controllers/UserController.php:1997 — UserController.deleteAccountConfirm has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, error handling 3 (4 pts), boolean chains 3, 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 · Product.listLegacyFallback (cognitive 17) · ×1
  • Product.listLegacyFallback (cognitive 17) src/Models/Product.php:280 — Product.listLegacyFallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 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 · User.buildNetworkTree (cognitive 17) · ×1
  • User.buildNetworkTree (cognitive 17) src/Models/User.php:271 — User.buildNetworkTree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4, error handling 2 (3 pts), 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 · FixedPtyServer.onMessage (cognitive 17) · ×1
  • FixedPtyServer.onMessage (cognitive 17) src/Playground/FixedPtyServer.php:112 — FixedPtyServer.onMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 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 · SaiStories.handleContentTypeChange (cognitive 17) · ×1
  • SaiStories.handleContentTypeChange (cognitive 17) saicms/public/assets/client/js/stories.js:132 — SaiStories.handleContentTypeChange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 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 · ChatUIManager._handleGlobalKeyDown (cognitive 17) · ×1
  • ChatUIManager._handleGlobalKeyDown (cognitive 17) saicms/public/assets/client/js/typeahead-chat.js:891 — ChatUIManager._handleGlobalKeyDown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 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 · (anonymous).renderCard (cognitive 17) · ×1
  • (anonymous).renderCard (cognitive 17) saicms/public/assets/client/js/F.js:713 — (anonymous).renderCard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, ternaries 4, match/switch 1 (2 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 · _initiateWebRTCConnectionToCF · ×1
  • _initiateWebRTCConnectionToCF::oniceconnectionstatechange (cognitive 17) saicms/public/assets/client/js/mediamanager.js:625 — _initiateWebRTCConnectionToCF::oniceconnectionstatechange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _handleImageUpload (cognitive 17) · ×1
  • _handleImageUpload (cognitive 17) saicms/public/assets/client/js/profile.js:579 — _handleImageUpload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4, boolean chains 3, error handling 1 (nesting depth added 2). Of this number, 9 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, 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 · _generateClientFallbackSVG (cognitive 17) · ×1
  • _generateClientFallbackSVG (cognitive 17) saicms/public/assets/client/js/stories.js:544 — _generateClientFallbackSVG has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (6 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _renderUsers (cognitive 17) · ×1
  • _renderUsers (cognitive 17) saicms/public/assets/client/js/typeahead-chat.js:181 — _renderUsers has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 1 (2 pts) (nesting depth added 1). 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 192). 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 · install.getEnvValues (cognitive 16) · ×1
  • install.getEnvValues (cognitive 16) REDACTED:2062 — install.getEnvValues has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, 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 · FriendsController.countMutualFriends (cognitive 16) · ×1
  • FriendsController.countMutualFriends (cognitive 16) REDACTED:783 — FriendsController.countMutualFriends has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AcademyController.botData (cognitive 16) · ×1
  • AcademyController.botData (cognitive 16) REDACTED:139 — AcademyController.botData has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), if/else 4 (5 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AcademyController.autoBuyFromDecision (cognitive 16) · ×1
  • AcademyController.autoBuyFromDecision (cognitive 16) REDACTED:1024 — AcademyController.autoBuyFromDecision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · EditorController.buildEditorTree (cognitive 16) · ×1
  • EditorController.buildEditorTree (cognitive 16) REDACTED:292 — EditorController.buildEditorTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3, boolean chains 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 · LiveController.createAdminAccountStep (cognitive 16) · ×1
  • LiveController.createAdminAccountStep (cognitive 16) src/Controllers/LiveController.php:448 — LiveController.createAdminAccountStep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, ternaries 3 (6 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MallCheckoutController.notificationsApi (cognitive 16) · ×1
  • MallCheckoutController.notificationsApi (cognitive 16) src/Controllers/MallCheckoutController.php:318 — MallCheckoutController.notificationsApi has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 3 (5 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 · MallCheckoutController.uploadDeliveryProof (cognitive 16) · ×1
  • MallCheckoutController.uploadDeliveryProof (cognitive 16) src/Controllers/MallCheckoutController.php:934 — MallCheckoutController.uploadDeliveryProof has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 4, boolean chains 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PlaygroundController.tree (cognitive 16) · ×1
  • PlaygroundController.tree (cognitive 16) REDACTED:585 — PlaygroundController.tree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaygroundController.consoleLogs (cognitive 16) · ×1
  • PlaygroundController.consoleLogs (cognitive 16) REDACTED:852 — PlaygroundController.consoleLogs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 1 (2 pts), ternaries 2, boolean chains 1, 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 · SitesController.me (cognitive 16) · ×1
  • SitesController.me (cognitive 16) src/Controllers/SitesController.php:341 — SitesController.me has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 6, if/else 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 · SubscriptionController.activate (cognitive 16) · ×1
  • SubscriptionController.activate (cognitive 16) src/Controllers/SubscriptionController.php:154 — SubscriptionController.activate has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, 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 · TunnelController.reactivateAccessKey (cognitive 16) · ×1
  • TunnelController.reactivateAccessKey (cognitive 16) REDACTED:1744 — TunnelController.reactivateAccessKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 4, ternaries 4, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · StandardMcpHost.executeTool (cognitive 16) · ×1
  • StandardMcpHost.executeTool (cognitive 16) src/Core/StandardMcpHost.php:181 — StandardMcpHost.executeTool has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 2 (5 pts), loops 2 (3 pts), 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 · AgentTools.batchEdit (cognitive 16) · ×1
  • AgentTools.batchEdit (cognitive 16) src/Handlers/AgentTools.php:128 — AgentTools.batchEdit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatStreamHandler.prepareVisionImageInput (cognitive 16) · ×1
  • ChatStreamHandler.prepareVisionImageInput (cognitive 16) src/Handlers/ChatStreamHandler.php:673 — ChatStreamHandler.prepareVisionImageInput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, 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 · ChatStreamHandler.handleStreamError (cognitive 16) · ×1
  • ChatStreamHandler.handleStreamError (cognitive 16) src/Handlers/ChatStreamHandler.php:2266 — ChatStreamHandler.handleStreamError has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (4 pts), if/else 3, loops 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 · SandboxMcp.deleteFile (cognitive 16) · ×1
  • SandboxMcp.deleteFile (cognitive 16) src/Handlers/SandboxMcp.php:280 — SandboxMcp.deleteFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientSandboxHelper.validateSandboxExists (cognitive 16) · ×1
  • ClientSandboxHelper.validateSandboxExists (cognitive 16) src/Helpers/ClientSandboxHelper.php:245 — ClientSandboxHelper.validateSandboxExists has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LxdSandboxManager.getCreationStatus (cognitive 16) · ×1
  • LxdSandboxManager.getCreationStatus (cognitive 16) src/Helpers/LxdSandboxManager.php:868 — LxdSandboxManager.getCreationStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (2 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 · UnifiedSandbox.writeFile (cognitive 16) · ×1
  • UnifiedSandbox.writeFile (cognitive 16) src/Helpers/UnifiedSandbox.php:391 — UnifiedSandbox.writeFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LtradingServer.refreshMarkets (cognitive 16) · ×1
  • LtradingServer.refreshMarkets (cognitive 16) src/Playground/LtradingServer.php:411 — LtradingServer.refreshMarkets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, 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 · GtbBrain.__construct (cognitive 16) · ×1
  • GtbBrain.__construct (cognitive 16) src/Services/GtbBrain.php:43 — GtbBrain.__construct has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 4 (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 · MallCommerceService.hydrateOrders (cognitive 16) · ×1
  • MallCommerceService.hydrateOrders (cognitive 16) src/Services/MallCommerceService.php:1516 — MallCommerceService.hydrateOrders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (4 pts), loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Indexing.check (cognitive 16) · ×1
  • Indexing.check (cognitive 16) src/Sites/Indexing.php:124 — Indexing.check has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 3, if/else 3, loops 2, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Publisher.push (cognitive 16) · ×1
  • Publisher.push (cognitive 16) src/Sites/Publisher.php:67 — Publisher.push has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, if/else 4 (5 pts), boolean chains 3, 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 · Subscriptions.remindRenewals (cognitive 16) · ×1
  • Subscriptions.remindRenewals (cognitive 16) src/Sites/Subscriptions.php:240 — Subscriptions.remindRenewals has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 4, if/else 1 (2 pts), match/switch 1 (2 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 · RelayAuth.resolve (cognitive 16) · ×1
  • RelayAuth.resolve (cognitive 16) src/Support/RelayAuth.php:90 — RelayAuth.resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · LegacyDbAdapter.query (cognitive 16) · ×1
  • LegacyDbAdapter.query (cognitive 16) src/Views/bible/verse.php:29 — LegacyDbAdapter.query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (6 pts), boolean chains 1, 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 · PostFeedManager._handleViewOriginalPostInModal (cognitive 16) · ×1
  • PostFeedManager._handleViewOriginalPostInModal (cognitive 16) saicms/public/assets/client/js/feedmanager.js:414 — PostFeedManager._handleViewOriginalPostInModal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostFeedManager._handleSubmitComment (cognitive 16) · ×1
  • PostFeedManager._handleSubmitComment (cognitive 16) saicms/public/assets/client/js/feedmanager.js:2715 — PostFeedManager._handleSubmitComment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, error handling 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 · headmanager._generateClientFallbackSVG (cognitive 16) · ×1
  • headmanager._generateClientFallbackSVG (cognitive 16) saicms/public/assets/client/js/headmanager.js:14 — headmanager._generateClientFallbackSVG has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveStreamUploader._stopCloudflareStreamAndWebcam (cognitive 16) · ×1
  • LiveStreamUploader._stopCloudflareStreamAndWebcam (cognitive 16) saicms/public/assets/client/js/mediamanager.js:778 — LiveStreamUploader._stopCloudflareStreamAndWebcam has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · NotificationManager._handleViewPostInModal (cognitive 16) · ×1
  • NotificationManager._handleViewPostInModal (cognitive 16) saicms/public/assets/client/js/notifications.js:1060 — NotificationManager._handleViewPostInModal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatUIManager._connectWebSocket (cognitive 16) · ×1
  • ChatUIManager._connectWebSocket (cognitive 16) saicms/public/assets/client/js/typeahead-chat.js:937 — ChatUIManager._connectWebSocket has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, if/else 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 · _handleModalLikeClick (cognitive 16) · ×1
  • _handleModalLikeClick (cognitive 16) saicms/public/assets/client/js/headmanager.js:525 — _handleModalLikeClick has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generateFallbackSVG (cognitive 16) · ×1
  • generateFallbackSVG (cognitive 16) saicms/public/assets/client/js/notifications.js:125 — generateFallbackSVG has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · previewMediaFile (cognitive 16) · ×1
  • previewMediaFile (cognitive 16) saicms/public/assets/client/js/stories.js:145 — previewMediaFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (nesting depth added 4). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (onload, onerror). 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 · _handleSendMessage (cognitive 16) · ×1
  • _handleSendMessage (cognitive 16) saicms/public/assets/client/js/typeahead-chat.js:2521 — _handleSendMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, error handling 2 (3 pts), 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (6 members, 47 shared lines) · ×1
  • Near-duplicate member family (6 members, 47 shared lines) saicms/app/Controllers/UploadController.php:235 — saicms/app/Controllers/UploadController.php:235-356 | saicms/app/Controllers/UploadController.php:417-549 | saicms/app/Controllers/UploadController.php:795-932 | src/Controllers/UploadController.php:240-383 | src/Controllers/UploadController.php:444-576 | src/Controllers/UploadController.php:822-959 — These 6 members are variants of one another: a block of 47 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 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (6 members, 21 shared lines) · ×1
  • Near-duplicate member family (6 members, 21 shared lines) REDACTED:73 — REDACTED:73-162 | REDACTED:171-238 | REDACTED:271-309 | REDACTED:488-568 | REDACTED:576-620 | REDACTED:628-706 — These 6 members are variants of one another: a block of 21 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 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 65 shared lines) · ×1
  • Near-duplicate member family (5 members, 65 shared lines) saicms/app/Controllers/GroupController.php:53 — saicms/app/Controllers/GroupController.php:53-191 | saicms/app/Controllers/HomeController.php:32-170 | saicms/app/Controllers/ProfileController.php:187-312 | saicms/app/Controllers/SocialController.php:29-150 | src/Controllers/SocialController.php:40-208 — These 5 members are variants of one another: a block of 65 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 56 shared lines) · ×1
  • Near-duplicate member family (4 members, 56 shared lines) REDACTED:704 — REDACTED:704-826 | REDACTED:830-972 | REDACTED:761-901 | REDACTED:905-1043 — These 4 members are variants of one another: a block of 56 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 45 shared lines) · ×1
  • Near-duplicate member family (4 members, 45 shared lines) REDACTED:1563 — REDACTED:1563-1617 | saicms/app/Controllers/ProfileController.php:551-606 | saicms/app/Controllers/ProfileController.php:705-762 | saicms/app/Controllers/ProfileController.php:775-833 — These 4 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 31 shared lines) · ×1
  • Near-duplicate member family (4 members, 31 shared lines) saicms/app/Controllers/StoriesController.php:151 — saicms/app/Controllers/StoriesController.php:151-267 | saicms/app/Controllers/UploadController.php:235-356 | src/Controllers/StoriesController.php:169-286 | src/Controllers/UploadController.php:240-383 — These 4 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 25 shared lines) · ×1
  • Near-duplicate member family (3 members, 25 shared lines) REDACTED:364 — REDACTED:364-508 | REDACTED:908-1002 | REDACTED:1011-1100 — These 3 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 17 shared lines) · ×1
  • Near-duplicate member family (3 members, 17 shared lines) REDACTED:186 — REDACTED:186-230 | REDACTED:517-543 | REDACTED:718-845 — These 3 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (105 shared lines) · ×1
  • Near-duplicate member pair (105 shared lines) src/Controllers/ClientsController.php:71 — src/Controllers/ClientsController.php:71-286 | src/Controllers/ClientsController.php:297-486 — These two members are variants of one another: 105 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 (75 shared lines) · ×1
  • Near-duplicate member pair (75 shared lines) src/Helpers/DockerSandboxManager.php:955 — src/Helpers/DockerSandboxManager.php:955-1074 | src/Helpers/LxdSandboxManager.php:1716-1835 — These two members are variants of one another: 75 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 (67 shared lines) · ×1
  • Near-duplicate member pair (67 shared lines) src/Controllers/SellerController.php:324 — src/Controllers/SellerController.php:324-505 | src/Controllers/SellerController.php:646-811 — These two members are variants of one another: 67 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 (50 shared lines) · ×1
  • Near-duplicate member pair (50 shared lines) REDACTED:193 — REDACTED:193-308 | REDACTED:317-410 — These two members are variants of one another: 50 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 (39 shared lines) · ×1
  • Near-duplicate member pair (39 shared lines) REDACTED:1109 — REDACTED:1109-1185 | REDACTED:1194-1338 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) REDACTED:577 — REDACTED:577-609 | saicms/app/Controllers/GroupController.php:245-281 | saicms/app/Controllers/HomeController.php:224-260 | saicms/app/Controllers/ProfileController.php:317-353 | saicms/app/Controllers/SocialController.php:199-235 | REDACTED:350-374 | saicms/app/Controllers/UploadController.php:705-733 | REDACTED:638-670 | src/Controllers/SocialController.php:304-324 | src/Controllers/UploadController.php:732-760 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) src/Controllers/CategoriesController.php:13 — src/Controllers/CategoriesController.php:13-16 | src/Controllers/MediaController.php:13-16 | src/Controllers/MenusController.php:13-16 | REDACTED:13-26 | src/Controllers/PluginsController.php:13-16 | src/Controllers/PostsController.php:13-16 | src/Controllers/SettingsController.php:13-16 | src/Controllers/TagsController.php:13-16 | src/Controllers/ThemesController.php:13-16 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Edited copy of a member (236 corresponding lines) · ×1
  • Edited copy of a member (236 corresponding lines) saicms/app/Controllers/ApiController.php:45 — saicms/app/Controllers/ApiController.php:45-280 | REDACTED:347-590 — These two members are one piece of code written twice and then edited apart: 236 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (66 corresponding lines) · ×1
  • Edited copy of a member (66 corresponding lines) REDACTED:434 — REDACTED:434-501 | REDACTED:469-534 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (86 corresponding lines) · ×1
  • Edited copy of a member (86 corresponding lines) saicms/app/Controllers/StoriesController.php:273 — saicms/app/Controllers/StoriesController.php:273-361 | src/Controllers/StoriesController.php:301-386 — These two members are one piece of code written twice and then edited apart: 86 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) REDACTED:1077 — REDACTED:1077-1138 | REDACTED:1216-1288 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (124 corresponding lines) · ×1
  • Edited copy of a member (124 corresponding lines) src/Core/LLM/UnifiedMcpClient.php:1041 — src/Core/LLM/UnifiedMcpClient.php:1041-1164 | src/Core/LLM/UnifiedMcpClient.php:1182-1315 — These two members are one piece of code written twice and then edited apart: 124 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) REDACTED:1118 — REDACTED:1118-1178 | src/Controllers/LiveController.php:384-441 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (95 corresponding lines) · ×1
  • Edited copy of a member (95 corresponding lines) src/Handlers/LightpandaSearchHandler.php:764 — src/Handlers/LightpandaSearchHandler.php:764-877 | src/Handlers/PandaSearchHandler.php:157-251 — These two members are one piece of code written twice and then edited apart: 95 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (87 corresponding lines) · ×1
  • Edited copy of a member (87 corresponding lines) REDACTED:315 — REDACTED:315-401 | REDACTED:409-527 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) saicms/app/Controllers/GroupController.php:306 — saicms/app/Controllers/GroupController.php:306-386 | saicms/app/Controllers/ProfileController.php:381-469 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) src/Handlers/LightpandaSearchHandler.php:1033 — src/Handlers/LightpandaSearchHandler.php:1033-1111 | src/Handlers/PandaSearchHandler.php:373-445 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) REDACTED:28 — REDACTED:28-79 | REDACTED:88-137 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) src/Handlers/LightpandaSearchHandler.php:100 — src/Handlers/LightpandaSearchHandler.php:100-177 | src/Handlers/LightpandaSearchHandler.php:185-247 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) REDACTED:48 — REDACTED:48-85 | src/Views/admin/pages/edit_script.php:10-53 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) REDACTED:196 — REDACTED:196-220 | REDACTED:316-335 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) REDACTED:703 — REDACTED:703-778 | REDACTED:997-1049 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) REDACTED:2010 — REDACTED:2010-2056 | REDACTED:2325-2360 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) saicms/app/Controllers/GroupController.php:390 — saicms/app/Controllers/GroupController.php:390-421 | saicms/app/Controllers/HomeController.php:369-400 | saicms/app/Controllers/SocialController.php:329-359 | src/Controllers/SocialController.php:453-462 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) REDACTED:992 — REDACTED:992-1033 | src/Controllers/PaymentsAdminController.php:104-143 | src/Controllers/PaymentsAdminController.php:151-192 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) src/Handlers/LightpandaSearchHandler.php:954 — src/Handlers/LightpandaSearchHandler.php:954-988 | src/Handlers/PandaSearchHandler.php:264-294 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) src/Services/SilverQueenEngine.php:660 — src/Services/SilverQueenEngine.php:660-680 | src/Services/SilverQueenEngine.php:808-824 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) src/Services/MallPushService.php:221 — src/Services/MallPushService.php:221-261 | src/Services/MallPushService.php:476-531 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) src/Playground/MessengerServer.php:762 — src/Playground/MessengerServer.php:762-798 | src/Playground/MessengerServer.php:846-877 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) REDACTED:373 — REDACTED:373-394 | REDACTED:517-541 | REDACTED:555-574 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) src/Handlers/SandboxMcp.php:109 — src/Handlers/SandboxMcp.php:109-135 | src/Handlers/SandboxMcp.php:344-374 | src/Handlers/SandboxMcp.php:386-416 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) REDACTED:424 — REDACTED:424-449 | REDACTED:1984-2011 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) src/Core/UserRateLimiter.php:339 — src/Core/UserRateLimiter.php:339-379 | src/Core/UserRateLimiter.php:388-420 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) src/Helpers/UnifiedSandbox.php:771 — src/Helpers/UnifiedSandbox.php:771-786 | src/Helpers/UnifiedSandbox.php:794-809 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) REDACTED:176 — REDACTED:176-197 | REDACTED:205-226 | REDACTED:234-255 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×1
  • Edited copy of a member (8 corresponding lines) src/Controllers/MallCheckoutController.php:244 — src/Controllers/MallCheckoutController.php:244-251 | src/Controllers/MallCheckoutController.php:256-263 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) REDACTED:1014 — REDACTED:1014-1048 | src/Controllers/UserController.php:820-853 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) src/Controllers/MallCheckoutController.php:435 — src/Controllers/MallCheckoutController.php:435-445 | src/Controllers/MallCheckoutController.php:470-480 | src/Controllers/MallCheckoutController.php:485-495 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) src/Helpers/DockerSandboxManager.php:508 — src/Helpers/DockerSandboxManager.php:508-542 | src/Helpers/DockerSandboxManager.php:550-579 | src/Helpers/DockerSandboxManager.php:587-614 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) REDACTED:301 — REDACTED:301-313 | REDACTED:438-449 | REDACTED:463-478 | REDACTED:492-503 | REDACTED:588-603 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 3+ corresponding lines) src/Controllers/CategoriesController.php:21 — src/Controllers/CategoriesController.php:21-23 | src/Controllers/MediaController.php:21-23 | REDACTED:31-39 | src/Controllers/PluginsController.php:21-23 | src/Controllers/PostsController.php:21-23 | src/Controllers/TagsController.php:21-23 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) src/Handlers/WebSearchMcp.php:123 — src/Handlers/WebSearchMcp.php:123-137 | src/Handlers/WebSearchMcp.php:189-204 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) src/Services/TotpService.php:178 — src/Services/TotpService.php:178-182 | src/Services/TotpService.php:187-191 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) REDACTED:2212 — REDACTED:95-101 | REDACTED:2212-2218 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) REDACTED:1808 — REDACTED:1808-1834 | REDACTED:1900-1928 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) REDACTED:915 — REDACTED:915-921 | REDACTED:841-849 | src/Controllers/ReferralLinksAdminController.php:38-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) src/Services/Strategies/Breakout.php:59 — src/Services/Strategies/Breakout.php:59-61 | src/Services/Strategies/PullbackDip.php:73-75 | src/Services/Strategies/ScalpMomentum.php:52-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) src/Security/PmaGate.php:373 — REDACTED:547-550 | src/Security/PmaGate.php:373-377 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (128–129 lines × 2) · ×1
  • Duplicated block (128–129 lines × 2) saicms/app/Controllers/ApiController.php:45 — saicms/app/Controllers/ApiController.php:45-172 | REDACTED:347-475 — before extracting anything, compare `saicms/app/Controllers/ApiController.php` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 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 `saicms/app/Controllers/ApiController.php:45` 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 (104 lines × 2) · ×1
  • Duplicated block (104 lines × 2) REDACTED:841 — REDACTED:841-944 | REDACTED:912-1015 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:841` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (84 lines × 2) · ×1
  • Duplicated block (84 lines × 2) saicms/app/Controllers/WebhookController.php:269 — saicms/app/Controllers/WebhookController.php:269-352 | src/Controllers/WebhookController.php:283-366 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 `saicms/app/Controllers/WebhookController.php:269` 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 (80–82 lines × 2) · ×1
  • Duplicated block (80–82 lines × 2) REDACTED:1039 — REDACTED:1039-1118 | REDACTED:1108-1189 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1039` 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 (2–77 lines × 5) · ×1
  • Duplicated block (2–77 lines × 5) saicms/app/Controllers/GroupController.php:310 — saicms/app/Controllers/GroupController.php:310-386 | saicms/app/Controllers/HomeController.php:289-365 | saicms/app/Controllers/ProfileController.php:391-395 | saicms/app/Controllers/SocialController.php:259-325 | src/Controllers/SocialController.php:371-372 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/ProfileController.php:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `saicms/app/Controllers/ProfileController.php:395` calls `http_response_code`, `json_encode` and `saicms/app/Controllers/GroupController.php:386` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (1–72 lines × 8) · ×1
  • Duplicated block (1–72 lines × 8) saicms/app/Controllers/StoriesController.php:455 — saicms/app/Controllers/StoriesController.php:455-456 | saicms/app/Controllers/StoriesController.php:486-557 | saicms/app/Controllers/UploadController.php:116-116 | saicms/app/Controllers/UploadController.php:619-623 | src/Controllers/StoriesController.php:480-481 | src/Controllers/StoriesController.php:511-582 | src/Controllers/UploadController.php:120-120 | src/Controllers/UploadController.php:646-650 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:455` 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 (70 lines × 2) · ×1
  • Duplicated block (70 lines × 2) saicms/app/Controllers/WebhookController.php:79 — saicms/app/Controllers/WebhookController.php:79-148 | src/Controllers/WebhookController.php:93-162 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 `src/Controllers/WebhookController.php:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/WebhookController.php:92` calls `requirePaypalConfig` and `saicms/app/Controllers/WebhookController.php:78` 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 (66 lines × 2) · ×1
  • Duplicated block (66 lines × 2) saicms/app/Controllers/WebhookController.php:490 — saicms/app/Controllers/WebhookController.php:490-555 | src/Controllers/WebhookController.php:654-719 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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.
D4 · Code Duplication · Duplicated block (63 lines × 2) · ×1
  • Duplicated block (63 lines × 2) REDACTED:748 — REDACTED:748-810 | REDACTED:1028-1090 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 (61 lines × 2) · ×1
  • Duplicated block (61 lines × 2) saicms/app/Controllers/StoriesController.php:285 — saicms/app/Controllers/StoriesController.php:285-345 | src/Controllers/StoriesController.php:307-367 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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 `saicms/app/Controllers/StoriesController.php:285` 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, `src/Controllers/StoriesController.php:369` calls `_app_log` and `saicms/app/Controllers/StoriesController.php:346` 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 (44–56 lines × 3) · ×1
  • Duplicated block (44–56 lines × 3) REDACTED:728 — REDACTED:728-783 | REDACTED:802-848 | REDACTED:860-903 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:728` 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 (55 lines × 2) · ×1
  • Duplicated block (55 lines × 2) REDACTED:165 — REDACTED:165-219 | REDACTED:195-249 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:165` 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 (109–112 lines × 2) · ×1
  • Duplicated block (109–112 lines × 2) saicms/app/Controllers/UploadController.php:237 — saicms/app/Controllers/UploadController.php:237-345 | src/Controllers/UploadController.php:261-372 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (45–52 lines × 4) · ×1
  • Duplicated block (45–52 lines × 4) saicms/app/Controllers/UploadController.php:486 — saicms/app/Controllers/UploadController.php:486-537 | saicms/app/Controllers/UploadController.php:876-920 | src/Controllers/UploadController.php:513-564 | src/Controllers/UploadController.php:903-947 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:486` 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 (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) REDACTED:299 — REDACTED:299-349 | REDACTED:306-356 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 `REDACTED:299` 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 (45–48 lines × 4) · ×1
  • Duplicated block (45–48 lines × 4) REDACTED:782 — REDACTED:782-826 | REDACTED:925-972 | REDACTED:857-901 | REDACTED:996-1043 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:923` calls `update` and `REDACTED:855` 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 (43–48 lines × 2) · ×1
  • Duplicated block (43–48 lines × 2) src/Core/LLM/UnifiedMcpClient.php:807 — src/Core/LLM/UnifiedMcpClient.php:807-854 | src/Core/LLM/UnifiedMcpClient.php:867-909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/LLM/UnifiedMcpClient.php:807` 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 (4–46 lines × 4) · ×1
  • Duplicated block (4–46 lines × 4) saicms/app/Controllers/StoriesController.php:83 — saicms/app/Controllers/StoriesController.php:83-128 | saicms/app/Controllers/StoriesController.php:383-386 | src/Controllers/StoriesController.php:101-146 | src/Controllers/StoriesController.php:408-411 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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 `saicms/app/Controllers/StoriesController.php:83` 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 (37–41 lines × 2) · ×1
  • Duplicated block (37–41 lines × 2) src/Handlers/LightpandaSearchHandler.php:102 — src/Handlers/LightpandaSearchHandler.php:102-142 | src/Handlers/LightpandaSearchHandler.php:187-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (33–40 lines × 5) · ×1
  • Duplicated block (33–40 lines × 5) saicms/app/Controllers/GroupController.php:84 — saicms/app/Controllers/GroupController.php:84-121 | saicms/app/Controllers/HomeController.php:63-100 | saicms/app/Controllers/ProfileController.php:212-251 | saicms/app/Controllers/SocialController.php:57-91 | src/Controllers/SocialController.php:84-116 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.php:84` 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 (30–40 lines × 3) · ×1
  • Duplicated block (30–40 lines × 3) saicms/app/Controllers/GroupController.php:141 — saicms/app/Controllers/GroupController.php:141-180 | saicms/app/Controllers/HomeController.php:120-159 | saicms/app/Controllers/SocialController.php:110-139 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.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.
D4 · Code Duplication · Duplicated block (2–39 lines × 7) · ×1
  • Duplicated block (2–39 lines × 7) REDACTED:390 — REDACTED:390-428 | saicms/app/Controllers/GroupController.php:308-309 | saicms/app/Controllers/HomeController.php:287-288 | saicms/app/Controllers/ProfileController.php:387-391 | saicms/app/Controllers/SocialController.php:257-258 | REDACTED:425-463 | src/Controllers/SocialController.php:370-371 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (28–37 lines × 4) · ×1
  • Duplicated block (28–37 lines × 4) REDACTED:1565 — REDACTED:1565-1595 | saicms/app/Controllers/ProfileController.php:553-587 | saicms/app/Controllers/ProfileController.php:707-743 | saicms/app/Controllers/ProfileController.php:785-812 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1565` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1561` calls `getProfileCheckinsApi`, `header` and `saicms/app/Controllers/ProfileController.php:783` 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 (29–37 lines × 4) · ×1
  • Duplicated block (29–37 lines × 4) saicms/app/Controllers/UploadController.php:453 — saicms/app/Controllers/UploadController.php:453-481 | saicms/app/Controllers/UploadController.php:837-873 | src/Controllers/UploadController.php:480-508 | src/Controllers/UploadController.php:864-900 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:453` 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 (42–47 lines × 3) · ×1
  • Duplicated block (42–47 lines × 3) saicms/app/Controllers/GroupController.php:195 — saicms/app/Controllers/GroupController.php:195-241 | saicms/app/Controllers/HomeController.php:174-220 | saicms/app/Controllers/SocialController.php:154-195 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) REDACTED:664 — REDACTED:664-700 | REDACTED:721-757 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:664` 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 (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) REDACTED:1193 — REDACTED:1193-1228 | src/Controllers/SubscriptionController.php:156-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) REDACTED:88 — REDACTED:88-122 | REDACTED:157-191 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: 96% 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 2 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 (64 lines × 2) · ×1
  • Duplicated block (64 lines × 2) REDACTED:312 — REDACTED:312-375 | REDACTED:394-457 — both copies are in the same file, so extract the 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:312` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:390` calls `error_log` and `REDACTED:311` 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 (31–35 lines × 2) · ×1
  • Duplicated block (31–35 lines × 2) src/Core/RateLimitService.php:208 — src/Core/RateLimitService.php:208-242 | src/Core/RateLimitService.php:250-280 — both copies are in the same file, so extract the 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 (32–35 lines × 2) · ×1
  • Duplicated block (32–35 lines × 2) src/Handlers/SandboxMcp.php:939 — src/Handlers/SandboxMcp.php:939-973 | src/Handlers/SandboxMcp.php:1030-1061 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Handlers/SandboxMcp.php:939` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Handlers/SandboxMcp.php:938` calls `deleteItem` and `src/Handlers/SandboxMcp.php:1028` 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 (28–34 lines × 4) · ×1
  • Duplicated block (28–34 lines × 4) saicms/app/Controllers/UploadController.php:417 — saicms/app/Controllers/UploadController.php:417-444 | saicms/app/Controllers/UploadController.php:795-828 | src/Controllers/UploadController.php:444-471 | src/Controllers/UploadController.php:822-855 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:417` 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 (1–34 lines × 10) · ×1
  • Duplicated block (1–34 lines × 10) saicms/app/Controllers/StoriesController.php:473 — saicms/app/Controllers/StoriesController.php:473-475 | saicms/app/Controllers/UploadController.php:114-114 | saicms/app/Controllers/UploadController.php:122-122 | saicms/app/Controllers/UploadController.php:617-620 | saicms/app/Controllers/UploadController.php:632-665 | src/Controllers/StoriesController.php:498-500 | src/Controllers/UploadController.php:118-118 | src/Controllers/UploadController.php:126-126 | src/Controllers/UploadController.php:644-647 | src/Controllers/UploadController.php:659-692 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:473` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `saicms/app/Controllers/UploadController.php:631` calls `json_last_error`, `is_array`, `isset` and `saicms/app/Controllers/UploadController.php:114` 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 (28–33 lines × 2) · ×1
  • Duplicated block (28–33 lines × 2) src/Controllers/SqRelayController.php:94 — src/Controllers/SqRelayController.php:94-121 | src/Controllers/SqRelayController.php:177-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SqRelayController.php:94` 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) saicms/app/WebSocket/ChatMessageHandler.php:562 — saicms/app/WebSocket/ChatMessageHandler.php:562-593 | saicms/app/WebSocket/ChatMessageHandler.php:610-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `saicms/app/WebSocket/ChatMessageHandler.php:562` 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 (30–31 lines × 3) · ×1
  • Duplicated block (30–31 lines × 3) REDACTED:563 — REDACTED:563-593 | REDACTED:654-684 | REDACTED:745-774 — 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) saicms/app/Controllers/StoriesController.php:48 — saicms/app/Controllers/StoriesController.php:48-78 | src/Controllers/StoriesController.php:66-96 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) src/Core/LLM/UnifiedMcpClient.php:965 — src/Core/LLM/UnifiedMcpClient.php:965-995 | src/Helpers/AdminErrorLogger.php:16-45 — 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. 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 (30 lines × 4) · ×1
  • Duplicated block (30 lines × 4) saicms/app/Controllers/UploadController.php:379 — saicms/app/Controllers/UploadController.php:379-408 | saicms/app/Controllers/UploadController.php:757-786 | src/Controllers/UploadController.php:406-435 | src/Controllers/UploadController.php:784-813 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:379` 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 (27–30 lines × 2) · ×1
  • Duplicated block (27–30 lines × 2) src/Controllers/SandboxController.php:1584 — src/Controllers/SandboxController.php:1584-1613 | src/Controllers/SandboxController.php:1625-1651 — both copies are in the same file, so extract the 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 (23–29 lines × 4) · ×1
  • Duplicated block (23–29 lines × 4) saicms/app/Controllers/StoriesController.php:203 — saicms/app/Controllers/StoriesController.php:203-225 | saicms/app/Controllers/UploadController.php:283-311 | src/Controllers/StoriesController.php:219-241 | src/Controllers/UploadController.php:307-335 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:203` 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 (24–29 lines × 3) · ×1
  • Duplicated block (24–29 lines × 3) src/Handlers/PayMongoHandler.php:213 — src/Handlers/PayMongoHandler.php:213-241 | src/Handlers/PayMongoHandler.php:266-289 | src/Handlers/PayMongoHandler.php:793-819 — 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 (4–29 lines × 6) · ×1
  • Duplicated block (4–29 lines × 6) saicms/app/Controllers/StoriesController.php:447 — saicms/app/Controllers/StoriesController.php:447-450 | saicms/app/Controllers/UploadController.php:82-110 | saicms/app/Controllers/UploadController.php:610-614 | src/Controllers/StoriesController.php:472-475 | src/Controllers/UploadController.php:86-114 | src/Controllers/UploadController.php:637-641 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/UploadController.php:82` 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 (18–29 lines × 2) · ×1
  • Duplicated block (18–29 lines × 2) src/Helpers/LxdSandboxManager.php:1021 — src/Helpers/LxdSandboxManager.php:1021-1038 | src/Helpers/LxdSandboxManager.php:1213-1241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdSandboxManager.php:1021` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Helpers/LxdSandboxManager.php:1039` calls `del` and `src/Helpers/LxdSandboxManager.php:1242` 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 (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) REDACTED:1147 — REDACTED:1147-1174 | src/Controllers/LiveController.php:411-437 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1146` calls `date` and `src/Controllers/LiveController.php:410` 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 (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) REDACTED:337 — REDACTED:337-377 | REDACTED:372-412 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:337` 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 (20–27 lines × 2) · ×1
  • Duplicated block (20–27 lines × 2) REDACTED:501 — REDACTED:501-527 | REDACTED:635-654 — both copies are in the same file, so extract the 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:501` 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–26 lines × 4) · ×1
  • Duplicated block (21–26 lines × 4) saicms/app/Controllers/GroupController.php:169 — saicms/app/Controllers/GroupController.php:169-191 | saicms/app/Controllers/HomeController.php:148-170 | saicms/app/Controllers/ProfileController.php:287-312 | saicms/app/Controllers/SocialController.php:130-150 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.php:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–26 lines × 3) · ×1
  • Duplicated block (21–26 lines × 3) REDACTED:2386 — REDACTED:2386-2410 | src/Controllers/SandboxController.php:1971-1991 | src/Controllers/SandboxController.php:2126-2151 — 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 `REDACTED:2386` 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 (92 lines × 2) · ×1
  • Duplicated block (92 lines × 2) saicms/app/Controllers/StoriesController.php:163 — saicms/app/Controllers/StoriesController.php:163-254 | src/Controllers/StoriesController.php:179-270 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `src/Controllers/StoriesController.php` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 516 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 `saicms/app/Controllers/StoriesController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Controllers/StoriesController.php:272` calls `_app_log` and `saicms/app/Controllers/StoriesController.php:256` 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 (7–26 lines × 2) · ×1
  • Duplicated block (7–26 lines × 2) REDACTED:131 — REDACTED:131-137 | REDACTED:1204-1229 — both copies are in the same file, so extract the 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:131` 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 (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) src/Controllers/SandboxController.php:152 — src/Controllers/SandboxController.php:152-177 | src/Controllers/SandboxController.php:260-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SandboxController.php:152` 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 (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) src/Helpers/LxdSandboxManager.php:2029 — src/Helpers/LxdSandboxManager.php:2029-2054 | src/Helpers/LxdSandboxManager.php:2099-2124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdSandboxManager.php:2029` 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–25 lines × 5) · ×1
  • Duplicated block (19–25 lines × 5) REDACTED:979 — REDACTED:979-997 | saicms/app/Controllers/GroupController.php:208-232 | saicms/app/Controllers/HomeController.php:187-211 | saicms/app/Controllers/SocialController.php:167-186 | REDACTED:1050-1068 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:979` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–25 lines × 4) · ×1
  • Duplicated block (23–25 lines × 4) saicms/app/WebSocket/ChatMessageHandler.php:472 — saicms/app/WebSocket/ChatMessageHandler.php:472-494 | saicms/app/WebSocket/ChatMessageHandler.php:533-556 | saicms/app/WebSocket/ChatMessageHandler.php:574-598 | saicms/app/WebSocket/ChatMessageHandler.php:622-645 — 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 `saicms/app/WebSocket/ChatMessageHandler.php:472` 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, `saicms/app/WebSocket/ChatMessageHandler.php:471` calls `_sendMessageToUser` and `saicms/app/WebSocket/ChatMessageHandler.php:574` 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 (20–25 lines × 2) · ×1
  • Duplicated block (20–25 lines × 2) REDACTED:967 — REDACTED:967-991 | src/Controllers/SandboxController.php:1342-1361 — 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 `REDACTED:967` 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) src/Core/LLM/UnifiedMcpClient.php:1041 — src/Core/LLM/UnifiedMcpClient.php:1041-1065 | src/Core/LLM/UnifiedMcpClient.php:1182-1205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Core/LLM/UnifiedMcpClient.php:1041` 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 (22–24 lines × 3) · ×1
  • Duplicated block (22–24 lines × 3) REDACTED:209 — REDACTED:209-232 | REDACTED:698-720 | REDACTED:1692-1713 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1689` calls `checkExistingUser` and `REDACTED:695` 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 (22–23 lines × 3) · ×1
  • Duplicated block (22–23 lines × 3) src/Helpers/LxdApiClient.php:284 — src/Helpers/LxdApiClient.php:284-305 | src/Helpers/LxdApiClient.php:506-528 | src/Helpers/LxdApiClient.php:539-560 — 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 (2–22 lines × 11) · ×1
  • Duplicated block (2–22 lines × 11) REDACTED:587 — REDACTED:587-605 | saicms/app/Controllers/GroupController.php:251-272 | saicms/app/Controllers/HomeController.php:230-251 | saicms/app/Controllers/ProfileController.php:323-344 | saicms/app/Controllers/SocialController.php:205-226 | REDACTED:355-369 | saicms/app/Controllers/UploadController.php:711-727 | REDACTED:648-666 | src/Controllers/SocialController.php:309-322 | src/Controllers/SocialController.php:323-324 | src/Controllers/UploadController.php:738-754 — there are 11 copies across 10 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 11 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:587` 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 after the matched lines, `src/Controllers/SocialController.php:322` calls `mb_strlen`, `sprintf`, `htmlspecialchars` and `src/Controllers/SocialController.php:324` 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 (21–22 lines × 6) · ×1
  • Duplicated block (21–22 lines × 6) saicms/app/Controllers/UploadController.php:296 — saicms/app/Controllers/UploadController.php:296-316 | saicms/app/Controllers/UploadController.php:486-507 | saicms/app/Controllers/UploadController.php:876-896 | src/Controllers/UploadController.php:320-340 | src/Controllers/UploadController.php:513-534 | src/Controllers/UploadController.php:903-923 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) REDACTED:325 — REDACTED:325-346 | REDACTED:362-383 | REDACTED:399-420 — 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 (24–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) REDACTED:1020 — REDACTED:1020-1046 | src/Controllers/LiveController.php:490-513 — 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 (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) saicms/app/Controllers/ChatController.php:244 — saicms/app/Controllers/ChatController.php:244-265 | saicms/app/Controllers/ChatController.php:267-288 — both copies are in the same file, so extract the 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 `saicms/app/Controllers/ChatController.php:244` 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–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) src/Playground/MessengerServer.php:244 — src/Playground/MessengerServer.php:244-265 | src/Playground/MessengerServer.php:275-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–21 lines × 5) · ×1
  • Duplicated block (16–21 lines × 5) saicms/app/Controllers/StoriesController.php:366 — saicms/app/Controllers/StoriesController.php:366-381 | REDACTED:305-325 | saicms/app/Controllers/UploadController.php:672-689 | src/Controllers/StoriesController.php:391-406 | src/Controllers/UploadController.php:699-716 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (35–37 lines × 4) · ×1
  • Duplicated block (35–37 lines × 4) REDACTED:639 — REDACTED:639-675 | REDACTED:738-772 | REDACTED:696-732 | REDACTED:806-840 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:733` calls `trim` and `REDACTED:633` 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.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×1
  • Duplicated block (21 lines × 4) saicms/app/Controllers/UploadController.php:336 — saicms/app/Controllers/UploadController.php:336-356 | saicms/app/Controllers/UploadController.php:529-549 | src/Controllers/UploadController.php:363-383 | src/Controllers/UploadController.php:556-576 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:336` 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–21 lines × 3) · ×1
  • Duplicated block (19–21 lines × 3) saicms/app/Controllers/GroupController.php:53 — saicms/app/Controllers/GroupController.php:53-73 | saicms/app/Controllers/HomeController.php:32-52 | saicms/app/Controllers/SocialController.php:29-47 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.php:53` 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 (15–21 lines × 3) · ×1
  • Duplicated block (15–21 lines × 3) REDACTED:237 — REDACTED:237-257 | saicms/app/Controllers/UploadController.php:317-331 | src/Controllers/UploadController.php:341-358 — 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:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:259` calls `error_log` and `saicms/app/Controllers/UploadController.php:332` 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 (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) saicms/app/Controllers/ChatController.php:316 — saicms/app/Controllers/ChatController.php:316-335 | saicms/app/Controllers/ChatController.php:340-360 — both copies are in the same file, so extract the 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 `saicms/app/Controllers/ChatController.php:316` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `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 before the matched lines, `saicms/app/Controllers/ChatController.php:315` calls `getCode` and `saicms/app/Controllers/ChatController.php:339` 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.
D4 · Code Duplication · Duplicated block (10–20 lines × 8) · ×1
  • Duplicated block (10–20 lines × 8) saicms/app/Controllers/StoriesController.php:200 — saicms/app/Controllers/StoriesController.php:200-209 | saicms/app/Controllers/UploadController.php:279-291 | saicms/app/Controllers/UploadController.php:459-471 | saicms/app/Controllers/UploadController.php:843-862 | src/Controllers/StoriesController.php:216-225 | src/Controllers/UploadController.php:303-315 | src/Controllers/UploadController.php:486-498 | src/Controllers/UploadController.php:870-889 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:200` 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 (13–20 lines × 6) · ×1
  • Duplicated block (13–20 lines × 6) saicms/app/Controllers/UploadController.php:237 — saicms/app/Controllers/UploadController.php:237-249 | saicms/app/Controllers/UploadController.php:419-432 | saicms/app/Controllers/UploadController.php:797-816 | src/Controllers/UploadController.php:261-273 | src/Controllers/UploadController.php:446-459 | src/Controllers/UploadController.php:824-843 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–20 lines × 3) · ×1
  • Duplicated block (17–20 lines × 3) REDACTED:158 — REDACTED:158-174 | REDACTED:516-535 | REDACTED:188-204 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) REDACTED:363 — REDACTED:363-382 | REDACTED:547-566 | REDACTED:604-623 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:385` calls `shell_exec`, `json_decode` and `REDACTED:568` 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 (11–19 lines × 5) · ×1
  • Duplicated block (11–19 lines × 5) saicms/app/Controllers/GroupController.php:171 — saicms/app/Controllers/GroupController.php:171-186 | saicms/app/Controllers/HomeController.php:150-165 | saicms/app/Controllers/ProfileController.php:289-307 | saicms/app/Controllers/SocialController.php:132-145 | src/Controllers/SocialController.php:195-205 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/GroupController.php:171` 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 (14–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) src/Helpers/B2Helper.php:160 — src/Helpers/B2Helper.php:160-178 | src/Helpers/B2Helper.php:223-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/B2Helper.php:160` 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 (17–18 lines × 4) · ×1
  • Duplicated block (17–18 lines × 4) REDACTED:1600 — REDACTED:1600-1617 | saicms/app/Controllers/ProfileController.php:590-606 | saicms/app/Controllers/ProfileController.php:746-762 | saicms/app/Controllers/ProfileController.php:817-833 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1600` 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–18 lines × 3) · ×1
  • Duplicated block (9–18 lines × 3) REDACTED:563 — REDACTED:563-580 | REDACTED:673-682 | saicms/app/Controllers/SmartFiController.php:128-136 — 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 `REDACTED:563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) REDACTED:791 — REDACTED:791-809 | src/Helpers/SandboxManager.php:172-189 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/SandboxManager.php:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) src/Handlers/PayMongoHandler.php:330 — src/Handlers/PayMongoHandler.php:330-347 | src/Handlers/PayMongoHandler.php:393-408 — both copies are in the same file, so extract the 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 (10–17 lines × 2) · ×1
  • Duplicated block (10–17 lines × 2) saicms/app/Controllers/ChatController.php:663 — saicms/app/Controllers/ChatController.php:663-672 | saicms/app/Controllers/ChatController.php:1848-1864 — both copies are in the same file, so extract the 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 `saicms/app/Controllers/ChatController.php:663` 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 (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) REDACTED:828 — REDACTED:828-844 | REDACTED:898-911 — both copies are in the same file, so extract the 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:828` 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) src/Controllers/SandboxController.php:1533 — src/Controllers/SandboxController.php:1533-1549 | src/Controllers/SandboxController.php:1896-1911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SandboxController.php:1533` 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 (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) src/Services/MallCommerceService.php:1088 — src/Services/MallCommerceService.php:1088-1104 | src/Services/MallCommerceService.php:1347-1359 — both copies are in the same file, so extract the 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 (12–16 lines × 5) · ×1
  • Duplicated block (12–16 lines × 5) REDACTED:156 — REDACTED:156-169 | REDACTED:514-529 | REDACTED:707-718 | REDACTED:833-844 | REDACTED:186-199 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:183` calls `requireAuth` and `REDACTED:153` 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.
D4 · Code Duplication · Duplicated block (13–16 lines × 5) · ×1
  • Duplicated block (13–16 lines × 5) saicms/app/Controllers/GroupController.php:124 — saicms/app/Controllers/GroupController.php:124-136 | saicms/app/Controllers/HomeController.php:103-115 | saicms/app/Controllers/ProfileController.php:254-269 | saicms/app/Controllers/SocialController.php:93-105 | src/Controllers/SocialController.php:139-151 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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 `saicms/app/Controllers/ProfileController.php:254` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–16 lines × 4) · ×1
  • Duplicated block (13–16 lines × 4) REDACTED:162 — REDACTED:162-174 | REDACTED:520-535 | REDACTED:192-204 | REDACTED:549-564 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:543` calls `deletePost`, `header`, `requireAuth` and `REDACTED:159` 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 (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) REDACTED:234 — REDACTED:234-249 | REDACTED:343-358 | REDACTED:676-691 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:234` 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 (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) REDACTED:334 — REDACTED:334-349 | REDACTED:416-431 | REDACTED:648-662 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:334` 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 (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) REDACTED:172 — REDACTED:172-187 | src/Controllers/LiveController.php:546-559 — 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 (94 lines × 2) · ×1
  • Duplicated block (94 lines × 2) saicms/app/Controllers/UploadController.php:69 — saicms/app/Controllers/UploadController.php:69-162 | src/Controllers/UploadController.php:73-166 — before extracting anything, compare `saicms/app/Controllers/UploadController.php` and `src/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 797 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 `saicms/app/Controllers/UploadController.php:69` 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 (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) src/Helpers/B2Helper.php:132 — src/Helpers/B2Helper.php:132-147 | src/Helpers/B2Helper.php:205-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/B2Helper.php:132` 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 (13–15 lines × 7) · ×1
  • Duplicated block (13–15 lines × 7) REDACTED:88 — REDACTED:88-102 | REDACTED:172-185 | REDACTED:210-223 | REDACTED:1644-1656 | REDACTED:1687-1699 | REDACTED:1746-1758 | REDACTED:1855-1867 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) REDACTED:181 — REDACTED:181-195 | src/Controllers/SandboxController.php:387-401 | src/Controllers/SandboxController.php:518-532 | src/Controllers/SandboxController.php:590-604 | src/Controllers/SandboxController.php:1121-1135 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:181` 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 (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) saicms/app/Controllers/WebhookController.php:200 — saicms/app/Controllers/WebhookController.php:200-214 | saicms/app/Controllers/WebhookController.php:243-257 | src/Controllers/WebhookController.php:214-228 | src/Controllers/WebhookController.php:257-271 — before extracting anything, compare `saicms/app/Controllers/WebhookController.php` and `src/Controllers/WebhookController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 375 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 `saicms/app/Controllers/WebhookController.php:200` 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 (16–17 lines × 4) · ×1
  • Duplicated block (16–17 lines × 4) src/Controllers/SandboxController.php:1528 — src/Controllers/SandboxController.php:1528-1544 | src/Controllers/SandboxController.php:1678-1693 | src/Controllers/SandboxController.php:1761-1776 | src/Controllers/SandboxController.php:1891-1906 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SandboxController.php:1528` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/SandboxController.php:1673` calls `openwebuiStart`, `header` and `src/Controllers/SandboxController.php:1525` 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 (12–15 lines × 3) · ×1
  • Duplicated block (12–15 lines × 3) REDACTED:1023 — REDACTED:1023-1037 | REDACTED:1057-1070 | src/Controllers/LiveController.php:493-504 — 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 `REDACTED:1023` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) REDACTED:190 — REDACTED:190-204 | REDACTED:520-533 | REDACTED:719-731 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:188` calls `session_status`, `session_start` and `REDACTED:718` 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 (12–14 lines × 7) · ×1
  • Duplicated block (12–14 lines × 7) REDACTED:31 — REDACTED:31-42 | REDACTED:73-86 | REDACTED:171-184 | REDACTED:271-283 | REDACTED:488-501 | REDACTED:576-589 | REDACTED:628-641 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–14 lines × 7) · ×1
  • Duplicated block (11–14 lines × 7) REDACTED:225 — REDACTED:225-238 | REDACTED:353-364 | REDACTED:439-449 | REDACTED:514-524 | REDACTED:588-598 | REDACTED:720-730 | REDACTED:791-801 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:223` calls `empty` and `REDACTED:352` 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 (12–14 lines × 5) · ×1
  • Duplicated block (12–14 lines × 5) REDACTED:652 — REDACTED:652-665 | REDACTED:750-762 | REDACTED:576-587 | REDACTED:709-722 | REDACTED:818-830 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 4) · ×1
  • Duplicated block (13–14 lines × 4) REDACTED:717 — REDACTED:717-730 | REDACTED:882-895 | REDACTED:975-987 | REDACTED:1039-1052 — 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 (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) REDACTED:309 — REDACTED:309-322 | REDACTED:1374-1386 | saicms/app/Controllers/RewardsController.php:51-64 — 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 `REDACTED:309` 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 (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) REDACTED:1275 — REDACTED:448-459 | REDACTED:1275-1288 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:448` 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.
D4 · Code Duplication · Duplicated block (4–14 lines × 3) · ×1
  • Duplicated block (4–14 lines × 3) src/Services/MallCommerceService.php:1739 — src/Services/MallCommerceService.php:1739-1742 | src/Services/MallCommerceService.php:1787-1800 | src/Services/MallCommerceService.php:1811-1824 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/MallCommerceService.php:1787` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Services/MallCommerceService.php:1787` calls `htmlspecialchars`, `trim` and `src/Services/MallCommerceService.php:1739` 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 (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) src/Helpers/LxdSandboxManager.php:1895 — src/Helpers/LxdSandboxManager.php:1895-1907 | src/Helpers/LxdSandboxManager.php:1940-1952 | src/Helpers/LxdSandboxManager.php:1983-1995 | src/Helpers/LxdSandboxManager.php:2026-2038 | src/Helpers/LxdSandboxManager.php:2096-2108 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Helpers/LxdSandboxManager.php:1895` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Helpers/LxdSandboxManager.php:2039` calls `str_replace`, `ltrim` and `src/Helpers/LxdSandboxManager.php:1908` 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 (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) REDACTED:623 — REDACTED:623-633 | REDACTED:840-852 | REDACTED:911-923 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:623` 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 (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) src/Controllers/UserController.php:759 — src/Controllers/UserController.php:759-775 | src/Controllers/UserController.php:858-874 | src/Controllers/UserController.php:922-938 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/UserController.php:759` 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–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) REDACTED:857 — REDACTED:857-869 | REDACTED:992-1002 — both copies are in the same file, so extract the 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:857` 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 (3–13 lines × 7) · ×1
  • Duplicated block (3–13 lines × 7) REDACTED:114 — REDACTED:114-116 | REDACTED:150-162 | REDACTED:170-172 | REDACTED:190-192 | REDACTED:210-212 | REDACTED:231-243 | REDACTED:251-253 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 (11–12 lines × 8) · ×1
  • Duplicated block (11–12 lines × 8) REDACTED:83 — REDACTED:83-94 | REDACTED:280-291 | REDACTED:498-509 | REDACTED:586-597 | REDACTED:638-649 | REDACTED:197-208 | REDACTED:527-537 | REDACTED:725-735 — there are 8 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) REDACTED:204 — REDACTED:204-215 | REDACTED:812-825 | REDACTED:959-971 | REDACTED:234-245 | REDACTED:887-900 | REDACTED:1030-1042 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 4) · ×1
  • Duplicated block (10–11 lines × 4) saicms/app/Controllers/StoriesController.php:151 — saicms/app/Controllers/StoriesController.php:151-161 | REDACTED:175-185 | saicms/app/Controllers/UploadController.php:235-244 | src/Controllers/UploadController.php:259-268 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:151` 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 (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) REDACTED:135 — REDACTED:135-145 | REDACTED:560-569 | REDACTED:617-626 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:135` 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 (4–10 lines × 4) · ×1
  • Duplicated block (4–10 lines × 4) REDACTED:217 — REDACTED:217-226 | src/Controllers/LiveController.php:109-115 | src/Controllers/LiveController.php:154-166 | src/Controllers/LiveController.php:1100-1103 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:217` 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 (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) src/Controllers/LiveController.php:721 — src/Controllers/LiveController.php:721-729 | src/Controllers/LiveController.php:740-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/LiveController.php:721` 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 (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) src/Helpers/B2Helper.php:141 — src/Helpers/B2Helper.php:141-149 | src/Helpers/B2Helper.php:172-180 | src/Helpers/B2Helper.php:212-218 | src/Helpers/B2Helper.php:232-238 — 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 (4–9 lines × 9) · ×1
  • Duplicated block (4–9 lines × 9) REDACTED:577 — REDACTED:577-585 | saicms/app/Controllers/GroupController.php:245-249 | saicms/app/Controllers/HomeController.php:224-228 | saicms/app/Controllers/ProfileController.php:317-321 | saicms/app/Controllers/SocialController.php:199-203 | REDACTED:350-353 | saicms/app/Controllers/UploadController.php:705-709 | REDACTED:638-646 | src/Controllers/UploadController.php:732-736 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:577` 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 (2–9 lines × 5) · ×1
  • Duplicated block (2–9 lines × 5) REDACTED:518 — REDACTED:518-519 | REDACTED:526-527 | REDACTED:1139-1147 | REDACTED:1210-1218 | src/Controllers/SocialController.php:514-516 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1139` 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, `REDACTED:1135` calls `isset` and `src/Controllers/SocialController.php:511` 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–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) REDACTED:810 — REDACTED:810-817 | src/Core/LLM/ProviderRegistry.php:564-572 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:810` 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 (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) src/Handlers/ImageGenHandler.php:480 — src/Handlers/ImageGenHandler.php:480-486 | src/Handlers/ImageGenHandler.php:809-817 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) REDACTED:89 — REDACTED:89-96 | REDACTED:198-205 | REDACTED:286-293 | REDACTED:504-511 | REDACTED:592-599 | REDACTED:644-651 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) saicms/app/Controllers/GroupController.php:71 — saicms/app/Controllers/GroupController.php:71-79 | saicms/app/Controllers/HomeController.php:50-58 | saicms/app/Controllers/ProfileController.php:199-207 | saicms/app/Controllers/SocialController.php:45-52 | src/Controllers/SocialController.php:72-79 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `saicms/app/Controllers/ProfileController.php:197` calls `json_decode`, `file_get_contents` and `saicms/app/Controllers/GroupController.php:69` 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) REDACTED:563 — REDACTED:563-570 | REDACTED:622-628 | REDACTED:672-678 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–8 lines × 3) · ×1
  • Duplicated block (4–8 lines × 3) REDACTED:1449 — REDACTED:1449-1452 | REDACTED:1679-1686 | REDACTED:1743-1750 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1449` 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 (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) src/Controllers/SellerController.php:355 — src/Controllers/SellerController.php:355-362 | src/Controllers/SellerController.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.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) src/Playground/FixedPtyServer.php:119 — src/Playground/FixedPtyServer.php:119-126 | src/Playground/PtyServer.php:311-316 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Playground/FixedPtyServer.php:119` 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) REDACTED:214 — REDACTED:214-220 | REDACTED:301-307 | REDACTED:329-335 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–7 lines × 6) · ×1
  • Duplicated block (4–7 lines × 6) src/Controllers/SitesController.php:292 — src/Controllers/SitesController.php:292-295 | src/Controllers/SitesController.php:304-307 | src/Controllers/SitesController.php:317-320 | src/Controllers/SitesController.php:330-333 | src/Controllers/SitesController.php:381-387 | src/Controllers/SitesController.php:595-601 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/SitesController.php:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Controllers/SitesController.php:380` calls `json_decode`, `file_get_contents`, `validateCsrfToken` and `src/Controllers/SitesController.php:292` 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) src/Services/SilverQueenEngine.php:662 — src/Services/SilverQueenEngine.php:662-668 | src/Services/SilverQueenEngine.php:810-815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Services/SilverQueenEngine.php:662` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 8) · ×1
  • Duplicated block (6 lines × 8) REDACTED:89 — REDACTED:89-94 | REDACTED:198-203 | REDACTED:286-291 | REDACTED:504-509 | REDACTED:592-597 | REDACTED:644-649 | REDACTED:532-537 | REDACTED:730-735 — there are 8 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) REDACTED:819 — REDACTED:819-828 | REDACTED:1099-1108 | src/Controllers/PaymentsAdminController.php:201-206 | REDACTED:320-325 | src/Controllers/ReferralLinksAdminController.php:23-28 | REDACTED:456-461 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 414 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 `REDACTED:819` 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 (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) REDACTED:238 — REDACTED:238-243 | REDACTED:450-455 | REDACTED:774-779 | REDACTED:823-828 | REDACTED:987-992 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:234` calls `requireAdmin` and `REDACTED:981` 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) REDACTED:310 — REDACTED:310-315 | REDACTED:447-452 | REDACTED:343-348 | REDACTED:480-485 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:444` calls `filter_input` and `REDACTED:309` 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.
D4 · Code Duplication · Duplicated block (5–7 lines × 4) · ×1
  • Duplicated block (5–7 lines × 4) REDACTED:2019 — REDACTED:2019-2023 | src/Controllers/UserController.php:771-777 | src/Controllers/UserController.php:870-876 | src/Controllers/UserController.php:934-940 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2019` 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 (1–6 lines × 6) · ×1
  • Duplicated block (1–6 lines × 6) saicms/app/Controllers/StoriesController.php:453 — saicms/app/Controllers/StoriesController.php:453-455 | saicms/app/Controllers/StoriesController.php:464-469 | saicms/app/Controllers/UploadController.php:124-124 | src/Controllers/StoriesController.php:478-480 | src/Controllers/StoriesController.php:489-494 | src/Controllers/UploadController.php:128-128 — before extracting anything, compare `saicms/app/Controllers/StoriesController.php` and `saicms/app/Controllers/UploadController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 238 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 `saicms/app/Controllers/StoriesController.php:464` 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, `saicms/app/Controllers/StoriesController.php:463` calls `json_last_error`, `is_array`, `isset` and `saicms/app/Controllers/StoriesController.php:453` 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 (3–6 lines × 4) · ×1
  • Duplicated block (3–6 lines × 4) REDACTED:121 — REDACTED:121-123 | REDACTED:1144-1149 | REDACTED:1200-1205 | REDACTED:1348-1350 — 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 `REDACTED:1144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1144` calls `empty`, `redirect`, `urlencode` and `REDACTED:121` 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 (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) REDACTED:156 — REDACTED:156-166 | REDACTED:257-261 | REDACTED:303-307 | REDACTED:436-440 | REDACTED:514-524 | REDACTED:707-716 | REDACTED:833-842 | REDACTED:1037-1041 | REDACTED:186-196 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 40 separate duplicated blocks between them, totalling at least 1037 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:183` calls `requireAuth` and `REDACTED:153` 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.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) src/Handlers/PayMongoHandler.php:155 — src/Handlers/PayMongoHandler.php:155-159 | src/Handlers/PayMongoHandler.php:230-234 | src/Handlers/PayMongoHandler.php:277-281 | src/Handlers/PayMongoHandler.php:320-324 | src/Handlers/PayMongoHandler.php:374-378 | src/Handlers/PayMongoHandler.php:756-760 | src/Handlers/PayMongoHandler.php:808-812 | src/Handlers/PayMongoHandler.php:854-858 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) REDACTED:314 — REDACTED:314-318 | saicms/app/Controllers/GroupController.php:84-92 | saicms/app/Controllers/HomeController.php:63-71 | saicms/app/Controllers/ProfileController.php:212-220 | saicms/app/Controllers/SocialController.php:57-65 | REDACTED:347-351 | src/Controllers/SocialController.php:84-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:314` 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 lines × 6) · ×1
  • Duplicated block (5 lines × 6) REDACTED:992 — REDACTED:992-997 | saicms/app/Controllers/GroupController.php:228-232 | saicms/app/Controllers/HomeController.php:207-211 | saicms/app/Controllers/ProfileController.php:517-524 | saicms/app/Controllers/SocialController.php:182-186 | REDACTED:1063-1068 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:992` 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 (3–5 lines × 5) · ×1
  • Duplicated block (3–5 lines × 5) REDACTED:239 — REDACTED:239-243 | REDACTED:593-597 | REDACTED:850-854 | src/Playground/LtradingServer.php:438-440 | src/Services/GtbStrategy.php:520-524 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Playground/LtradingServer.php:436` calls `foreach`, `str_ends_with` and `REDACTED:850` 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 (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) REDACTED:198 — REDACTED:198-202 | REDACTED:279-282 | REDACTED:318-322 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:197` calls `guardJson`, `isElevated`, `http_response_code` and `REDACTED:279` 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 (3–11 lines × 9) · ×1
  • Duplicated block (3–11 lines × 9) src/Controllers/CategoriesController.php:13 — src/Controllers/CategoriesController.php:13-15 | src/Controllers/MediaController.php:13-15 | src/Controllers/MenusController.php:13-23 | REDACTED:13-21 | src/Controllers/PluginsController.php:13-15 | src/Controllers/PostsController.php:13-15 | src/Controllers/SettingsController.php:13-15 | src/Controllers/TagsController.php:13-15 | src/Controllers/ThemesController.php:13-23 — 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 9 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/MenusController.php:13` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) saicms/app/Controllers/AuthController.php:68 — saicms/app/Controllers/AuthController.php:68-83 | saicms/app/Controllers/GroupController.php:28-43 | saicms/app/Controllers/MarketPlaceController.php:19-34 | saicms/app/Controllers/SmartFiController.php:37-45 | saicms/app/Controllers/SmartFiController.php:49-57 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) saicms/app/Controllers/GroupController.php:440 — saicms/app/Controllers/GroupController.php:440-463 | saicms/app/Controllers/HomeController.php:419-442 | saicms/app/Controllers/SocialController.php:372-395 | src/Controllers/SocialController.php:470-486 — before extracting anything, compare `saicms/app/Controllers/GroupController.php` and `saicms/app/Controllers/HomeController.php` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 470 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) REDACTED:14 — REDACTED:14-21 | REDACTED:16-23 | REDACTED:16-23 | src/Controllers/LiveController.php:25-32 | REDACTED:16-23 | src/Controllers/SandboxController.php:20-27 | src/Controllers/SubscriptionController.php:16-23 — 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 7 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) src/Controllers/CourseController.php:50 — src/Controllers/CourseController.php:50-58 | src/Controllers/CourseController.php:82-88 | src/Controllers/CourseController.php:127-133 | src/Controllers/MasterclassController.php:52-60 | src/Controllers/MasterclassController.php:84-90 | src/Controllers/MasterclassController.php:398-408 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/CourseController.php:50` 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 × 9) · ×1
  • Duplicated block (7 lines × 9) src/Controllers/CourseController.php:96 — src/Controllers/CourseController.php:96-102 | src/Controllers/CourseController.php:252-258 | src/Controllers/CourseController.php:314-320 | src/Controllers/CourseController.php:443-451 | src/Controllers/CourseController.php:459-467 | src/Controllers/MasterclassController.php:98-104 | src/Controllers/MasterclassController.php:243-249 | src/Controllers/MasterclassController.php:341-349 | src/Controllers/MasterclassController.php:357-365 — before extracting anything, compare `src/Controllers/CourseController.php` and `src/Controllers/MasterclassController.php` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Controllers/CourseController.php:96` 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.
P1 · CI/CD gates · No CI pipeline · ×1
  • No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 132 plain JS — the untyped files are REDACTED, public/assets/bible/js/main.js, REDACTED, public/assets/bible/js/script-fade.js, public/assets/bible/js/script.js, public/assets/bible/js/script_colapse.js (+126 more).
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (42 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (42 clone groups) public/assets/client/js/notifications.js:3 — 42 of the duplicated blocks reported below have copies in at least two of the sibling directories public, saicms, tools under the repository root. That concentration is one structural fact, not 42 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 42 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 (1026 identical lines × 2 files) · ×1
  • Wholesale file copy (1026 identical lines × 2 files) public/assets/client/js/notifications.js:3 — public/assets/client/js/notifications.js:3 · saicms/public/assets/client/js/notifications.js:3 — these 2 files are line-for-line copies of one another — 1026 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 (864 lines × 2 locations) · ×1
  • Duplicated block (864 lines × 2 locations) public/assets/client/js/feedmanager.js:1718 — public/assets/client/js/feedmanager.js:1718 · saicms/public/assets/client/js/feedmanager.js:1718 — 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 · Wholesale file copy (780 identical lines × 2 files) · ×1
  • Wholesale file copy (780 identical lines × 2 files) public/assets/client/js/mediamanager.js:2 — public/assets/client/js/mediamanager.js:2 · saicms/public/assets/client/js/mediamanager.js:2 — these 2 files are line-for-line copies of one another — 780 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 · Wholesale file copy (747 identical lines × 2 files) · ×1
  • Wholesale file copy (747 identical lines × 2 files) public/assets/client/js/F.js:2 — public/assets/client/js/F.js:2 · saicms/public/assets/client/js/F.js:2 — these 2 files are line-for-line copies of one another — 747 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 · Wholesale file copy (709 identical lines × 2 files) · ×1
  • Wholesale file copy (709 identical lines × 2 files) public/assets/client/js/headmanager.js:2 — public/assets/client/js/headmanager.js:2 · saicms/public/assets/client/js/headmanager.js:2 — these 2 files are line-for-line copies of one another — 709 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 (703 lines × 2 locations) · ×1
  • Duplicated block (703 lines × 2 locations) public/assets/client/js/typeahead-chat.js:1747 — public/assets/client/js/typeahead-chat.js:1747 · saicms/public/assets/client/js/typeahead-chat.js:1700 — 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 · Wholesale file copy (673 identical lines × 2 files) · ×1
  • Wholesale file copy (673 identical lines × 2 files) public/assets/client/js/profile.js:12 — public/assets/client/js/profile.js:12 · saicms/public/assets/client/js/profile.js:12 — these 2 files are line-for-line copies of one another — 673 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 · Wholesale file copy (532 identical lines × 2 files) · ×1
  • Wholesale file copy (532 identical lines × 2 files) REDACTED:17 — REDACTED:17 · REDACTED:17 — these 2 files are line-for-line copies of one another — 532 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 · Wholesale file copy (521 identical lines × 2 files) · ×1
  • Wholesale file copy (521 identical lines × 2 files) public/assets/client/js/stories.js:3 — public/assets/client/js/stories.js:3 · saicms/public/assets/client/js/stories.js:3 — these 2 files are line-for-line copies of one another — 521 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 (483 lines × 2 locations) · ×1
  • Duplicated block (483 lines × 2 locations) public/assets/client/js/typeahead-chat.js:2661 — public/assets/client/js/typeahead-chat.js:2661 · saicms/public/assets/client/js/typeahead-chat.js:2614 — 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 (385 identical lines × 2 files) · ×1
  • Wholesale file copy (385 identical lines × 2 files) public/assets/client/js/smartfed.js:2 — public/assets/client/js/smartfed.js:2 · saicms/public/assets/client/js/smartfed.js:2 — these 2 files are line-for-line copies of one another — 385 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 (383 lines × 2 locations) · ×1
  • Duplicated block (383 lines × 2 locations) public/assets/client/js/feedmanager.js:1182 — public/assets/client/js/feedmanager.js:1182 · saicms/public/assets/client/js/feedmanager.js:1182 — 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 (381 lines × 2 locations) · ×1
  • Duplicated block (381 lines × 2 locations) public/assets/client/js/typeahead-chat.js:292 — public/assets/client/js/typeahead-chat.js:292 · saicms/public/assets/client/js/typeahead-chat.js:245 — 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 (365 lines × 2 locations) · ×1
  • Duplicated block (365 lines × 2 locations) public/assets/client/js/typeahead-chat.js:1070 — public/assets/client/js/typeahead-chat.js:1070 · saicms/public/assets/client/js/typeahead-chat.js:1023 — 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 (343 identical lines × 2 files) · ×1
  • Wholesale file copy (343 identical lines × 2 files) public/assets/gaming/typing/js/typing.js:1 — public/assets/gaming/typing/js/typing.js:1 · saicms/public/assets/gaming/typing/js/typing.js:1 — these 2 files are line-for-line copies of one another — 343 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 · Wholesale file copy (332 identical lines × 2 files) · ×1
  • Wholesale file copy (332 identical lines × 2 files) public/assets/client/js/dashboard.js:1 — public/assets/client/js/dashboard.js:1 · saicms/public/assets/client/js/dashboard.js:1 — these 2 files are line-for-line copies of one another — 332 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 (306 lines × 2 locations) · ×1
  • Duplicated block (306 lines × 2 locations) public/assets/client/js/typeahead-chat.js:3353 — public/assets/client/js/typeahead-chat.js:3353 · saicms/public/assets/client/js/typeahead-chat.js:3306 — 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 (283 lines × 2 locations) · ×1
  • Duplicated block (283 lines × 2 locations) public/assets/js/editor-chat.js:4108 — public/assets/js/editor-chat.js:4108 · REDACTED:4630 — 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 (279 lines × 2 locations) · ×1
  • Duplicated block (279 lines × 2 locations) public/assets/client/js/feedmanager.js:437 — public/assets/client/js/feedmanager.js:437 · saicms/public/assets/client/js/feedmanager.js:437 — 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 (250 lines × 2 locations) · ×1
  • Duplicated block (250 lines × 2 locations) public/assets/js/editor-chat.js:1448 — public/assets/js/editor-chat.js:1448 · REDACTED:2027 — 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 (220 lines × 2 locations) · ×1
  • Duplicated block (220 lines × 2 locations) public/assets/client/js/typeahead-chat.js:842 — public/assets/client/js/typeahead-chat.js:842 · saicms/public/assets/client/js/typeahead-chat.js:795 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (213 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (213 matched lines × 2 locations) public/assets/client/js/typeahead-chat.js:1 — public/assets/client/js/typeahead-chat.js:1 · saicms/public/assets/client/js/typeahead-chat.js:1 — the two spans are one implementation copied and then locally edited — 1780 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 · Wholesale file copy (197 identical lines × 2 files) · ×1
  • Wholesale file copy (197 identical lines × 2 files) public/assets/silverqueen/login-story.js:1 — public/assets/silverqueen/login-story.js:1 · public/assets/silverqueen/story.js:1 — these 2 files are line-for-line copies of one another — 197 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 · Wholesale file copy (194 identical lines × 2 files) · ×1
  • Wholesale file copy (194 identical lines × 2 files) public/assets/client/js/gaming/webtypist.js:1 — public/assets/client/js/gaming/webtypist.js:1 · saicms/public/assets/client/js/gaming/webtypist.js:1 — these 2 files are line-for-line copies of one another — 194 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 (170 lines × 2 locations) · ×1
  • Duplicated block (170 lines × 2 locations) public/assets/js/editor-chat.js:3108 — public/assets/js/editor-chat.js:3108 · REDACTED:3516 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (166 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (166 matched lines × 2 locations) public/assets/js/chat.js:1658 — public/assets/js/chat.js:1658 · public/assets/js/chat/conversation.js:41 — the two spans are one implementation copied and then locally edited — 1174 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 (165 lines × 2 locations) · ×1
  • Duplicated block (165 lines × 2 locations) public/assets/client/js/typeahead-chat.js:3166 — public/assets/client/js/typeahead-chat.js:3166 · saicms/public/assets/client/js/typeahead-chat.js:3119 — 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 (164 identical lines × 2 files) · ×1
  • Wholesale file copy (164 identical lines × 2 files) public/assets/client/js/contacts.js:4 — public/assets/client/js/contacts.js:4 · saicms/public/assets/client/js/contacts.js:4 — these 2 files are line-for-line copies of one another — 164 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 (148 lines × 2 locations) · ×1
  • Duplicated block (148 lines × 2 locations) public/assets/js/editor-chat.js:2774 — public/assets/js/editor-chat.js:2774 · REDACTED:3177 — 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 (147 lines × 2 locations) · ×1
  • Duplicated block (147 lines × 2 locations) public/assets/js/editor-chat.js:2573 — public/assets/js/editor-chat.js:2573 · REDACTED:2981 — 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 (146 lines × 2 locations) · ×1
  • Duplicated block (146 lines × 2 locations) public/assets/client/js/feedmanager.js:800 — public/assets/client/js/feedmanager.js:800 · saicms/public/assets/client/js/feedmanager.js:800 — 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 (135 lines × 2 locations) · ×1
  • Duplicated block (135 lines × 2 locations) public/assets/js/editor-chat.js:3937 — public/assets/js/editor-chat.js:3937 · REDACTED:4459 — 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 (124 lines × 2 locations) · ×1
  • Duplicated block (124 lines × 2 locations) public/assets/client/js/feedmanager.js:83 — public/assets/client/js/feedmanager.js:83 · saicms/public/assets/client/js/feedmanager.js:83 — 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 (121 lines × 2 locations) · ×1
  • Duplicated block (121 lines × 2 locations) public/assets/js/editor-chat.js:1825 — public/assets/js/editor-chat.js:1825 · REDACTED:2404 — 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 with local edits (108 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (108 matched lines × 2 locations) public/assets/js/chat.js:1440 — public/assets/js/chat.js:1440 · public/assets/js/chat/code-blocks.js:438 — the two spans are one implementation copied and then locally edited — 686 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 (105 lines × 2 locations) · ×1
  • Duplicated block (105 lines × 2 locations) public/assets/js/editor-chat.js:3791 — public/assets/js/editor-chat.js:3791 · REDACTED:4313 — 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 (100 lines × 2 locations) · ×1
  • Duplicated block (100 lines × 2 locations) public/assets/js/chat.js:805 — public/assets/js/chat.js:805 · public/assets/js/chat/markdown.js:252 — 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.
R2 · Cyclomatic Complexity · Complex function streamWebSearch (cyclomatic 309, cognitive 751) · ×1
  • Complex function streamWebSearch (cyclomatic 309, cognitive 751) public/assets/js/chat.js:4370 — streamWebSearch has cyclomatic complexity 309 and cognitive complexity 751; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 sendMessage (cyclomatic 286, cognitive 718) · ×1
  • Complex function sendMessage (cyclomatic 286, cognitive 718) REDACTED:3392 — sendMessage has cyclomatic complexity 286 and cognitive complexity 718; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 sendMessage (cyclomatic 227, cognitive 570) · ×1
  • Complex function sendMessage (cyclomatic 227, cognitive 570) public/assets/js/editor-chat.js:2989 — sendMessage has cyclomatic complexity 227 and cognitive complexity 570; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 formatToolResult (cyclomatic 127, cognitive 159) · ×1
  • Complex function formatToolResult (cyclomatic 127, cognitive 159) public/assets/js/chat.js:5899 — formatToolResult has cyclomatic complexity 127 and cognitive complexity 159; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 loadFile (cyclomatic 105, cognitive 172) · ×1
  • Complex function loadFile (cyclomatic 105, cognitive 172) REDACTED:5368 — loadFile has cyclomatic complexity 105 and cognitive complexity 172; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 fetchMcpDiscover (cyclomatic 78, cognitive 195) · ×1
  • Complex function fetchMcpDiscover (cyclomatic 78, cognitive 195) public/assets/js/chat.js:2457 — fetchMcpDiscover has cyclomatic complexity 78 and cognitive complexity 195; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 formatToolResult (cyclomatic 77, cognitive 92) · ×1
  • Complex function formatToolResult (cyclomatic 77, cognitive 92) public/assets/js/chat/tools.js:75 — formatToolResult has cyclomatic complexity 77 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 formatToolResult (cyclomatic 75, cognitive 94) · ×1
  • Complex function formatToolResult (cyclomatic 75, cognitive 94) public/assets/js/editor-chat.js:2034 — formatToolResult has cyclomatic complexity 75 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 createNode (cyclomatic 70, cognitive 54) · ×1
  • Complex function createNode (cyclomatic 70, cognitive 54) public/assets/js/editor-repo-tree.js:30 — createNode has cyclomatic complexity 70 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 continueAgentPlan (cyclomatic 57, cognitive 84) · ×1
  • Complex function continueAgentPlan (cyclomatic 57, cognitive 84) public/assets/js/chat.js:6646 — continueAgentPlan has cyclomatic complexity 57 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 init (cyclomatic 53, cognitive 77) · ×1
  • Complex function init (cyclomatic 53, cognitive 77) public/assets/js/theme.js:80 — init has cyclomatic complexity 53 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 stopRecording (cyclomatic 51, cognitive 59) · ×1
  • Complex function stopRecording (cyclomatic 51, cognitive 59) public/assets/js/chat.js:7440 — stopRecording has cyclomatic complexity 51 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleIncomingCall (cyclomatic 50, cognitive 80) · ×1
  • Complex function handleIncomingCall (cyclomatic 50, cognitive 80) public/assets/js/messenger/call-manager.js:642 — handleIncomingCall has cyclomatic complexity 50 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 48, cognitive 69) · ×1
  • Complex function (anonymous) (cyclomatic 48, cognitive 69) public/assets/js/messenger/messenger-multi-chat.js:3619 — (anonymous) has cyclomatic complexity 48 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function formatToolResult (cyclomatic 46, cognitive 61) · ×1
  • Complex function formatToolResult (cyclomatic 46, cognitive 61) REDACTED:2610 — formatToolResult has cyclomatic complexity 46 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 mount (cyclomatic 45, cognitive 71) · ×1
  • Complex function mount (cyclomatic 45, cognitive 71) public/assets/js/editor-sidebar.js:72 — mount has cyclomatic complexity 45 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 selectFile (cyclomatic 45, cognitive 67) · ×1
  • Complex function selectFile (cyclomatic 45, cognitive 67) public/assets/js/editor-repo-tree.js:205 — selectFile has cyclomatic complexity 45 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 continueEditorAgentPlan (cyclomatic 45, cognitive 65) · ×1
  • Complex function continueEditorAgentPlan (cyclomatic 45, cognitive 65) public/assets/js/editor-chat.js:2314 — continueEditorAgentPlan has cyclomatic complexity 45 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function attachAndPlay (cyclomatic 44, cognitive 46) · ×1
  • Complex function attachAndPlay (cyclomatic 44, cognitive 46) public/assets/js/messenger/call-manager.js:499 — attachAndPlay has cyclomatic complexity 44 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 _populatePostViewModal (cyclomatic 44, cognitive 38) · ×1
  • Complex function _populatePostViewModal (cyclomatic 44, cognitive 38) public/assets/client/js/notifications.js:778 — _populatePostViewModal has cyclomatic complexity 44 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 · public/assets/js/chat.js · ×1
  • public/assets/js/chat.js: 7411 lines of code public/assets/js/chat.js:1 — public/assets/js/chat.js has 7411 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 6080 lines of code REDACTED:1 — REDACTED has 6080 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/editor-chat.js · ×1
  • public/assets/js/editor-chat.js: 3989 lines of code public/assets/js/editor-chat.js:1 — public/assets/js/editor-chat.js has 3989 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/messenger/messenger-multi-chat.js · ×1
  • public/assets/js/messenger/messenger-multi-chat.js: 3982 lines of code public/assets/js/messenger/messenger-multi-chat.js:1 — public/assets/js/messenger/messenger-multi-chat.js has 3982 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/typeahead-chat.js · ×1
  • public/assets/client/js/typeahead-chat.js: 3474 lines of code public/assets/client/js/typeahead-chat.js:1 — public/assets/client/js/typeahead-chat.js has 3474 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/typeahead-chat.js · ×1
  • saicms/public/assets/client/js/typeahead-chat.js: 3429 lines of code saicms/public/assets/client/js/typeahead-chat.js:1 — saicms/public/assets/client/js/typeahead-chat.js has 3429 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/lib/novnc/core/rfb.js · ×1
  • public/lib/novnc/core/rfb.js: 2832 lines of code public/lib/novnc/core/rfb.js:1 — public/lib/novnc/core/rfb.js has 2832 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/feedmanager.js · ×1
  • public/assets/client/js/feedmanager.js: 2827 lines of code public/assets/client/js/feedmanager.js:1 — public/assets/client/js/feedmanager.js has 2827 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/feedmanager.js · ×1
  • saicms/public/assets/client/js/feedmanager.js: 2827 lines of code saicms/public/assets/client/js/feedmanager.js:1 — saicms/public/assets/client/js/feedmanager.js has 2827 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/messenger/messenger.js · ×1
  • public/assets/js/messenger/messenger.js: 2217 lines of code public/assets/js/messenger/messenger.js:1 — public/assets/js/messenger/messenger.js has 2217 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/lib/novnc/app/ui.js · ×1
  • public/lib/novnc/app/ui.js: 1564 lines of code public/lib/novnc/app/ui.js:1 — public/lib/novnc/app/ui.js has 1564 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/notifications.js · ×1
  • public/assets/client/js/notifications.js: 1332 lines of code public/assets/client/js/notifications.js:1 — public/assets/client/js/notifications.js has 1332 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/notifications.js · ×1
  • saicms/public/assets/client/js/notifications.js: 1332 lines of code saicms/public/assets/client/js/notifications.js:1 — saicms/public/assets/client/js/notifications.js has 1332 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1118 lines of code REDACTED:1 — REDACTED has 1118 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/messenger/messenger-popup.js · ×1
  • public/assets/js/messenger/messenger-popup.js: 1074 lines of code public/assets/js/messenger/messenger-popup.js:1 — public/assets/js/messenger/messenger-popup.js has 1074 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/profile.js · ×1
  • public/assets/client/js/profile.js: 1022 lines of code public/assets/client/js/profile.js:1 — public/assets/client/js/profile.js has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/profile.js · ×1
  • saicms/public/assets/client/js/profile.js: 1022 lines of code saicms/public/assets/client/js/profile.js:1 — saicms/public/assets/client/js/profile.js has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/F.js · ×1
  • public/assets/client/js/F.js: 1009 lines of code public/assets/client/js/F.js:1 — public/assets/client/js/F.js has 1009 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/F.js · ×1
  • saicms/public/assets/client/js/F.js: 1009 lines of code saicms/public/assets/client/js/F.js:1 — saicms/public/assets/client/js/F.js has 1009 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/mediamanager.js · ×1
  • public/assets/client/js/mediamanager.js: 988 lines of code public/assets/client/js/mediamanager.js:1 — public/assets/client/js/mediamanager.js has 988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/mediamanager.js · ×1
  • saicms/public/assets/client/js/mediamanager.js: 984 lines of code saicms/public/assets/client/js/mediamanager.js:1 — saicms/public/assets/client/js/mediamanager.js has 984 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/headmanager.js · ×1
  • public/assets/client/js/headmanager.js: 957 lines of code public/assets/client/js/headmanager.js:1 — public/assets/client/js/headmanager.js has 957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/headmanager.js · ×1
  • saicms/public/assets/client/js/headmanager.js: 957 lines of code saicms/public/assets/client/js/headmanager.js:1 — saicms/public/assets/client/js/headmanager.js has 957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 936 lines of code REDACTED:1 — REDACTED has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/messenger/call-manager.js · ×1
  • public/assets/js/messenger/call-manager.js: 868 lines of code public/assets/js/messenger/call-manager.js:1 — public/assets/js/messenger/call-manager.js has 868 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 742 lines of code REDACTED:1 — REDACTED has 742 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 742 lines of code REDACTED:1 — REDACTED has 742 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/stories.js · ×1
  • public/assets/client/js/stories.js: 654 lines of code public/assets/client/js/stories.js:1 — public/assets/client/js/stories.js has 654 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/stories.js · ×1
  • saicms/public/assets/client/js/stories.js: 654 lines of code saicms/public/assets/client/js/stories.js:1 — saicms/public/assets/client/js/stories.js has 654 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/lib/novnc/core/input/keysym.js · ×1
  • public/lib/novnc/core/input/keysym.js: 588 lines of code public/lib/novnc/core/input/keysym.js:1 — public/lib/novnc/core/input/keysym.js has 588 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/client/js/smartfed.js · ×1
  • public/assets/client/js/smartfed.js: 558 lines of code public/assets/client/js/smartfed.js:1 — public/assets/client/js/smartfed.js has 558 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/editor-repo-tree.js · ×1
  • public/assets/js/editor-repo-tree.js: 557 lines of code public/assets/js/editor-repo-tree.js:1 — public/assets/js/editor-repo-tree.js has 557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/chat/conversation.js · ×1
  • public/assets/js/chat/conversation.js: 543 lines of code public/assets/js/chat/conversation.js:1 — public/assets/js/chat/conversation.js has 543 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 527 lines of code REDACTED:1 — REDACTED has 527 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · saicms/public/assets/client/js/smartfed.js · ×1
  • saicms/public/assets/client/js/smartfed.js: 521 lines of code saicms/public/assets/client/js/smartfed.js:1 — saicms/public/assets/client/js/smartfed.js has 521 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/chat/audio.js · ×1
  • public/assets/js/chat/audio.js: 515 lines of code public/assets/js/chat/audio.js:1 — public/assets/js/chat/audio.js has 515 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/chat/code-blocks.js · ×1
  • public/assets/js/chat/code-blocks.js: 512 lines of code public/assets/js/chat/code-blocks.js:1 — public/assets/js/chat/code-blocks.js has 512 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/chat/tools.js · ×1
  • public/assets/js/chat/tools.js: 489 lines of code public/assets/js/chat/tools.js:1 — public/assets/js/chat/tools.js has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/lib/novnc/core/display.js · ×1
  • public/lib/novnc/core/display.js: 487 lines of code public/lib/novnc/core/display.js:1 — public/lib/novnc/core/display.js has 487 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · public/assets/js/editor-sidebar.js · ×1
  • public/assets/js/editor-sidebar.js: 483 lines of code public/assets/js/editor-sidebar.js:1 — public/assets/js/editor-sidebar.js has 483 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · No typecheck script · ×1
  • No typecheck script — test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R7 · Dead Code · Dead file (~50 LoC) · ×1
  • Dead file (~50 LoC) src/Views/sites/owner-sim.js — no import path from any entry point (130 application, 9 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'browserify' · ×1
  • Unused dependency 'browserify' public/lib/novnc/package.json:38 — Declared in public/lib/novnc/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'commander' · ×1
  • Unused dependency 'commander' public/lib/novnc/package.json:40 — Declared in public/lib/novnc/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'fs-extra' · ×1
  • Unused dependency 'fs-extra' public/lib/novnc/package.json:42 — Declared in public/lib/novnc/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'pofile' · ×1
  • Unused dependency 'pofile' public/lib/novnc/package.json:55 — Declared in public/lib/novnc/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'redis' · ×1
  • Unused dependency 'redis' tools/sandbox-proxy/package.json:12 — Declared in tools/sandbox-proxy/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity public/bob.html:7 — `https://cdn.tailwindcss.com` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 70 such include(s) across the repository's markup.
Minor — 172 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate public/assets/client/js/F.js:1003 — `!DOMElements.searchInput || !DOMElements.gridContainer` appears character-identically in 2 files — public/assets/client/js/F.js, saicms/public/assets/client/js/F.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:649 — `!R.isPlainObject(data) && !Array.isArray(data)` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate public/assets/client/js/notifications.js:1333 — `!commentId || !commentItemElement || !postElement` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/notifications.js:1145 — `!commentInputSection.classList.contains('hidden') && commentInput` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/contacts.js:105 — `!contact || typeof contact.id === 'undefined' || !contact.name` appears character-identically in 2 files — public/assets/client/js/contacts.js, saicms/public/assets/client/js/contacts.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 public/assets/client/js/notifications.js:974 — `!event.target.closest('.post-options-dropdown-container') && modalBodyElement.contains(event.target)` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/F.js:97 — `!handler || listenerObj.original === handler` appears character-identically in 2 files — public/assets/client/js/F.js, saicms/public/assets/client/js/F.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 public/assets/client/js/F.js:547 — `!imgSrc || imgSrc.startsWith('data:image/gif;base64') || F(img).hasClass('hidden-if-no-src')` appears character-identically in 2 files — public/assets/client/js/F.js, saicms/public/assets/client/js/F.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 public/assets/client/js/notifications.js:978 — `!modalBodyElement.contains(event.target) && !event.target.closest('.post-options-dropdown-container')` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/notifications.js:1062 — `!modalElements || !modalElements.body || !modalElements.title` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/notifications.js:1387 — `!newContent || newContent === originalContent` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/notifications.js:385 — `!notification || notification.is_read || !clickedItemElement || !clickedItemElement.classList.contains(CONFIG.cssClasses.unreadNotificationI…` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/notifications.js:779 — `!postData || !modalElements || !modalElements.body || !modalElements.title` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:720 — `!responseData || !responseData.documentElement || responseData.getElementsByTagName("parsererror").length` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate public/assets/client/js/typeahead.js:115 — `!resultsContainer.contains(e.target) && !searchInput.contains(e.target)` appears character-identically in 2 files — public/assets/client/js/typeahead.js, saicms/public/assets/client/js/typeahead.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 public/assets/client/js/contacts.js:30 — `!this.chatManager && window.globalChatManager` appears character-identically in 2 files — public/assets/client/js/contacts.js, saicms/public/assets/client/js/contacts.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 public/assets/client/js/profile.js:378 — `!this.checkinListContainer || !this.profileUserData?.id` appears character-identically in 2 files — public/assets/client/js/profile.js, saicms/public/assets/client/js/profile.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 public/assets/client/js/notifications.js:466 — `!this.elements.notificationListContainer || !this.scrollListenerAttached` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/notifications.js:650 — `!this.elements.notificationModal || this.elements.notificationModal.classList.contains(CONFIG.cssClasses.hidden)` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/profile.js:899 — `!this.friendGridContainerEl || !this.profileUserData?.id` appears character-identically in 2 files — public/assets/client/js/profile.js, saicms/public/assets/client/js/profile.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 public/assets/client/js/notifications.js:323 — `!this.hasMoreNotifications && this.scrollListenerAttached && this.elements.notificationListContainer` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/profile.js:256 — `!this.introViewState || !this.introEditState` appears character-identically in 2 files — public/assets/client/js/profile.js, saicms/public/assets/client/js/profile.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 public/assets/client/js/notifications.js:288 — `!this.isInitialized || !this.elements.notificationListContainer` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/notifications.js:539 — `!this.isInitialized || !this.elements.notificationModal` appears character-identically in 2 files — public/assets/client/js/notifications.js, saicms/public/assets/client/js/notifications.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 public/assets/client/js/contacts.js:13 — `!this.listContainer || !this.loadingState || !this.emptyState` appears character-identically in 2 files — public/assets/client/js/contacts.js, saicms/public/assets/client/js/contacts.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.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×40
  • Silent fallback default in catch REDACTED:70 — `resolveReferrerId` swallows every exception into `return 2` — 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 REDACTED:87 — `referralLink` 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 REDACTED:436 — `admin` 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 REDACTED:639 — `publishedLessons` 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 REDACTED:1240 — `planName` 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 REDACTED:1950 — `subscriptionPlans` 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 REDACTED:863 — `fetchOpenAiCompatibleModels` 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 REDACTED:868 — `marketSnapshot` 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 REDACTED:2029 — `getDatabaseCount` 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 REDACTED:2056 — `getSSLCertCount` 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 REDACTED:2663 — `listDnsZones` 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 REDACTED:2678 — `getDnsRecords` 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 REDACTED:3182 — `listDatabases` 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 REDACTED:3192 — `listDatabaseUsers` 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 src/Controllers/MallDeliveryController.php:563 — `getGpsHistory` 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 src/Controllers/MallDeliveryController.php:582 — `getStatusHistory` 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 src/Controllers/MallDeliveryController.php:603 — `getMyShipments` 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 src/Controllers/MallDeliveryController.php:610 — `getRiderProfile` 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 src/Controllers/MallDeliveryController.php:621 — `getRiderActiveDeliveries` 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 src/Controllers/MallDeliveryController.php:639 — `getRiderAllDeliveries` 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 src/Controllers/MallDeliveryController.php:653 — `getLogisticsStats` 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 src/Controllers/MallDeliveryController.php:680 — `getRecentShipments` 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 src/Controllers/MallDeliveryController.php:693 — `getAllRiders` 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 src/Controllers/SocialController.php:491 — `safeCount` 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 src/Core/LLM/LocalLLMConfig.php:217 — `getAvailableModels` 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.
  • + 15 more in this group — see findings.md.
D24 · Comment Value · redundant comment · ×35
  • redundant comment public/assets/client/js/dashboard.js:445 — "Instantiate the ChatUIManager" repeats the code it sits on: 4 of its 4 words (instantiate, chat, ui, manager) are already in `const chatManager = new ChatUIManager(chatContainerElId);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/client/js/notifications.js:227 — "Get the token from the 'content' attribute" repeats the code it sits on: 4 of its 4 words (get, token, content, attribute) are already in `const csrfToken = csrfMeta ? csrfMeta.getAttribute('content') : null;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/client/js/profile.js:471 — "Create the video element itself" repeats the code it sits on: 3 of its 3 words (create, video, element) are already in `const videoElement = document.createElement('video');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/client/js/smartfed.js:608 — "End of SmartFedApp class" only labels the closing brace of the class SmartFedApp. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/client/js/typeahead-chat.js:1619 — "Context Menu Listener" repeats the code it sits on: 3 of its 3 words (context, menu, listener) are already in `chatbox.querySelector('.chatbox-messages').addEventListener('contextmenu', (e) => this._handleChatMessageContextMenu(e, …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/admin-icon-color-picker.js:339 — "fallback to AJAX if form submit fails" repeats the code it sits on: 4 of its 5 words (ajax, form, submit, fails) are already in `console.warn('Form submit failed, falling back to AJAX', e);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat.js:528 — 10 comments in this file only repeat the code they sit on (lines 528, 675, 982, 2599, 4067, 4942, 5852, 7115, 7196, 7739), for example "Preprocess: fix PHP code blocks". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/audio.js:340 — "Create media recorder" repeats the code it sits on: 3 of its 3 words (create, media, recorder) are already in `mediaRecorder = new MediaRecorder(stream, mimeType ? { mimeType } : {});`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/audio.js:461 — "Set max recording timer" repeats the code it sits on: 4 of its 4 words (set, max, recording, timer) are already in `maxRecordTimer = setTimeout(() =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/index.js:178 — "Bind logout clear" repeats the code it sits on: 3 of its 3 words (bind, logout, clear) are already in `conversation.bindLogoutClear();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/index.js:305 — "Enhance code blocks" repeats the code it sits on: 3 of its 3 words (enhance, code, blocks) are already in `codeBlocks.enhanceCodeBlocks(container);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/markdown.js:172 — "Preprocess: fix PHP code blocks" repeats the code it sits on: 4 of its 5 words (fix, php, code, blocks) are already in `markdown = fixPhpCodeBlocks(markdown);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/tools.js:142 — "sandbox_list_files" repeats the code it sits on: 3 of its 3 words (sandbox, list, files) are already in `if (toolName === 'sandbox_list_files' && data?.tree)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/tools.js:183 — "sandbox_read_file" repeats the code it sits on: 3 of its 3 words (sandbox, read, file) are already in `if (toolName === 'sandbox_read_file' && data?.content !== undefined)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/chat/tools.js:194 — "sandbox_write_file" repeats the code it sits on: 3 of its 3 words (sandbox, write, file) are already in `if (toolName === 'sandbox_write_file' && data?.success)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/country-detect.js:32 — "Set the selected country" repeats the code it sits on: 3 of its 3 words (set, selected, country) are already in `countrySelect.selectedIndex = i;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/editor-chat.js:753 — "Parse todos from AI response text" repeats the code it sits on: 4 of its 5 words (parse, todos, response, text) are already in `function parseTodosFromResponse(text)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/editor-chat.js:1873 — "Detect file write tool calls and intercept them" repeats the code it sits on: 5 of its 6 words (detect, file, write, tool, calls) are already in `function detectFileWriteToolCall(text)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/editor-chat.js:2862 — "Switch to new tab" repeats the code it sits on: 3 of its 3 words (switch, new, tab) are already in `switchToTab(newId);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/editor-mobile.js:306 — "Get status elements" repeats the code it sits on: 3 of its 3 words (get, status, elements) are already in `editorStatus = document.getElementById('editor-status');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:1142 — 7 comments in this file only repeat the code they sit on (lines 1142, 1431, 2452, 3265, 5313, 5561, 5924), for example "Parse todos from AI response text". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/messenger/messenger-multi-chat.js:201 — 15 comments in this file only repeat the code they sit on (lines 201, 829, 920, 1007, 1308, 1389, 1469, 1517, 1525, 1849, 1945, 2036, 2367, 2411, 2680), for example "Close call notification". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/messenger/messenger-popup.js:920 — "New chat modal" repeats the code it sits on: 3 of its 3 words (new, chat, modal) are already in `openNewChatModal()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment public/assets/js/messenger/messenger.js:120 — 9 comments in this file only repeat the code they sit on (lines 120, 170, 371, 888, 1260, 1509, 2019, 2286, 2434), for example "Auto-resize textarea". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment saicms/public/assets/client/js/dashboard.js:445 — "Instantiate the ChatUIManager" repeats the code it sits on: 4 of its 4 words (instantiate, chat, ui, manager) are already in `const chatManager = new ChatUIManager(chatContainerElId);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 10 more in this group — see findings.md.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×21
  • Hand-rolled JSON/XML parsing via regex src/Core/LLM/ToolCallParser.php:63 — 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 PHP code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex public/assets/js/chat.js:5891 — 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 public/assets/js/chat.js:6791 — 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 public/assets/js/chat.js:6792 — 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 public/assets/js/editor-chat.js:760 — 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 public/assets/js/editor-chat.js:995 — 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 public/assets/js/editor-chat.js:1006 — 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 public/assets/js/editor-chat.js:1007 — 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 public/assets/js/editor-chat.js:1019 — 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 public/assets/js/editor-chat.js:2297 — 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 public/assets/js/editor-chat.js:2298 — 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 public/assets/js/editor-chat.js:2418 — 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 public/assets/js/editor-chat.js:2419 — 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 REDACTED:1150 — 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 REDACTED:1179 — 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 REDACTED:1190 — 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 REDACTED:1540 — 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 REDACTED:1551 — 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 REDACTED:1552 — 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 REDACTED:1564 — 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 public/assets/js/chat/tools.js:62 — 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.
D21 · Naming Consistency · `_layoutID` spells `ID` where 305 names in the project spell it `Id` · ×2
  • `_layoutID` spells `ID` where 305 names in the project spell it `Id` public/assets/client/js/gaming/webtypist.js:192 — 305 of 311 names in project repository spell the token `Id` (305 of 311; unit: names in project repository containing `Id`). Peers: script_colapse.removeDiv(divId) (public/assets/bible/js/script_colapse.js:1); ContactsManager.constructor(listContainerId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(loadingStateId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(emptyStateId) (public/assets/client/js/contacts.js:5); PostFeedManager.constructor(feedContainerId) (public/assets/client/js/feedmanager.js:29). Rename to `_layoutId`. [rule N6]
  • `_layoutID` spells `ID` where 305 names in the project spell it `Id` saicms/public/assets/client/js/gaming/webtypist.js:192 — 305 of 311 names in project repository spell the token `Id` (305 of 311; unit: names in project repository containing `Id`). Peers: script_colapse.removeDiv(divId) (public/assets/bible/js/script_colapse.js:1); ContactsManager.constructor(listContainerId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(loadingStateId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(emptyStateId) (public/assets/client/js/contacts.js:5); PostFeedManager.constructor(feedContainerId) (public/assets/client/js/feedmanager.js:29). Rename to `_layoutId`. [rule N6]
D21 · Naming Consistency · `_lessonID` spells `ID` where 305 names in the project spell it `Id` · ×2
  • `_lessonID` spells `ID` where 305 names in the project spell it `Id` public/assets/client/js/gaming/webtypist.js:193 — 305 of 311 names in project repository spell the token `Id` (305 of 311; unit: names in project repository containing `Id`). Peers: script_colapse.removeDiv(divId) (public/assets/bible/js/script_colapse.js:1); ContactsManager.constructor(listContainerId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(loadingStateId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(emptyStateId) (public/assets/client/js/contacts.js:5); PostFeedManager.constructor(feedContainerId) (public/assets/client/js/feedmanager.js:29). Rename to `_lessonId`. [rule N6]
  • `_lessonID` spells `ID` where 305 names in the project spell it `Id` saicms/public/assets/client/js/gaming/webtypist.js:193 — 305 of 311 names in project repository spell the token `Id` (305 of 311; unit: names in project repository containing `Id`). Peers: script_colapse.removeDiv(divId) (public/assets/bible/js/script_colapse.js:1); ContactsManager.constructor(listContainerId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(loadingStateId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(emptyStateId) (public/assets/client/js/contacts.js:5); PostFeedManager.constructor(feedContainerId) (public/assets/client/js/feedmanager.js:29). Rename to `_lessonId`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×2
  • Projects may be oversized for their cohesion composer.json:1 — `(repository root)` (182362 LoC, 315 module-visible types across 40 directories) overshoots its size bounds. 2 of 7 build unit(s) (Composer, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion saicms/composer.json:1 — `saicms` (38217 LoC, 63 module-visible types across 12 directories) overshoots its size bounds. 2 of 7 build unit(s) (Composer, Python, npm) overshoot their size bounds, lowering Project Cohesion to 4.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D31 · IaC & Container Security · Low IaC · ×2
  • REDACTED
  • REDACTED
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift public/lib/novnc/README.md:198 — public/lib/novnc/README.md links to `docs/EMBEDDING.md`, but `public/lib/novnc/docs/EMBEDDING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift public/lib/novnc/README.md:199 — public/lib/novnc/README.md links to `docs/LIBRARY.md`, but `public/lib/novnc/docs/LIBRARY.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found composer.json:4 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `composer.json` makes this repository a deployable product (line 4).
D21 · Naming Consistency · `_repeaterID` spells `ID` where 305 names in the project spell it `Id` · ×1
  • `_repeaterID` spells `ID` where 305 names in the project spell it `Id` public/lib/novnc/core/rfb.js:121 — 305 of 311 names in project repository spell the token `Id` (305 of 311; unit: names in project repository containing `Id`). Peers: script_colapse.removeDiv(divId) (public/assets/bible/js/script_colapse.js:1); ContactsManager.constructor(listContainerId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(loadingStateId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(emptyStateId) (public/assets/client/js/contacts.js:5); PostFeedManager.constructor(feedContainerId) (public/assets/client/js/feedmanager.js:29). Rename to `_repeaterId`. [rule N6]
D21 · Naming Consistency · `_screenID` spells `ID` where 305 names in the project spell it `Id` · ×1
  • `_screenID` spells `ID` where 305 names in the project spell it `Id` public/lib/novnc/core/rfb.js:151 — 305 of 311 names in project repository spell the token `Id` (305 of 311; unit: names in project repository containing `Id`). Peers: script_colapse.removeDiv(divId) (public/assets/bible/js/script_colapse.js:1); ContactsManager.constructor(listContainerId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(loadingStateId) (public/assets/client/js/contacts.js:5); ContactsManager.constructor(emptyStateId) (public/assets/client/js/contacts.js:5); PostFeedManager.constructor(feedContainerId) (public/assets/client/js/feedmanager.js:29). Rename to `_screenId`. [rule N6]
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · 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.
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) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation public/lib/novnc/package.json:34 — `public/lib/novnc/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R7 · Dead Code · Unused module-local declaration 'extendedClipboardFormatRtf' · ×1
  • Unused module-local declaration 'extendedClipboardFormatRtf' public/lib/novnc/core/rfb.js:78 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'extendedClipboardFormatHtml' · ×1
  • Unused module-local declaration 'extendedClipboardFormatHtml' public/lib/novnc/core/rfb.js:79 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'extendedClipboardFormatDib' · ×1
  • Unused module-local declaration 'extendedClipboardFormatDib' public/lib/novnc/core/rfb.js:80 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'extendedClipboardFormatFiles' · ×1
  • Unused module-local declaration 'extendedClipboardFormatFiles' public/lib/novnc/core/rfb.js:81 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'xvfbDisplay' · ×1
  • Unused module-local declaration 'xvfbDisplay' REDACTED:29 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'startXvfb' · ×1
  • Unused module-local declaration 'startXvfb' REDACTED:34 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'humanClick' · ×1
  • Unused module-local declaration 'humanClick' REDACTED:215 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'intToIp' · ×1
  • Unused module-local declaration 'intToIp' REDACTED:92 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'isFullIpMode' · ×1
  • Unused module-local declaration 'isFullIpMode' REDACTED:236 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'isIpvlanMode' · ×1
  • Unused module-local declaration 'isIpvlanMode' REDACTED:250 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'getNetworkInterface' · ×1
  • Unused module-local declaration 'getNetworkInterface' REDACTED:260 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'removeShimRoute' · ×1
  • Unused module-local declaration 'removeShimRoute' REDACTED:297 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'containerExistsLxd' · ×1
  • Unused module-local declaration 'containerExistsLxd' REDACTED:314 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'createSandbox' · ×1
  • Unused module-local declaration 'createSandbox' REDACTED:327 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected tools/tunnel/frp/caddy-frp.conf:26 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `caddy-frp.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 11/163 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · PHP static analysis does not check null everywhere · ×1
  • PHP static analysis does not check null everywhere — This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.
Minor — 7 finding(s)
D12 · Dependency Hygiene · Outdated · ×6
  • Outdated: catfan/medoo — `catfan/medoo` is locked at v2.2.0 but v2.6.1 is the current stable release on Packagist, and it already satisfies the `^2.1` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update catfan/medoo` and commit the updated REDACTED.
  • Outdated: erusev/parsedown — `erusev/parsedown` is locked at 1.7.4 but 1.8.0 is the current stable release on Packagist, and it already satisfies the `^1.7` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update erusev/parsedown` and commit the updated REDACTED.
  • Outdated: opis/json-schema — `opis/json-schema` is locked at 2.6.0 but 2.6.2 is the current stable release on Packagist, and it already satisfies the `^2.6` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update opis/json-schema` and commit the updated REDACTED.
  • Outdated: phpmailer/phpmailer — `phpmailer/phpmailer` is locked at v7.0.2 but v7.2.0 is the current stable release on Packagist, and it already satisfies the `^7.0` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update phpmailer/phpmailer` and commit the updated REDACTED.
  • Outdated: symfony/polyfill-php80 — `symfony/polyfill-php80` is locked at v1.33.0 but v1.43.0 is the current stable release on Packagist, and it already satisfies the `^1` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update symfony/polyfill-php80` and commit the updated REDACTED.
  • Outdated: vlucas/phpdotenv — `vlucas/phpdotenv` is locked at v5.6.2 but v5.8.0 is the current stable release on Packagist, and it already satisfies the `^5.6` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update vlucas/phpdotenv` and commit the updated REDACTED.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names public/assets/js/chat/attachments.js:59 — 0 of 63 documented parameters and 13 of 237 summaries in `.` only repeat the member or parameter name (e.g. "Get current attachment" for `getCurrentAttachment`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-d7294468ae8b413ea5961fe71abb9188/history.json --exit-code 0 --source .1artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=121" --report-format json --report-path /tmp/watchdog-gitleaks-d7294468ae8b413ea5961fe71abb9188/history-1.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-d7294468ae8b413ea5961fe71abb9188/tree.json --exit-code 0 --source .1artifacts/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/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude public/assets/fontawesome/css --exclude public/assets/fontawesome/webfonts/public/assets/fontawesome/css --exclude public/assets/lib --exclude public/lib/fontawesome/css --exclude public/lib/highlight --exclude public/lib/katex/contrib --exclude public/lib/marked .312artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .30artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .13artifacts/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 8 file(s) — `public/assets/js/chat.js`, `public/assets/js/tailwindcss.js`, `public/assets/silverqueen/login-story.js`, `public/assets/silverqueen/story.js`, `public/lib/xterm/xterm.js`, … (+3 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.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 Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1eb31-0813-7402-99fd-dd7950dbb66a · 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