Public report of wzj177/gbvr-iot, 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, 16:22 UTC · Survey ID cd_0840bfa7187f433f8431b989185cc370

wzj177/gbvr-iot

Measured 17 November 2026, 16:21 UTC, at code version 7774f2c

First survey, so nothing to compare with yet Bus factor: not measured

Bus factor is not measured: One contributor carries this repository.

CAI score 43.3out 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 medium codebase: 84,106 lines of product code in 10 projects, tests not counted · Estimated rebuild effort: about 0.5 person-years · Weakest lens: Production Readiness, 27.1

Findings by how serious they are

16 critical 703 serious 134 minor

15 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, 16:21 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 ▸

49of 49 dimensions measured by tools.
825of 853 findings point to an exact file and line, so you can open each one in the code. The other 28 concern the repository as a whole, such as missing documentation.
49dimensions across 5 lenses, read from 84,106 lines of product code in 10 projects.
Chapters

Executive summary

wzj177/gbvr-iot is rated At risk because critical security findings are open, most of them leaked passwords or keys. Its score is held back because six passwords or keys sit in the current code and we found no working pipeline that builds or tests changes to the code. It scores 43.3 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 27.1, is the weakest lens and counts most in the score. The best first step is replacing the six exposed passwords or keys and switching the old ones off, worth about 15.1 points. Fixing the three packages their makers have withdrawn or abandoned comes next, worth about 9.8 points. Raising Production Readiness to 70 would lift the score to about 57.6.

Six passwords or keys in the code and five in the code's history are open to anyone who can read the repository. Three known security holes in the packages the code depends on can be used by attackers. Replacing each exposed password or key and updating the vulnerable packages would close both risks. The loop of parts of the code that depend on each other needs breaking by moving the shared parts into a project of their own.

The product code is 84,106 lines, about €74,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.
Production Readiness 27.1 · counts for 47%Code Health 46.2 · counts for 26%Maturity 61.8 · counts for 14%Security and Compliance 73.9 · counts for 8%Architecture 85.8 · counts for 4%

If Production Readiness rose from 27.1 to 70, the lowest score rated Strong, the score would rise from 43.3 to about 57.6.

Code composition: what the lines of code are
Product code 99%Tests 1%
Rebuild cost: about €74,000 · Estimate
Cost to rebuild€24,000 to €120,000, for 407 to 1,292 hours of work, about 0.5 person-years for one engineer
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 43. 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.
SizeMedium: 84,106 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 6 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED, REDACTED.
Raises the score by about 15.1 points · Low effort · REDACTED Scanning
2
Resolve the 3 Abandoned package finding(s) in Dependency Hygiene.
Raises the score by about 9.8 points · Low effort · Dependency Hygiene
3
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with composer.json.
Raises the score by about 3.3 points · Low effort · ADR Quality

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 €74,000 to build again, about 0.5 person-years of work. Its weakest lens is Production Readiness, at 27.1 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 6 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 15.1 points for low effort, because it clears the 6 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 6.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 43,586 lines over the last 90 days, which is about 176,765 lines a year. At that pace, the extra work comes to an estimated 19.6 to 117.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch (root) (root) CoreW CoreW (root)->CoreW Gb28181Gateway Gb28181Gateway (root)->Gb28181Gateway app app CoreW->app support support CoreW->support app->(root) app->Gb28181Gateway app->support config config config->CoreW config->app process process config->process config->support migrations migrations public public swoole-gbs swoole-gbs

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.

199 modules, with 298 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 159 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 CoreW3 CoreW.Business.Attachment.Dto4 CoreW.Business.Devices.Service5 CoreW.Business.MediaServer.Service6 CoreW.Business.Menu.Service7 CoreW.Business.Record.Service8 CoreW.Business.RecordFile.Service9 CoreW.Business.StreamProxy.Service10 CoreW.Business.SystemLog.Service11 CoreW.Business.User12 CoreW.Business.User.Service13 CoreW.Exception14 CoreW.Sdk.ZLMediaKit15 Gb28181.GateWay.Libs16 support17 CoreW.Business18 CoreW.Business.Auth.Handler19 CoreW.Business.Common20 CoreW.Business.GB21 CoreW.Business.Product.Service22 CoreW.Dao23 Gb28181.GateWay.Message24 app25 CoreW.Business.Devices.Handler26 CoreW.Business.Devices.Task27 CoreW.Business.Devices.Traits28 CoreW.Business.MediaServer.Service.Impl29 CoreW.Business.Product.Service.Impl30 CoreW.Business.Record.Service.Impl31 CoreW.Business.RecordFile.Service.Impl32 CoreW.Business.VIP.Service.Impl33 app.api34 app.middleware.security.firewall35 app.process36 CoreW.Business.Devices.Service.Impl37 app.admin.controller38 app.api.v1.controller39 app.api.v2.controller40 app.middleware.admin
1 (global)
2 CoreW
3 CoreW.Business.Attachment.Dto
4 CoreW.Business.Devices.Service
5 CoreW.Business.MediaServer.Service
6 CoreW.Business.Menu.Service
7 CoreW.Business.Record.Service
8 CoreW.Business.RecordFile.Service
9 CoreW.Business.StreamProxy.Service
10 CoreW.Business.SystemLog.Service
11 CoreW.Business.User
12 CoreW.Business.User.Service
13 CoreW.Exception
14 CoreW.Sdk.ZLMediaKit
15 Gb28181.GateWay.Libs
16 support
17 CoreW.Business11
18 CoreW.Business.Auth.Handler11
19 CoreW.Business.Common22
20 CoreW.Business.GB11111
21 CoreW.Business.Product.Service1
22 CoreW.Dao1
23 Gb28181.GateWay.Message12
24 app11
25 CoreW.Business.Devices.Handler2223
26 CoreW.Business.Devices.Task41152
27 CoreW.Business.Devices.Traits1111
28 CoreW.Business.MediaServer.Service.Impl111
29 CoreW.Business.Product.Service.Impl133
30 CoreW.Business.Record.Service.Impl212121
31 CoreW.Business.RecordFile.Service.Impl111111
32 CoreW.Business.VIP.Service.Impl12
33 app.api1
34 app.middleware.security.firewall211
35 app.process411131
36 CoreW.Business.Devices.Service.Impl611541
37 app.admin.controller1342421151172
38 app.api.v1.controller11116
39 app.api.v2.controller712111824
40 app.middleware.admin11111
Uses a module listed above itPart of a loopThe module itself
1 (global)2 CoreW3 CoreW.Business.Attachment.Dto4 CoreW.Business.Devices.Service5 CoreW.Business.MediaServer.Service6 CoreW.Business.Menu.Service7 CoreW.Business.Record.Service8 CoreW.Business.RecordFile.Service9 CoreW.Business.StreamProxy.Service10 CoreW.Business.SystemLog.Service11 CoreW.Business.User12 CoreW.Business.User.Service13 CoreW.Exception14 CoreW.Sdk.ZLMediaKit15 Gb28181.GateWay.Libs16 support17 CoreW.Business18 CoreW.Business.Auth.Handler19 CoreW.Business.Common20 CoreW.Business.GB21 CoreW.Business.Product.Service22 CoreW.Dao23 Gb28181.GateWay.Message24 app25 CoreW.Business.Devices.Handler26 CoreW.Business.Devices.Task27 CoreW.Business.Devices.Traits28 CoreW.Business.MediaServer.Service.Impl29 CoreW.Business.Product.Service.Impl30 CoreW.Business.Record.Service.Impl31 CoreW.Business.RecordFile.Service.Impl32 CoreW.Business.VIP.Service.Impl33 app.api34 app.middleware.security.firewall35 app.process36 CoreW.Business.Devices.Service.Impl37 app.admin.controller38 app.api.v1.controller39 app.api.v2.controller40 app.middleware.admin(global)1CoreW2CoreW.Business.Attachment.Dto3CoreW.Business.Devices.Service4CoreW.Business.MediaServer.Service5CoreW.Business.Menu.Service6CoreW.Business.Record.Service7CoreW.Business.RecordFile.Service8CoreW.Business.StreamProxy.Service9CoreW.Business.SystemLog.Service10CoreW.Business.User11CoreW.Business.User.Service12CoreW.Exception13CoreW.Sdk.ZLMediaKit14Gb28181.GateWay.Libs15support16CoreW.Business17CoreW.Business.Auth.Handler18CoreW.Business.Common19CoreW.Business.GB20CoreW.Business.Product.Service21CoreW.Dao22Gb28181.GateWay.Message23app24CoreW.Business.Devices.Handler25CoreW.Business.Devices.Task26CoreW.Business.Devices.Traits27CoreW.Business.MediaServer.Service.Impl28CoreW.Business.Product.Service.Impl29CoreW.Business.Record.Service.Impl30CoreW.Business.RecordFile.Service.Impl31CoreW.Business.VIP.Service.Impl32app.api33app.middleware.security.firewall34app.process35CoreW.Business.Devices.Service.Impl36app.admin.controller37app.api.v1.controller38app.api.v2.controller39app.middleware.admin4011112211111111211222341152111111113321212111111112121141113161154113424211511721111671211182411111+159 more modules (most-connected shown)

At a glance — Code Health · 46.2 · Weak · gated by D2, X5 ·

At a glance — Architecture · 85.8 · Adequate · gated by D5 ·

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

At a glance — Readiness · 27.1 · Weak · gated by D13, P1, P3, P7 ·

At a glance — Security · 73.9 · Strong ·

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
A07:2025 — Authentication Failures15High / Critical
A05:2025 — Injection15Medium
A03:2025 — Software Supply Chain Failures9High / Critical
A02:2025 — Security Misconfiguration3Medium

Roadmap

Top priorities: Resolve the 6 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED, REDACTED; Resolve the 3 Abandoned package finding(s) in Dependency Hygiene; Add a CI workflow that builds and runs the test suite on every push/PR.

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

Do thisHelpsEffortDimension
Resolve the 6 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED, REDACTED.+15.1 ptsLowREDACTED Scanning
Resolve the 3 Abandoned package finding(s) in Dependency Hygiene.+9.8 ptsLowDependency Hygiene
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with composer.json.+3.3 ptsLowADR Quality
Add a CI workflow that builds and runs the test suite on every push/PR.+5.6 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.+5.6 ptsMediumSecurity & performance tooling
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.+4.3 ptsMediumNullable reference types
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.+2.7 ptsMediumOutbound HTTP resilience
Interpolated log message defeats structured logging+2.6 ptsMediumStructured logging

File quality

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

FileScoreBandWorst signal
REDACTED0.1SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED5.8MixedCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)
REDACTED5.8MixedREDACTED Scanning: Leaked secret: REDACTED
CoreW/Business/DataFilters/Filter.php5.9MixedCode Duplication: Edited copy of a member (23 corresponding lines)
swoole-gbs/gbs-beta.php6.0MixedExplicit Debt: TodoComment
Gb28181Gateway/src/Handlers/GB28181Handler.php6.0MixedExplicit Debt: TodoComment
CoreW/Business/Product/Service/Impl/ProductCatalogServiceImpl.php6.0MixedExplicit Debt: TodoComment
CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php6.0MixedExplicit Debt: TodoComment
app/admin/controller/GB28181DeviceController.php6.0MixedExplicit Debt: TodoComment
CoreW/Business/LiveProvider/Strategy/Impl/LeChangeStrategy.php6.0MixedExplicit Debt: TodoComment
app/api/v2/controller/ZLMHookController.php6.0MixedExplicit Debt: TodoComment
CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php6.0MixedExplicit Debt: TodoComment
app/admin/controller/GB28181ChannelController.php6.0MixedExplicit Debt: TodoComment
app/queue/redis/fast/FileAfterUploadProcess.php6.0MixedExplicit Debt: TodoComment
app/api/v2/controller/GBServerHookController.php6.0MixedExplicit Debt: TodoComment
CoreW/Sdk/ZLMediaKit/ZLMClient.php6.0MixedExplicit Debt: TodoComment
app/api/v1/controller/AuthController.php6.0MixedExplicit Debt: TodoComment
CoreW/Business/LiveProvider/Strategy/Impl/Ys7Strategy.php6.0MixedExplicit Debt: TodoComment

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

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

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

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

Could not be resolved — 15

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 49 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 — 49 dimensions across the health lenses
D1D2D3D4D5D6D12D13D14D15D17D19D20D27D28D29D30D31D34D35D43D44AX10AX3AX4AX6C2M1M2M3M4P1P2P3P4P6P7P8X16X18X19X21X23X27X28X29X3X4X5

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, 825 of 853 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 01a1ea50-2179-7fe5-8199-f8a360802785.

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: test source is present (.php) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.php) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D21 Naming 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D22 Internal API Consistency — not measured this run — 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. This repository's source is written only in languages whose packages are published through a manifest, and no manifest in the tree makes a publication act: either there is no package manifest of any ecosystem (no package.json, pyproject.toml, setup.py, gemspec, Cargo.toml, pom.xml, build.gradle, composer.json, pubspec.yaml or mix.exs), or every one present declares in its package manager's own terms that it is not published (an npm package marked "private": true, a Cargo package with publish = false, a pubspec with publish_to: none, a Composer "project", a Poetry project with package-mode = false, or the "Private :: Do Not Upload" classifier). With no publication act there is no intentionally-exposed surface for API consistency to be judged over.
  • D24 Comment Value — 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 the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (82134 LoC, 668 module-visible types across 199 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • 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. `CoreW/Sdk/ZLMediaKit/MediaServer.php` 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.
  • AX1 Captive dependencies — 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is CodeIgniter 4 Services and Pimple and a PSR-11 container (Psr\Container), whose lifetimes are not modelled 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.
  • 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 no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's PHP is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's PHP is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Java and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust and Java source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust or Java was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — 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, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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 reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 175 further occurrence(s) are not listed individually; the score already reflects all 215.

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.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity6.8 / 10Adequate✓ 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 6.8 / 10 · rule-coverage 100% · ceiling Prevented

48 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was GBS.handleMessageRequest at 49. A further 5 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 CommandDispatcher.dispatch at 57 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: CoreW/Business/Devices/Enums/ChannelTypeEnum.php (ChannelTypeEnum.label at 42), app/api/v2/controller/GBServerHookController.php (GBServerHookController.index at 31), CoreW/Business/Attachment/Implementors/AbstractFileImplementor.php (AbstractFileImplementor.getFileExtensionFromContentType at 27), CoreW/Business/Devices/Enums/DeviceCategoryEnum.php (DeviceCategoryEnum.label at 22). 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.

Channel.updateAdmin (cyclomatic 18) · ×2Gb28181Gateway/src/SwooleServer/Channel.php:63
GBS.handleMessageRequest (cyclomatic 49)Gb28181Gateway/src/SwooleServer/GBS.php:684
GBServer.handleMessageRequest (cyclomatic 49)swoole-gbs/gbs-beta.php:1029
GBS.parseCatalogResponse (cyclomatic 44)Gb28181Gateway/src/SwooleServer/GBS.php:1986
GBServer.parseCatalogResponse (cyclomatic 44)swoole-gbs/gbs-beta.php:2331

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

What to do

  1. Bring the 48 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with GBS.handleMessageRequest (cyclomatic 49), GBServer.handleMessageRequest (cyclomatic 49), GBS.parseCatalogResponse (cyclomatic 44). — 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 48 together lifts Cyclomatic Complexity from 6.8 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D2 · Cognitive Complexity3.9 / 10Weak✓ 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 3.9 / 10 · rule-coverage 100% · ceiling Prevented

120 method(s) exceeded the cognitive complexity threshold of 15; the worst was DeviceToolkit.getOperatingSystem at 335.

Channel.updateAdmin (cognitive 27) · ×2Gb28181Gateway/src/SwooleServer/Channel.php:63
DeviceToolkit.getOperatingSystem (cognitive 335)support/utils/DeviceToolkit.php:210
GBS.parseCatalogResponse (cognitive 126)Gb28181Gateway/src/SwooleServer/GBS.php:1986
GBServer.parseCatalogResponse (cognitive 126)swoole-gbs/gbs-beta.php:2331
GBS.handleMessageRequest (cognitive 115)Gb28181Gateway/src/SwooleServer/GBS.php:684

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

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with DeviceToolkit.getOperatingSystem (cognitive 335), GBS.parseCatalogResponse (cognitive 126), GBServer.parseCatalogResponse (cognitive 126). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cognitive Complexity from 3.9 to about 5.3/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

57 god class(es) detected.

TooManyMethods: Gb28181Service · ×20CoreW/Business/GB/Gb28181Service.php:26
ClassTooLong: GBS · ×13Gb28181Gateway/src/SwooleServer/GBS.php:11
MethodTooLong: LogEnum.getActionItems · ×13CoreW/Business/SystemLog/LogEnum.php:253
FileTooLong: swoole-gbs/gbs-beta.php · ×11swoole-gbs/gbs-beta.php

What to do

  1. Resolve the 20 TooManyMethods finding(s) in God Classes — start with Gb28181Service.php, GB28181Handler.php, DeviceServiceImpl.php. — One of this dimension's main actionable groups (20 warning-level).
  2. Resolve the 13 ClassTooLong finding(s) in God Classes — start with GBS.php, gbs-beta.php, GB28181Handler.php. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 13 MethodTooLong finding(s) in God Classes — start with GBS.php (4), gbs-beta.php (4), GB28181Handler.php (2). — One of this dimension's main actionable groups (13 warning-level).

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

D4 · Code Duplication4.3 / 10Weak✓ 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 4.3 / 10 · rule-coverage 100% · ceiling Verified

225 duplicated block group(s) detected. 14.1 % of the production lines (11,886 of 84,106) are in a reported copy. A further 114 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (5 lines × 2) · ×12app/queue/redis/fast/PanoramaChunkTilesJob.php:266
Duplicated block (9 lines × 2) · ×11CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:299
Duplicated block (7 lines × 2) · ×10CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:547
Duplicated block (6 lines × 2) · ×9CoreW/Sdk/PSipGateway/Gb28181Client.php:592
Duplicated block (10 lines × 2) · ×8CoreW/RateLimiter/TimeMachine.php:88

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

What to do

  1. Resolve the 12 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with GBS.php (4), REDACTED (2), PanoramaChunkTilesJob.php. — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 11 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with TokenServiceImpl.php (2), GBS.php (2), AliFileImplementor.php. — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 10 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with TokenServiceImpl.php (2), AttachmentServiceImpl.php, VIPServiceImpl.php. — One of this dimension's main actionable groups (10 warning-level).

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

D5 · Coupling0.0 / 10Critical✓ Tool-verified

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

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

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

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

10 production modules (source-import), 1 dependency cycle(s), 0 unstable depended-on module(s). No manifest declares this repository's modules, so the modules are its top-level source directories and the edges the imports between them; 2 module(s) off the main sequence, with abstractness counted on 9 of the 10 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Circular dependencybiz.php:3
Off the main sequence: process · ×2

What to do

  1. Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Circular dependency finding(s) in Coupling — start with biz.php. — One of this dimension's main actionable groups (1 issue-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ 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.9 / 10 · rule-coverage 100% · ceiling Verified

1 of 113 classes have LCOM4 above 3.

Low cohesion: Filter (LCOM4 6)CoreW/Business/DataFilters/Filter.php:22

What to do

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

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

D12 · Dependency Hygiene7.8 / 10Strong✓ 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 7.8 / 10 · rule-coverage 100% · ceiling Verified

14 outdated, 3 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. An ABANDONED package is a migration rather than an upgrade: it receives no further releases at all, including security releases.

Abandoned package: doctrine/annotations · ×3
Outdated: aliyuncs/oss-sdk-php · ×14

What to do

  1. Resolve the 3 Abandoned package finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (3 warning-level).

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

D13 · REDACTED Scanning0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Prevented

6 secret(s) detected. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

REDACTED

What to do

  1. Resolve the 6 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 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 113 locked Composer package(s) use a banned license. Licences were read from this repository's REDACTED, which records the `license` each package declares, over every package in its production `packages` list, direct and transitive, at the locked version; the 1 package(s) under `packages-dev` are not installed for a consumer and are excluded. 1 of them declare no licence; that is missing data, not a violation, and none of them is charged.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: Gb28181Gateway/src/Handlers/GB28181Handler.php (34×30=1020); app/admin/controller/GB28181RecordingController.php (7×28=196); app/command/Gb28181Server.php (6×32=192)

Hotspot: Gb28181Gateway/src/Handlers/GB28181Handler.php · ×5Gb28181Gateway/src/Handlers/GB28181Handler.php:468

What to do

  1. Resolve the 5 Hotspot finding(s) in Churn × Complexity Hotspots — start with GB28181Handler.php, GB28181RecordingController.php, Gb28181Server.php. — One of this dimension's main actionable groups (5 warning-level).

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

D17 · Explicit Debt9.8 / 10Stronggated by 76 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 9.8 / 10 · rule-coverage 100% · ceiling Prevented

76 deducted task-comment markers across 84106 LoC (0.1/KLoC) → score 9.8. 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 · ×76swoole-gbs/gbs-beta.php:3091

What to do

  1. Resolve the 76 TodoComment finding(s) in Explicit Debt — start with ZLMHookController.php (15), ISecureCenterStrategy.php (10), GBServerHookController.php (5). — One of this dimension's main actionable groups (76 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

1 of 1 documentation facets pass in full. 2 document(s) read across 1 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:3

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.

D27 · Navigability9.8 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

19 % of calls cross a namespace and 0 % go through an interface, but 74 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 3 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 recommendation-level).

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

D29 · Static Analysis (SAST)7.0 / 10Adequate✓ 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 7.0 / 10 · rule-coverage 100% · ceiling Documented

15 finding(s): 0 critical, 0 high, 4 medium, 11 low. semgrep hit a parse error in 2 file(s) — `CoreW/Sdk/ZLMediaKit/MediaServer.php` (line 12), `app/view/index/view.html` (line 12) — 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

What to do

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

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

D30 · Dependency Vulnerabilities6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Documented

9 finding(s): 2 critical, 1 high, 4 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security9.7 / 10Stronggated by 3 serious findings✓ Tool-verified

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

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

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

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

REDACTED

What to do

  1. Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).

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

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

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

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

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

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

AX10 · Code composition9.0 / 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 cycles5.5 / 10Adequate✓ 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.

  • The projects (root) → CoreW → app → (root) (one cycle inside a mutually-dependent group of 5 projects) form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference. — biz.php:3

What to do

  • Break project reference cycles by extracting shared abstractions into a separate project; keep the graph a DAG.
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 segregation9.6 / 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.

  • `AttachmentService` declares 17 methods: `getAttachmentById`, `getAttachmentByHashId`, `countAttachments`, `searchAttachments`, `updateAttachment`, `deleteAttachmentById`, `unlinkFile`, `deleteFilesByIds`, `uploadFile`, `uploadFiles`, `uploadBase64Image`, `uploadRemoteFile`, `getChunkFilesByHashID`, `uploadSnippet`, `mergeSnippetFile`, `mergeTmpFile`, `moveGroup`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/Attachment/Service/AttachmentService.php:8
  • `VoiceSessionDao` declares 17 methods: `getBySessionId`, `getByDeviceAndChannel`, `getByDialogId`, `getByStream`, `getByStreamAndMediaServerId`, `getByNoEndedStreamAndMediaServerId`, `updStatus`, `updateStatusBySessionId`, `getByCallId`, `getActiveSessions`, `getActiveByDeviceAndChannel`, `findActiveByDeviceChannelAndMode`, `getBySsrc`, `updStatusIf`, `findExpiredSessions`, `markAsEnded`, `endSession`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/Devices/Dao/VoiceSessionDao.php:7
  • `DeviceService` declares 58 methods: `getDevicesById`, `getDeviceByDeviceId`, `countDevices`, `searchDevices`, `findDevicesByDeviceIds`, `summaryDevices`, `createDevice`, `updateDevice`, `updateDeviceExtendInfo`, `deleteDeviceById`, `handleDeviceRegister`, `updateDeviceHeartbeat`, `updateDeviceStatus`, `getChannelById`, `getChannelByDeviceAndChannel`, `countChannels`, `searchChannels`, `getChannelsByDeviceId`, `createChannel`, `updateChannel`, `updateChannelByMainId`, `batchUpdateChannels`, `batchUpdateOrCreateChannels`, `deleteChannel`, `getSessionById`, `getSessionByCallId`, `getSessionBySsrc`, `getSessionByStreamId`, `getActiveSessionByStreamIdAndType`, `incrementSessionViewerCount`, `decrementSessionViewerCount`, `casDecrementSessionViewerCount`, `createSession`, `updateSession`, `updateSessionByCallId`, `updateSessionBySSRC`, `deleteSession`, `deleteSessionByCallId`, `deleteSessionByStreamIdAndMediaServerId`, `cleanupExpiredSessions`, and 18 more. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/Devices/Service/DeviceService.php:5
  • `LiveProvider` declares 18 methods: `activeAndOpenLiveWithCameras`, `openLiveWithCameras`, `closeLiveWithCameras`, `deviceTrees`, `countVideoChannels`, `countRecorders`, `searchRecorders`, `searchCameras`, `getDevices`, `getCameras`, `getLiveUrl`, `getCamera`, `getVideoRecorder`, `devicePtzStart`, `devicePtzStp`, `stopLive`, `getVideoCover`, `getAccessToken`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/LiveProvider/Strategy/LiveProvider.php:14
  • `MediaServerService` declares 16 methods: `getMediaServerById`, `getMediaServerByServerId`, `findServersByIds`, `findServersByServerIds`, `countMediaServers`, `searchMediaServers`, `getSimpleList`, `createMediaServer`, `updateMediaServer`, `deleteMediaServerById`, `getStats`, `getConfig`, `setConfig`, `restart`, `syncStatus`, `getStrategy`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/MediaServer/Service/MediaServerService.php:7
  • `ProductService` declares 41 methods: `getProductById`, `getProductByCode`, `countProducts`, `searchProducts`, `createProduct`, `updateProduct`, `closeProduct`, `publishProduct`, `deleteProduct`, `typeList`, `getSceneUploadConfig`, `updateSceneByProductAndIndex`, `addScene`, `updateScene`, `deleteScene`, `updateSceneSortNum`, `getScene`, `searchScenes`, `setProductCover`, `makeHotPoint`, `deleteHotPoint`, `deleteHotPointBySceneId`, `getHotpointByUUID`, `searchHotPoints`, `getProductTour`, `setProductTour`, `getProductTourNodes`, `setProductTourNodes`, `deleteProductTour`, `savePlaneGraphMarkers`, `getPlaneGraphByProductId`, `setProductLogo`, `geProductLogo`, `setProductConfig`, `getProductConfigs`, `getProductConfig`, `validateViewPwd`, `makeShareUrl`, `checkShareToken`, `increaseViewCount`, and 1 more. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/Product/Service/ProductService.php:9
  • `RecordTaskService` declares 21 methods: `createAlarmRecordTask`, `createDownloadRecordTask`, `executeRecordTask`, `stopRecording`, `searchRecordTasks`, `countRecordTasks`, `processPendingTasks`, `stopExpiredRecordings`, `updateTaskStatusWhenMediaReady`, `startRecordingForStableRtp`, `stopCompletedRecordings`, `completeFinalizingTasks`, `getValidityDownloadTaskByStreamId`, `getDoneRecordTaskByStreamId`, `getByStreamId`, `deleteRecordTask`, `cancelRecordTask`, `updateRecordStartTimeByStreamId`, `updateRecordEndTimeByStreamId`, `updateLastRtpTime`, `completeTaskFromHook`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/Record/Service/RecordTaskService.php:5
  • `SipGatewayService` declares 16 methods: `createGateway`, `updateGateway`, `deleteGateway`, `getGateway`, `getGatewayByGatewayId`, `searchGateways`, `countGateways`, `toggleGateway`, `getGatewayFullConfig`, `updateHeartbeat`, `checkOfflineGateways`, `bindDeviceToGateway`, `bindDevicesToGateway`, `unbindDeviceFromGateway`, `unbindDevicesFromGateway`, `registerGateway`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/SipGateway/Service/SipGatewayService.php:5
  • `StreamProxyService` declares 27 methods: `createProxy`, `updateProxy`, `deleteProxy`, `getProxy`, `getProxyByProxyId`, `searchProxies`, `countProxies`, `startProxy`, `stopProxy`, `restartProxy`, `getPlayUrls`, `getPushUrl`, `updateStatus`, `healthCheck`, `batchHealthCheck`, `autoReconnect`, `bindRecordPlan`, `unbindRecordPlan`, `updateViewerCount`, `incrementRetryCount`, `resetRetryCount`, `syncPushStreamStatus`, `addLog`, `getProxyLogs`, `searchLogs`, `countLogs`, `cleanupOldLogs`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/StreamProxy/Service/StreamProxyService.php:5
  • `UserDao` declares 21 methods: `getByEmail`, `getUserByType`, `getByNickname`, `getByApiKey`, `getUnDestroyedUserByNickname`, `getUnDestroyedUserByNickNameOrVerifiedMobile`, `getByUUID`, `countByMobileNotEmpty`, `getByVerifiedMobile`, `countByLessThanCreatedTime`, `findUnDestroyedUsersByIds`, `findByNicknames`, `findByIds`, `getByInviteCode`, `waveCounterById`, `deleteCounterById`, `analysisRegisterDataByTime`, `searchUsersJoinUserFace`, `countUsersJoinUserFace`, `findUnLockedUsersByUserIds`, `findUserLikeNickname`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/User/Dao/UserDao.php:7
  • `UserService` declares 55 methods: `getUser`, `getUserByUUID`, `initSystemUsers`, `countUsers`, `searchUsers`, `deleteUserBindByUserId`, `findUserLikeNickname`, `getSimpleUser`, `getUserByNickname`, `getUserByApiKey`, `getUserByLoginField`, `getUserByEmail`, `findUsersByIds`, `findUnDestroyedUsersByIds`, `setEmailVerified`, `changeEmail`, `isNicknameAvaliable`, `isEmailAvaliable`, `isMobileAvaliable`, `changePassword`, `isMobileUnique`, `verifyInSaltOut`, `verifyPasswordById`, `verifyPasswordByUser`, `getUserByType`, `generateNickname`, `generateEmail`, `changeUserRoles`, `makeToken`, `getToken`, `countTokens`, `deleteToken`, `findBindsByUserId`, `unBindUserByTypeAndToId`, `getUserBindByTypeAndFromId`, `findUserBindByTypeAndFromIds`, `findUserBindByTypeAndToIds`, `getUserBindByToken`, `getUserBindByTypeAndUserId`, `findUserBindByTypeAndUserId`, and 15 more. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/User/Service/UserService.php:5
  • `VIPService` declares 38 methods: `getVIPById`, `countVIPs`, `searchVIPs`, `createVIP`, `updateVIP`, `editVIPInfo`, `deleteVIPById`, `register`, `createSystemVIP`, `makeAuthToken`, `emailVerify`, `sendEmailVerifyNotification`, `destroyToken`, `login`, `getVIPByUUID`, `getVIPByNickname`, `sendAccountEmailLoginCode`, `deleteUserBindByUserId`, `getUserBindByTypeAndFromId`, `unBindUserByTypeAndToId`, `findBindsByUserId`, `findUserBindByTypeAndFromIds`, `findUserBindByTypeAndToIds`, `getUserBindByToken`, `getUserBindByTypeAndUserId`, `findUserBindByTypeAndUserId`, `bindVIP`, `addUsedSpaceSize`, `subUsedSpaceSize`, `applyCompany`, `getVIPCompany`, `getVIPCompanyByUserId`, `checkCompany`, `setCompanyIotConfig`, `getCompanyIotConfig`, `searchCompanyList`, `getCompanyIotConfigByUserId`, `getCompanyIotConfigByAppId`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — CoreW/Business/VIP/Service/VIPService.php:7

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
C2 · Access Controls7.0 / 10Strong✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.

What to do

  • Name the access rules — Gate abilities and policy classes (Gate::define, a UserPolicy), spatie/laravel-permission roles and permissions, or a Symfony Voter — and consult them where access is checked ($this->authorize, a can: middleware, #[IsGranted]), so the rule set is reviewable and testable on its own.
M1 · Documentation (README)6.7 / 10Adequate✓ 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.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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 accuracy8.0 / 10Strong✓ 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.

  • README.md links to `www.easygbs.com`, but `www.easygbs.com` 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.md:536

What to do

  • Reconcile the README with reality: README.md links to `www.easygbs.com`, but `www.easygbs.com` 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.
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.

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 & Rollback5.0 / 10Adequate✓ 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.

  • Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.

What to do

  • Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `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. (×3) — CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:636, CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:665, support/utils/ImageToolkit.php:154

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

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 state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

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 materialisation7.3 / 10Strong✓ Tool-verified

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

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

  • `debug` at line 1338 is called with an argument built by `json_encode($addr)` (line 1338), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on. — swoole-gbs/gbs-beta.php:1338
  • `debug` at line 1340 is called with an argument built by `json_encode($addr)` (line 1340), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on. — swoole-gbs/gbs-beta.php:1340
  • `debug` at line 1809 is called with an argument built by `json_encode($authParams)` (line 1809), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on. — swoole-gbs/gbs-beta.php:1809
  • `debug` at line 993 is called with an argument built by `json_encode($addr)` (line 993), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on. — Gb28181Gateway/src/SwooleServer/GBS.php:993
  • `debug` at line 995 is called with an argument built by `json_encode($addr)` (line 995), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on. — Gb28181Gateway/src/SwooleServer/GBS.php:995
  • `debug` at line 1464 is called with an argument built by `json_encode($authParams)` (line 1464), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on. — Gb28181Gateway/src/SwooleServer/GBS.php:1464

What to do

  • In PHP, put the construction behind the logger's own check (`if ($logger->isHandling(Logger::DEBUG))` for Monolog, a debug flag for a line only a debug build needs), or pass the collection through the PSR-3 context array with a `{placeholder}` (`$logger->debug('rows: {rows}', ['rows' => $rows])`) so the handler renders it only when the record is written. Concatenating or interpolating the value into the message is not the fix: PHP builds the string, and every `array_map`, `implode` or `json_encode` inside it, before the call is entered.
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — 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.

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 handling6.1 / 10Adequate✓ 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. (×14) — swoole-gbs/gbs-beta.php:994, swoole-gbs/gbs-beta.php:1020, swoole-gbs/gbs-beta.php:1244, …
  • `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. (×15) — support/utils/DeviceToolkit.php:135, Gb28181Gateway/src/Transport/RabbitMQTransport.php:130, Gb28181Gateway/src/Libs/ClientRedis.php:47, …
  • `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. (×5) — app/queue/redis/fast/FileAfterUploadProcess.php:113, CoreW/Provider/ExtensionsProvider.php:101, CoreW/Business/GB/Gb28181Service.php:46, …
  • `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) — CoreW/Dao/GeneralDaoImpl.php:89, CoreW/Dao/GeneralDaoImpl.php:99

What to do

  • Swallowed exception (empty catch)
X4 · Structured logging4.2 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `debug` at line 228 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:228
  • `debug` at line 232 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:232
  • `error` at line 505 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->error('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::error('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:505
  • `debug` at line 528 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:528
  • `debug` at line 529 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:529
  • `debug` at line 541 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:541
  • `debug` at line 546 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:546
  • `debug` at line 606 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:606
  • `debug` at line 623 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:623
  • `debug` at line 715 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:715
  • `debug` at line 774 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:774
  • `debug` at line 816 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:816
  • `info` at line 967 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:967
  • `debug` at line 974 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:974
  • `debug` at line 983 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:983
  • `info` at line 987 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:987
  • `debug` at line 1059 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1059
  • `debug` at line 1119 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1119
  • `debug` at line 1130 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1130
  • `debug` at line 1134 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1134
  • `debug` at line 1149 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1149
  • `debug` at line 1165 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1165
  • `debug` at line 1177 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1177
  • `debug` at line 1194 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1194
  • `debug` at line 1206 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1206
  • `debug` at line 1276 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1276
  • `debug` at line 1280 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1280
  • `debug` at line 1284 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1284
  • `debug` at line 1376 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1376
  • `debug` at line 1384 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1384
  • `debug` at line 1489 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1489
  • `debug` at line 1521 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1521
  • `debug` at line 1536 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1536
  • `debug` at line 1822 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1822
  • `debug` at line 1823 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1823
  • `debug` at line 1824 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1824
  • `debug` at line 1825 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1825
  • `debug` at line 1826 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1826
  • `debug` at line 1827 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1827
  • `debug` at line 1884 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — swoole-gbs/gbs-beta.php:1884

What to do

  • Interpolated log message defeats structured logging
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.

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 Health46.2Weak — gated by D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture85.8Adequate — gated by D5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity61.8Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness27.1Weak — gated by D13, P1, P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security73.9StrongStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 24 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 63 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.

  • AC1 Text alternatives — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — Not applicable: PHP builds its object graph per request and shares none of it between requests.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — failed to solve: process "/bin/sh -c pecl install -D 'enable-openssl=\"yes\" enable-swoole-curl=\"yes\"' swoole && docker-php-ext-enable swoole" did not complete successfully: exit code: 1; likely cause (the repository): a RUN step of the repository's Dockerfile exited with code 1 (`/bin/sh -c pecl install -D 'enable-openssl=\"yes\" enable-swoole-curl=\"yes\"' swoole && docker-php-ext-enable swool…`): the build's own command failed, for example a compile or test error; runtime evidence skipped The cause is in the repository, not in our sandbox: a RUN step of the repository's Dockerfile exited with code 1 (`/bin/sh -c pecl install -D 'enable-openssl=\"yes\" enable-swoole-curl=\"yes\"' swoole && docker-php-ext-enable swool…`): the build's own command failed, for example a compile or test error. Nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone_number, …) or stored credential in a Laravel migration, an Eloquent model's $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~556 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 — bus factor 1 — one contributor carries this repository
  • 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.
  • D21 Naming Consistency — Naming consistency does not read PHP, html yet; not measured.
  • D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
  • 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"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .php, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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 included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (15 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.
  • PF3 Async & latency hygiene — Not applicable: PHP has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — 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
  • X12 Unreachable branch — 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
  • X13 Undrained process stream — 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
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not 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
  • X2 Cancellation propagation — no C# was loaded; this repository's PHP was read and makes no request a caller can cancel (amphp's HttpClient or connect) — synchronous PHP offers its callers no cancellation to take
  • 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 — 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
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. PHP gives a request one thread of its own; the event-loop libraries (ReactPHP, Amp) run callbacks one at a time, and ext-parallel copies every value across its channels, so no array or collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X30 Support guard that admits what it rejects — 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.
  • 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 — 16 finding(s)
D13 · REDACTED Scanning · Leaked secret · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
AX3 · Project dependency cycles · Project dependency cycle · ×1
  • Project dependency cycle biz.php:3 — The projects (root) → CoreW → app → (root) (one cycle inside a mutually-dependent group of 5 projects) form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
D5 · Coupling · Circular dependency · ×1
  • Circular dependency biz.php:3 — (root) → CoreW → app → (root) (one cycle inside a mutually-dependent group of 5 modules)
Serious — 703 finding(s)
D17 · Explicit Debt · TodoComment · ×76
  • TodoComment swoole-gbs/gbs-beta.php:3091 — // TODO: 调用真实 ZLMediaKit /index/api/openRtpServer — 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 swoole-gbs/gbs-beta.php:3097 — // TODO: 调用真实 ZLMediaKit /index/api/closeRtpServer — 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 config/auth.php:54 — // TODO: 后期放入配置表 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/queue/redis/fast/DeleteSceneJob.php:45 — // TODO:删除资源表 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/queue/redis/fast/FileAfterUploadProcess.php:87 — // TODO: 增加转码状态 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/queue/redis/fast/FileAfterUploadProcess.php:89 — // TODO: 消耗cpu,而且会影响后面的修改数据库,应当使用命令行处理,传递文件id; — 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 app/middleware/ProductAnonymousVisitMiddleware.php:25 — // TODO: 验证token — 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 app/api/v2/controller/GBServerHookController.php:751 — // TODO: 存储报警记录到数据库 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/GBServerHookController.php:752 — // TODO: 推送报警通知 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/GBServerHookController.php:788 — // TODO: 根据业务需求更新数据库 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/GBServerHookController.php:1249 — // TODO: 记录设备入站订阅到数据库(设备订阅平台,与平台订阅设备方向相反) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/GBServerHookController.php:1265 — // TODO: 更新订阅状态 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/ZLMHookController.php:54 — // TODO: 统计流量数据,可用于计费或流量分析 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/ZLMHookController.php:73 — // TODO: HTTP 文件访问鉴权 — 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 app/api/v2/controller/ZLMHookController.php:93 — // TODO: 播放鉴权和统计 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/ZLMHookController.php:118 — // TODO:对于云录制的流需开启此功能 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/ZLMHookController.php:156 — // TODO: enable_audio 根据通道 has_audio 字段判断(目前通道表无此字段) — 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 app/api/v2/controller/ZLMHookController.php:285 — // TODO: HLS/TS 录像文件处理 — 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 app/api/v2/controller/ZLMHookController.php:303 — // TODO: RTSP 认证 — 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 app/api/v2/controller/ZLMHookController.php:322 — // TODO: 返回 RTSP realm — 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 app/api/v2/controller/ZLMHookController.php:342 — // TODO: 服务器启动处理 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/ZLMHookController.php:360 — // TODO: Shell 登录鉴权 — 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 app/api/v2/controller/ZLMHookController.php:389 — // // TODO: 更新流状态、通知前端 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/ZLMHookController.php:392 — // // TODO: 清理会话、更新流状态 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/api/v2/controller/ZLMHookController.php:476 — // TODO: 流未找到处理 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 51 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×22
  • Swallowed exception (caught, then discarded) support/utils/DeviceToolkit.php:135 — `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/queue/redis/fast/FileAfterUploadProcess.php:113 — `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) Gb28181Gateway/src/Transport/RabbitMQTransport.php:130 — `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) Gb28181Gateway/src/Libs/ClientRedis.php:47 — `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) Gb28181Gateway/src/Libs/ClientRedis.php:63 — `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) Gb28181Gateway/src/Libs/ClientRedis.php:197 — `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) CoreW/Sdk/LeChangeSdk/Controller.php:44 — `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) CoreW/Provider/ExtensionsProvider.php:101 — `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) CoreW/Dao/GeneralDaoImpl.php:89 — `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) CoreW/Dao/GeneralDaoImpl.php:99 — `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) CoreW/Business/MediaServer/Strategy/SRSStrategy.php:112 — `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) CoreW/Business/MediaServer/Strategy/SRSStrategy.php:137 — `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) CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:239 — `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) CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:253 — `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) CoreW/Business/LiveProvider/Strategy/Impl/YS7LeChangeStrategy.php:21 — `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) CoreW/Business/LiveProvider/Strategy/Impl/YS7LeChangeStrategy.php:28 — `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) CoreW/Business/LiveProvider/Strategy/Impl/Ys7Strategy.php:89 — `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) CoreW/Business/GB/Gb28181Service.php:46 — `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) CoreW/Business/GB/Gb28181Service.php:65 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) CoreW/Business/GB/SSRCFactory.php:96 — `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) CoreW/Business/Devices/Traits/GB28181StreamTrait.php:453 — `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) CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:507 — `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.
D3 · God Classes · TooManyMethods · ×20
  • TooManyMethods: Gb28181Service CoreW/Business/GB/Gb28181Service.php:26 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GB28181Handler Gb28181Gateway/src/Handlers/GB28181Handler.php:102 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DeviceServiceImpl CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:21 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. Most of these members implement Service.DeviceService (58 of 71 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: UserServiceImpl CoreW/Business/User/Service/Impl/UserServiceImpl.php:25 — TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. Most of these members implement Service.UserService (55 of 70 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: CommandDispatcher Gb28181Gateway/src/Message/CommandDispatcher.php:33 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: VIPServiceImpl CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:36 — TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GBS Gb28181Gateway/src/SwooleServer/GBS.php:11 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.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: GBServer swoole-gbs/gbs-beta.php:356 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.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: ProductServiceImpl CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:40 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 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.
  • TooManyMethods: Gb28181Client CoreW/Sdk/PSipGateway/Gb28181Client.php:14 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProductController app/api/v1/controller/ProductController.php:26 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ZLMClient CoreW/Sdk/ZLMediaKit/ZLMClient.php:14 — 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: GBServerHookController app/api/v2/controller/GBServerHookController.php:30 — 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: OpenYs7 CoreW/Sdk/Ys7Sdk/OpenYs7.php:20 — 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: SendRtpDo CoreW/Sdk/ZLMediaKit/Dos/SendRtpDo.php:9 — 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: AttachmentServiceImpl CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:24 — 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: RecordTaskServiceImpl CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:21 — 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: StreamProxyServiceImpl CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:17 — 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: QuerySender Gb28181Gateway/src/Message/QuerySender.php:13 — 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: ExoSip exosip.stub.php:31 — 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) · ×14
  • Swallowed exception (empty catch) swoole-gbs/gbs-beta.php:994 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) swoole-gbs/gbs-beta.php:1020 — 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) swoole-gbs/gbs-beta.php:1244 — 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) swoole-gbs/gbs-beta.php:1307 — 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) support/utils/ImageToolkit.php:125 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/admin/controller/GB28181ChannelController.php:363 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Gb28181Gateway/src/SwooleServer/GBS.php:649 — 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) Gb28181Gateway/src/SwooleServer/GBS.php:675 — 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) Gb28181Gateway/src/SwooleServer/GBS.php:899 — 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) Gb28181Gateway/src/SwooleServer/GBS.php:962 — 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) Gb28181Gateway/src/Handlers/GB28181Handler.php:628 — 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) CoreW/Sdk/LeChangeSdk/Api.php: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) CoreW/Business/SystemLog/Service/Impl/SystemLogServiceImpl.php:119 — 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) CoreW/Business/Attachment/Implementors/Impl/LocalFileImplementor.php:90 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D3 · God Classes · ClassTooLong · ×13
  • ClassTooLong: GBS Gb28181Gateway/src/SwooleServer/GBS.php:11 — ClassTooLong — 1865 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 1465 over it, 4.66× 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: GBServer swoole-gbs/gbs-beta.php:356 — ClassTooLong — 1865 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 1465 over it, 4.66× 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: GB28181Handler Gb28181Gateway/src/Handlers/GB28181Handler.php:102 — ClassTooLong — 1506 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods. The bar is 400 significant lines; this is 1106 over it, 3.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CommandDispatcher Gb28181Gateway/src/Message/CommandDispatcher.php:33 — ClassTooLong — 1410 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 400 significant lines; this is 1010 over it, 3.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.
  • ClassTooLong: ProductServiceImpl CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:40 — ClassTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 411 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GBServerHookController app/api/v2/controller/GBServerHookController.php:30 — ClassTooLong — 705 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 305 over it, 1.76× 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: DeviceServiceImpl CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:21 — ClassTooLong — 577 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 177 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: VIPServiceImpl CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:36 — ClassTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 171 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: StreamProxyServiceImpl CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:17 — ClassTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 115 over it, 1.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: Gb28181Service CoreW/Business/GB/Gb28181Service.php:26 — ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 400 significant lines; this is 104 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UserServiceImpl CoreW/Business/User/Service/Impl/UserServiceImpl.php:25 — ClassTooLong — 484 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 84 over it, 1.21× 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: ZLMClient CoreW/Sdk/ZLMediaKit/ZLMClient.php:14 — ClassTooLong — 465 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 65 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Gb28181Client CoreW/Sdk/PSipGateway/Gb28181Client.php:14 — ClassTooLong — 433 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 33 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · MethodTooLong · ×13
  • MethodTooLong: LogEnum.getActionItems CoreW/Business/SystemLog/LogEnum.php:253 — MethodTooLong — getActionItems runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: GBS.requestInvite Gb28181Gateway/src/SwooleServer/GBS.php:2301 — MethodTooLong — requestInvite runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× 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: GBServer.requestInvite swoole-gbs/gbs-beta.php:2646 — MethodTooLong — requestInvite runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× 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: GBS.parseCatalogResponse Gb28181Gateway/src/SwooleServer/GBS.php:1986 — MethodTooLong — parseCatalogResponse 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: GBServer.parseCatalogResponse swoole-gbs/gbs-beta.php:2331 — MethodTooLong — parseCatalogResponse 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: GBS.handleMessageRequest Gb28181Gateway/src/SwooleServer/GBS.php:684 — MethodTooLong — handleMessageRequest 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: GBS.sendInvite Gb28181Gateway/src/SwooleServer/GBS.php:1681 — MethodTooLong — sendInvite 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: GBServer.handleMessageRequest swoole-gbs/gbs-beta.php:1029 — MethodTooLong — handleMessageRequest 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: GBServer.sendInvite swoole-gbs/gbs-beta.php:2026 — MethodTooLong — sendInvite 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: GB28181Handler.handleBroadcastSetupRtpResult Gb28181Gateway/src/Handlers/GB28181Handler.php:895 — MethodTooLong — handleBroadcastSetupRtpResult runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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: SubscribeServiceImpl.applySubscribeConfig CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:95 — MethodTooLong — applySubscribeConfig runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RecordFileServiceImpl.createFromHook CoreW/Business/RecordFile/Service/Impl/RecordFileServiceImpl.php:27 — MethodTooLong — createFromHook runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.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: GB28181Handler.handleRegister Gb28181Gateway/src/Handlers/GB28181Handler.php:1062 — MethodTooLong — handleRegister runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×12
  • Duplicated block (5 lines × 2) app/queue/redis/fast/PanoramaChunkTilesJob.php:266 — app/queue/redis/fast/PanoramaChunkTilesJob.php:266-270 | app/queue/redis/fast/PanoramaChunkTilesJob.php:300-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/queue/redis/fast/PanoramaChunkTilesJob.php:266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) support/utils/FileToolkit.php:30 — support/utils/FileToolkit.php:30-34 | support/utils/FileToolkit.php:58-62 — both copies are in the same file, so extract the 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 `support/utils/FileToolkit.php:30` it does not close everything it opens, so those exact lines 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) CoreW/Sdk/AMapSdk/AMapClient.php:246 — CoreW/Sdk/AMapSdk/AMapClient.php:246-250 | CoreW/Sdk/Iot/Driver/Base.php:245-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) REDACTED:236 — REDACTED:236-241 | REDACTED:218-222 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 137 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:252 — REDACTED:252-258 | REDACTED:233-237 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 137 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 (5 lines × 2) Gb28181Gateway/src/SwooleServer/Channel.php:52 — Gb28181Gateway/src/SwooleServer/Channel.php:52-56 | swoole-gbs/gbs-beta.php:144-148 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/Channel.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 87 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) Gb28181Gateway/src/SwooleServer/GBS.php:133 — Gb28181Gateway/src/SwooleServer/GBS.php:133-137 | swoole-gbs/gbs-beta.php:478-482 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (5 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:180 — Gb28181Gateway/src/SwooleServer/GBS.php:180-184 | swoole-gbs/gbs-beta.php:525-529 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) Gb28181Gateway/src/SwooleServer/GBS.php:331 — Gb28181Gateway/src/SwooleServer/GBS.php:331-335 | swoole-gbs/gbs-beta.php:676-680 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:331` it does not close everything it opens, so those 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) Gb28181Gateway/src/SwooleServer/GBS.php:522 — Gb28181Gateway/src/SwooleServer/GBS.php:522-526 | swoole-gbs/gbs-beta.php:867-871 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) Gb28181Gateway/src/SwooleServer/Helper.php:17 — Gb28181Gateway/src/SwooleServer/Helper.php:17-21 | swoole-gbs/gbs-beta.php:30-34 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/Helper.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 `Gb28181Gateway/src/SwooleServer/Helper.php:17` it does not close everything it opens, so those 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) CoreW/JsonLogger.php:13 — CoreW/JsonLogger.php:13-17 | CoreW/Mail/Logger/JsonLogger.php:13-17 — 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.
D3 · God Classes · FileTooLong · ×11
  • FileTooLong: swoole-gbs/gbs-beta.php swoole-gbs/gbs-beta.php — FileTooLong — 2120 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: GBServer (356-3029). The bar is 500 significant lines; this is 1620 over it, 4.24× 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: SwooleServer/GBS.php Gb28181Gateway/src/SwooleServer/GBS.php — FileTooLong — 1872 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: GBS (11-2684). The bar is 500 significant lines; this is 1372 over it, 3.74× 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/GB28181Handler.php Gb28181Gateway/src/Handlers/GB28181Handler.php — FileTooLong — 1534 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: GB28181Handler (102-3224). The bar is 500 significant lines; this is 1034 over it, 3.07× 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: Message/CommandDispatcher.php Gb28181Gateway/src/Message/CommandDispatcher.php — FileTooLong — 1414 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: CommandDispatcher (33-2690). The bar is 500 significant lines; this is 914 over it, 2.83× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Impl/ProductServiceImpl.php CoreW/Business/Product/Service/Impl/ProductServiceImpl.php — FileTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: ProductServiceImpl (40-1545). The bar is 500 significant lines; this is 344 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: controller/GBServerHookController.php app/api/v2/controller/GBServerHookController.php — FileTooLong — 720 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: GBServerHookController (30-1399). The bar is 500 significant lines; this is 220 over it, 1.44× 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: Impl/VIPServiceImpl.php CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php — FileTooLong — 602 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: VIPServiceImpl (36-1188). The bar is 500 significant lines; this is 102 over it, 1.20× 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: Impl/DeviceServiceImpl.php CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php — FileTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: DeviceServiceImpl (21-1149). The bar is 500 significant lines; this is 94 over it, 1.19× 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: Impl/StreamProxyServiceImpl.php CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php — FileTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: StreamProxyServiceImpl (17-931). The bar is 500 significant lines; this is 28 over it, 1.06× 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: GB/Gb28181Service.php CoreW/Business/GB/Gb28181Service.php — FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: Gb28181Service (26-1510). The bar is 500 significant lines; this is 26 over it, 1.05× 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: Impl/UserServiceImpl.php CoreW/Business/User/Service/Impl/UserServiceImpl.php — FileTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: UserServiceImpl (25-1015). The bar is 500 significant lines; this is 4 over it, 1.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×11
  • Duplicated block (9 lines × 2) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:299 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:299-307 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:293-301 — before extracting anything, compare `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php` and `CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 129 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 `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:299` it does not close everything it opens, so those exact lines 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) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:490 — CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:490-498 | CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:519-527 — both copies are in the same file, so extract the 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) CoreW/Business/User/Dao/Impl/UserDaoImpl.php:185 — CoreW/Business/User/Dao/Impl/UserDaoImpl.php:185-193 | CoreW/Business/User/Dao/Impl/UserDaoImpl.php:195-203 — both copies are in the same file, so extract the 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) CoreW/Business/User/Service/Impl/TokenServiceImpl.php:109 — CoreW/Business/User/Service/Impl/TokenServiceImpl.php:109-117 | CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php:125-133 — before extracting anything, compare `CoreW/Business/User/Service/Impl/TokenServiceImpl.php` and `CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 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) CoreW/Provider/ExtensionsProvider.php:54 — CoreW/Provider/ExtensionsProvider.php:54-62 | CoreW/Provider/ExtensionsProvider.php:70-79 — both copies are in the same file, so extract the 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 `CoreW/Provider/ExtensionsProvider.php:54` it begins part-way through the construct above it, so those exact lines 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) CoreW/Business/User/Service/Impl/TokenServiceImpl.php:140 — CoreW/Business/User/Service/Impl/TokenServiceImpl.php:140-148 | CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php:154-162 — before extracting anything, compare `CoreW/Business/User/Service/Impl/TokenServiceImpl.php` and `CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) CoreW/RateLimiter/TimeMachine.php:75 — CoreW/RateLimiter/TimeMachine.php:75-83 | support/utils/TimeMachineToolkit.php:110-118 — before extracting anything, compare `CoreW/RateLimiter/TimeMachine.php` and `support/utils/TimeMachineToolkit.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) CoreW/Traits/ImagineTrait.php:12 — CoreW/Traits/ImagineTrait.php:12-20 | support/utils/ImageToolkit.php:133-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) Gb28181Gateway/src/SwooleServer/GBS.php:1503 — Gb28181Gateway/src/SwooleServer/GBS.php:1503-1511 | swoole-gbs/gbs-beta.php:1848-1856 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (9 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1945 — Gb28181Gateway/src/SwooleServer/GBS.php:1945-1953 | swoole-gbs/gbs-beta.php:2290-2298 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (9 lines × 2) CoreW/Business/User/Service/Impl/UserServiceImpl.php:655 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:655-663 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:892-900 — 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 (7 lines × 2) · ×10
  • Duplicated block (7 lines × 2) CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:547 — CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:547-553 | CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:575-581 — both copies are in the same file, so extract the 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 `CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:547` it begins part-way through the construct above it, so those 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, `CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:583` calls `send` and `CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php: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 (7 lines × 2) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:631 — CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:631-637 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:684-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. 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 (7 lines × 2) CoreW/Dao/DaoProxy.php:389 — CoreW/Dao/DaoProxy.php:389-395 | CoreW/Dao/DaoProxy.php:410-416 — both copies are in the same file, so extract the 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 `CoreW/Dao/DaoProxy.php:389` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/admin/controller/GB28181DeviceController.php:32 — app/admin/controller/GB28181DeviceController.php:32-41 | app/api/v2/controller/GB28181DeviceController.php:25-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) CoreW/Business/User/Dao/Impl/UserDaoImpl.php:69 — CoreW/Business/User/Dao/Impl/UserDaoImpl.php:69-75 | CoreW/Business/VIP/Dao/Impl/VIPProfileDaoImpl.php:21-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) CoreW/Business/User/Service/Impl/TokenServiceImpl.php:72 — CoreW/Business/User/Service/Impl/TokenServiceImpl.php:72-78 | CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php:81-87 — before extracting anything, compare `CoreW/Business/User/Service/Impl/TokenServiceImpl.php` and `CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 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) CoreW/JsonLogger.php:22 — CoreW/JsonLogger.php:22-28 | CoreW/Mail/Logger/JsonLogger.php:22-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:539 — Gb28181Gateway/src/SwooleServer/GBS.php:539-545 | swoole-gbs/gbs-beta.php:884-890 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (7 lines × 2) CoreW/Business/User/Service/Impl/UserServiceImpl.php:577 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:577-583 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:845-851 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) CoreW/Business/User/Service/Impl/TokenServiceImpl.php:33 — CoreW/Business/User/Service/Impl/TokenServiceImpl.php:33-39 | CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php:37-43 — before extracting anything, compare `CoreW/Business/User/Service/Impl/TokenServiceImpl.php` and `CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 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 (6 lines × 2) · ×9
  • Duplicated block (6 lines × 2) CoreW/Sdk/PSipGateway/Gb28181Client.php:592 — CoreW/Sdk/PSipGateway/Gb28181Client.php:592-597 | Gb28181Gateway/src/Message/CommandDispatcher.php:2237-2242 — 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) app/admin/controller/GB28181ChannelController.php:128 — app/admin/controller/GB28181ChannelController.php:128-145 | app/admin/controller/GB28181DeviceController.php:157-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/GB28181ChannelController.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) app/command/Gb28181Server.php:253 — app/command/Gb28181Server.php:253-258 | app/command/Gb28181Server.php:267-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/command/Gb28181Server.php: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 (6 lines × 2) app/queue/redis/fast/FileAfterUploadProcess.php:148 — app/queue/redis/fast/FileAfterUploadProcess.php:148-153 | app/queue/redis/fast/FileAfterUploadProcess.php:180-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) CoreW/Business/GB/Gb28181Service.php:1389 — CoreW/Business/GB/Gb28181Service.php:1389-1394 | CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:700-705 — 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) Gb28181Gateway/src/SwooleServer/Helper.php:46 — Gb28181Gateway/src/SwooleServer/Helper.php:46-51 | swoole-gbs/gbs-beta.php:50-55 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/Helper.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 (6 lines × 2) Gb28181Gateway/src/SwooleServer/RTPPortManager.php:49 — Gb28181Gateway/src/SwooleServer/RTPPortManager.php:49-54 | swoole-gbs/gbs-beta.php:326-331 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/RTPPortManager.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: 95% 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 (6 lines × 2) app/admin/controller/AlarmPlanController.php:153 — app/admin/controller/AlarmPlanController.php:153-158 | app/admin/controller/GB28181RecordPlanController.php:207-212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/admin/controller/MenuController.php:80 — app/admin/controller/MenuController.php:80-85 | app/admin/controller/RoleController.php:104-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/MenuController.php:80` 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 lines × 2) · ×8
  • Duplicated block (10 lines × 2) CoreW/RateLimiter/TimeMachine.php:88 — CoreW/RateLimiter/TimeMachine.php:88-97 | support/utils/TimeMachineToolkit.php:123-132 — before extracting anything, compare `CoreW/RateLimiter/TimeMachine.php` and `support/utils/TimeMachineToolkit.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 (10 lines × 2) Gb28181Gateway/src/Handlers/GB28181Handler.php:327 — Gb28181Gateway/src/Handlers/GB28181Handler.php:327-336 | Gb28181Gateway/src/Handlers/GB28181Handler.php:347-356 — both copies are in the same file, so extract the 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 `Gb28181Gateway/src/Handlers/GB28181Handler.php:327` 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, `Gb28181Gateway/src/Handlers/GB28181Handler.php:346` calls `log`, `implode` and `Gb28181Gateway/src/Handlers/GB28181Handler.php:326` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2252 — Gb28181Gateway/src/SwooleServer/GBS.php:2252-2261 | swoole-gbs/gbs-beta.php:2597-2606 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (10 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2284 — Gb28181Gateway/src/SwooleServer/GBS.php:2284-2293 | swoole-gbs/gbs-beta.php:2629-2638 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (10 lines × 2) app/api/v1/controller/AuthController.php:94 — app/api/v1/controller/AuthController.php:94-103 | app/api/v1/controller/AuthController.php:119-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) app/command/Gb28181Server.php:242 — app/command/Gb28181Server.php:242-251 | app/command/Gb28181Server.php:256-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/command/Gb28181Server.php:242` it begins part-way through the construct above it, so those exact lines 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) support/utils/FileToolkit.php:971 — support/utils/FileToolkit.php:971-980 | support/utils/FileToolkit.php:1002-1011 — both copies are in the same file, so extract the 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 `support/utils/FileToolkit.php:971` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) app/admin/controller/RoleController.php:184 — app/admin/controller/RoleController.php:184-194 | app/admin/controller/UserController.php:282-291 — 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 (8 lines × 2) · ×8
  • Duplicated block (8 lines × 2) CoreW/Mail/AbstractMail.php:78 — CoreW/Mail/AbstractMail.php:78-85 | CoreW/Sdk/AMapSdk/AMapClient.php:77-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1428 — Gb28181Gateway/src/SwooleServer/GBS.php:1428-1435 | swoole-gbs/gbs-beta.php:1773-1780 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:524 — CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:524-531 | app/queue/redis/fast/MakeUploadChunkTmpFile.php:79-86 — 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 (8 lines × 2) CoreW/Business/Constants.php:245 — CoreW/Business/Constants.php:245-252 | CoreW/Traits/EnumTrait.php:19-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. 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) CoreW/Oauth2/Client/WechatMobOauthClient.php:45 — CoreW/Oauth2/Client/WechatMobOauthClient.php:45-53 | CoreW/Oauth2/Client/WechatWebOAuthClient.php:45-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2195 — Gb28181Gateway/src/SwooleServer/GBS.php:2195-2202 | swoole-gbs/gbs-beta.php:2540-2547 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) app/admin/controller/AlarmPlanController.php:67 — app/admin/controller/AlarmPlanController.php:67-74 | app/admin/controller/GB28181RecordPlanController.php:71-78 — 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) app/admin/controller/AlarmPlanController.php:82 — app/admin/controller/AlarmPlanController.php:82-89 | app/admin/controller/GB28181RecordPlanController.php:87-94 — 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 (13 lines × 2) · ×7
  • Duplicated block (13 lines × 2) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:320 — CoreW/Business/System/Service/Impl/SystemServiceImpl.php:320-332 | CoreW/Business/System/Service/Impl/SystemServiceImpl.php:343-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `CoreW/Business/System/Service/Impl/SystemServiceImpl.php:320` it begins part-way through the construct above it, so those exact lines 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) Gb28181Gateway/src/Message/CommandDispatcher.php:185 — Gb28181Gateway/src/Message/CommandDispatcher.php:185-198 | Gb28181Gateway/src/Message/CommandDispatcher.php:328-340 — both copies are in the same file, so extract the 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 `Gb28181Gateway/src/Message/CommandDispatcher.php:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:505 — Gb28181Gateway/src/SwooleServer/GBS.php:505-517 | swoole-gbs/gbs-beta.php:850-862 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (13 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1252 — Gb28181Gateway/src/SwooleServer/GBS.php:1252-1264 | swoole-gbs/gbs-beta.php:1597-1609 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (13 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1307 — Gb28181Gateway/src/SwooleServer/GBS.php:1307-1319 | swoole-gbs/gbs-beta.php:1652-1664 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (13 lines × 2) app/admin/controller/AttachmentController.php:206 — app/admin/controller/AttachmentController.php:206-218 | app/api/v1/controller/UploadController.php:20-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) app/admin/controller/GB28181PTZController.php:96 — app/admin/controller/GB28181PTZController.php:96-108 | app/admin/controller/GB28181PTZController.php:125-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/GB28181PTZController.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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×7
  • Duplicated block (11 lines × 2) CoreW/Business/Devices/Traits/GB28181StreamTrait.php:302 — CoreW/Business/Devices/Traits/GB28181StreamTrait.php:302-312 | CoreW/Business/Devices/Traits/GB28181StreamTrait.php:561-571 — both copies are in the same file, so extract the 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 `CoreW/Business/Devices/Traits/GB28181StreamTrait.php:302` it begins part-way through the construct above it, so those exact lines 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) CoreW/Business/Snapshot/Service/Impl/SnapshotFileServiceImpl.php:217 — CoreW/Business/Snapshot/Service/Impl/SnapshotFileServiceImpl.php:217-227 | CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:810-820 — 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 (11 lines × 2) CoreW/Business/User/Service/Impl/UserServiceImpl.php:712 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:712-722 | CoreW/Business/User/Service/Impl/UserServiceImpl.php:791-801 — both copies are in the same file, so extract the 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) CoreW/RateLimiter/TimeMachine.php:111 — CoreW/RateLimiter/TimeMachine.php:111-121 | support/utils/TimeMachineToolkit.php:137-147 — before extracting anything, compare `CoreW/RateLimiter/TimeMachine.php` and `support/utils/TimeMachineToolkit.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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) CoreW/Sdk/Iot/Driver/Base.php:145 — CoreW/Sdk/Iot/Driver/Base.php:145-155 | CoreW/Sdk/Iot/Driver/BytV4.php:113-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Gb28181Gateway/src/Message/CommandDispatcher.php:1685 — Gb28181Gateway/src/Message/CommandDispatcher.php:1685-1695 | Gb28181Gateway/src/Message/CommandDispatcher.php:1785-1795 — both copies are in the same file, so extract the 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) CoreW/Sdk/AMapSdk/Libs/Response.php:34 — CoreW/Sdk/AMapSdk/Libs/Response.php:34-44 | CoreW/Sdk/Iot/HttpResponse.php:32-42 — before extracting anything, compare `CoreW/Sdk/AMapSdk/Libs/Response.php` and `CoreW/Sdk/Iot/HttpResponse.php` as WHOLE FILES: 87% 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 · Edited copy of a member (12 corresponding lines) · ×6
  • Edited copy of a member (12 corresponding lines) app/admin/controller/MenuController.php:18 — app/admin/controller/MenuController.php:18-29 | app/admin/controller/RoleController.php:19-30 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:1013 — CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:1013-1024 | CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:1030-1048 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) CoreW/Sdk/Ys7Sdk/OpenYs7.php:447 — CoreW/Sdk/Ys7Sdk/OpenYs7.php:447-461 | CoreW/Sdk/Ys7Sdk/OpenYs7.php:475-486 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) CoreW/Dao/GeneralDaoImpl.php:70 — CoreW/Dao/GeneralDaoImpl.php:70-81 | REDACTED:50-61 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Gb28181Gateway/src/Message/CommandDispatcher.php:793 — Gb28181Gateway/src/Message/CommandDispatcher.php:793-809 | Gb28181Gateway/src/Message/CommandDispatcher.php:820-831 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) support/utils/ArrayToolkit.php:27 — support/utils/ArrayToolkit.php:27-43 | app/admin/controller/UserController.php:311-322 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×6
  • Duplicated block (18 lines × 2) Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:123 — Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:123-140 | Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:183-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.
  • Duplicated block (18 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:340 — Gb28181Gateway/src/SwooleServer/GBS.php:340-357 | swoole-gbs/gbs-beta.php:685-702 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (18 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:362 — Gb28181Gateway/src/SwooleServer/GBS.php:362-379 | swoole-gbs/gbs-beta.php:707-724 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (18 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:660 — Gb28181Gateway/src/SwooleServer/GBS.php:660-677 | swoole-gbs/gbs-beta.php:1005-1022 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (18 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2665 — Gb28181Gateway/src/SwooleServer/GBS.php:2665-2682 | swoole-gbs/gbs-beta.php:3010-3027 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (18 lines × 2) app/api/v1/controller/ProductController.php:50 — app/api/v1/controller/ProductController.php:50-67 | app/api/v1/controller/ProductController.php:160-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D15 · Churn × Complexity Hotspots · Hotspot · ×5
  • Hotspot: Gb28181Gateway/src/Handlers/GB28181Handler.php Gb28181Gateway/src/Handlers/GB28181Handler.php:468 — Gb28181Gateway/src/Handlers/GB28181Handler.php changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in GB28181Handler.tick at line 468. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-04-21..2026-07-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-21 17:12:34 +08:00' --until='2026-07-20 17:12:34 +08:00' --full-history --no-merges -- Gb28181Gateway/src/Handlers/GB28181Handler.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/admin/controller/GB28181RecordingController.php app/admin/controller/GB28181RecordingController.php:95 — app/admin/controller/GB28181RecordingController.php changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in GB28181RecordingController.startRecord at line 95. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-04-21..2026-07-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-21 17:12:34 +08:00' --until='2026-07-20 17:12:34 +08:00' --full-history --no-merges -- app/admin/controller/GB28181RecordingController.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/command/Gb28181Server.php app/command/Gb28181Server.php:166 — app/command/Gb28181Server.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in Gb28181Server.statusServer at line 166. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-04-21..2026-07-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-21 17:12:34 +08:00' --until='2026-07-20 17:12:34 +08:00' --full-history --no-merges -- app/command/Gb28181Server.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:358 — CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in DeviceServiceImpl.batchUpdateOrCreateChannels at line 358. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-04-21..2026-07-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-21 17:12:34 +08:00' --until='2026-07-20 17:12:34 +08:00' --full-history --no-merges -- CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/admin/controller/GB28181DeviceController.php app/admin/controller/GB28181DeviceController.php:153 — app/admin/controller/GB28181DeviceController.php changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in GB28181DeviceController.update at line 153. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-04-21..2026-07-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-04-21 17:12:34 +08:00' --until='2026-07-20 17:12:34 +08:00' --full-history --no-merges -- app/admin/controller/GB28181DeviceController.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:270 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:270-334 | CoreW/Business/Attachment/Implementors/Impl/LocalFileImplementor.php:172-242 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:258-322 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:264-327 — 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:92 — REDACTED:92-127 | REDACTED:191-224 | REDACTED:89-118 | REDACTED:179-206 — 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) Gb28181Gateway/src/Message/CommandDispatcher.php:1483 — Gb28181Gateway/src/Message/CommandDispatcher.php:1483-1497 | Gb28181Gateway/src/Message/CommandDispatcher.php:1505-1519 | Gb28181Gateway/src/Message/CommandDispatcher.php:1527-1541 | Gb28181Gateway/src/Message/CommandDispatcher.php:1549-1563 — 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) Gb28181Gateway/src/SwooleServer/GBS.php:1269 — Gb28181Gateway/src/SwooleServer/GBS.php:1269-1287 | Gb28181Gateway/src/SwooleServer/GBS.php:1370-1396 | swoole-gbs/gbs-beta.php:1614-1632 | swoole-gbs/gbs-beta.php:1715-1741 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/command/MakeBizCommand.php:43 — app/command/MakeBizCommand.php:43-67 | app/command/MakeBizDaoCommand.php:43-68 | app/command/MakeBizExceptionCommand.php:40-64 | app/command/MakeBizServiceCommand.php:41-66 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×5
  • Edited copy of a member (11 corresponding lines) CoreW/Business/User/Service/Impl/TokenServiceImpl.php:33 — CoreW/Business/User/Service/Impl/TokenServiceImpl.php:33-43 | CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php:37-51 — 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) Gb28181Gateway/src/Message/QuerySender.php:131 — Gb28181Gateway/src/Message/QuerySender.php:131-143 | Gb28181Gateway/src/Message/QuerySender.php:209-219 — 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) Gb28181Gateway/src/Handlers/GB28181Handler.php:2649 — Gb28181Gateway/src/Handlers/GB28181Handler.php:2649-2659 | Gb28181Gateway/src/Handlers/GB28181Handler.php:2667-2677 — 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) CoreW/Sdk/ZLMediaKit/ZLMClient.php:59 — CoreW/Sdk/ZLMediaKit/ZLMClient.php:59-69 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:977-989 — 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) app/admin/controller/GB28181DeviceController.php:59 — app/admin/controller/GB28181DeviceController.php:59-69 | app/api/v2/controller/GB28181DeviceController.php:98-108 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×5
  • Edited copy of a member (15 corresponding lines) app/api/v1/controller/AuthController.php:87 — app/api/v1/controller/AuthController.php:87-103 | app/api/v1/controller/AuthController.php:114-128 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) app/admin/controller/AlarmEventController.php:18 — app/admin/controller/AlarmEventController.php:18-32 | app/admin/controller/GB28181SubscribeController.php:99-113 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) CoreW/Dao/DaoProxy.php:133 — CoreW/Dao/DaoProxy.php:133-151 | CoreW/Dao/DaoProxy.php:156-170 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) CoreW/Business/MediaServer/Service/Impl/MediaServerServiceImpl.php:175 — CoreW/Business/MediaServer/Service/Impl/MediaServerServiceImpl.php:175-192 | CoreW/Business/MediaServer/Service/Impl/MediaServerServiceImpl.php:197-211 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) CoreW/Traits/Token/RedisTokenStorage.php:184 — CoreW/Traits/Token/RedisTokenStorage.php:184-198 | CoreW/Traits/Token/RedisTokenStorage.php:222-236 — 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×4
  • Edited copy of a member (20 corresponding lines) CoreW/Exception/ExceptionUtil.php:15 — CoreW/Exception/ExceptionUtil.php:15-38 | support/utils/ExceptionUtil.php:16-35 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) app/admin/controller/GB28181DeviceController.php:32 — app/admin/controller/GB28181DeviceController.php:32-51 | app/api/v2/controller/GB28181DeviceController.php:25-45 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) app/admin/controller/GB28181DeviceController.php:77 — app/admin/controller/GB28181DeviceController.php:77-96 | app/api/v2/controller/GB28181DeviceController.php:170-189 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) CoreW/Sdk/ZLMediaKit/ZLMClient.php:507 — CoreW/Sdk/ZLMediaKit/ZLMClient.php:507-526 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:540-559 — 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 (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:730 — CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:730-737 | CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:1004-1012 — 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.
  • Edited copy of a member (8 corresponding lines) CoreW/Business/LiveProvider/Strategy/Impl/Ys7Strategy.php:209 — CoreW/Business/LiveProvider/Strategy/Impl/Ys7Strategy.php:209-218 | CoreW/Business/LiveProvider/Strategy/Impl/LeChangeStrategy.php:290-297 — 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.
  • Edited copy of a member (8 corresponding lines) app/admin/controller/GB28181RecordPlanController.php:55 — app/admin/controller/GB28181RecordPlanController.php:55-62 | app/admin/controller/AlarmPlanController.php:50-59 — 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.
  • Edited copy of a member (8 corresponding lines) CoreW/Business/User/Service/Impl/UserServiceImpl.php:866 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:866-873 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:431-438 — 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 (4 corresponding lines) · ×4
  • Edited copy of a member (4 corresponding lines) Gb28181Gateway/src/SwooleServer/Helper.php:113 — Gb28181Gateway/src/SwooleServer/Helper.php:113-117 | swoole-gbs/gbs-beta.php:3036-3039 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) app/command/MakeBizCommand.php:30 — app/command/MakeBizCommand.php:30-33 | app/command/MakeBizDaoCommand.php:30-33 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) CoreW/RateLimiter/TimeMachine.php:67 — CoreW/RateLimiter/TimeMachine.php:67-70 | support/utils/TimeMachineToolkit.php:102-105 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Gb28181Gateway/src/SwooleServer/RTPPortManager.php:60 — Gb28181Gateway/src/SwooleServer/RTPPortManager.php:60-63 | swoole-gbs/gbs-beta.php:337-340 — 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 (25 lines × 2) · ×4
  • Duplicated block (25 lines × 2) CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:220 — CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:220-244 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:294-318 — both copies are in the same file, so extract the 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) Gb28181Gateway/src/SwooleServer/GBS.php:973 — Gb28181Gateway/src/SwooleServer/GBS.php:973-997 | swoole-gbs/gbs-beta.php:1318-1342 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (25 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1958 — Gb28181Gateway/src/SwooleServer/GBS.php:1958-1982 | swoole-gbs/gbs-beta.php:2303-2327 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) Gb28181Gateway/src/Message/CommandType/CatalogCommand.php:16 — Gb28181Gateway/src/Message/CommandType/CatalogCommand.php:16-54 | Gb28181Gateway/src/Message/CommandType/RecordInfoCommand.php:16-40 — 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 (23 lines × 2) · ×4
  • Duplicated block (23 lines × 2) CoreW/Sdk/AMapSdk/AMapClient.php:255 — CoreW/Sdk/AMapSdk/AMapClient.php:255-277 | CoreW/Sdk/Iot/Driver/Base.php:254-277 — 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 (23 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1045 — Gb28181Gateway/src/SwooleServer/GBS.php:1045-1067 | swoole-gbs/gbs-beta.php:1390-1412 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (23 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1652 — Gb28181Gateway/src/SwooleServer/GBS.php:1652-1674 | swoole-gbs/gbs-beta.php:1997-2019 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (23 lines × 2) app/admin/controller/GB28181PTZController.php:20 — app/admin/controller/GB28181PTZController.php:20-42 | app/api/v2/controller/GB28181DeviceController.php:197-219 — 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 (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:235 — CoreW/Business/System/Service/Impl/SystemServiceImpl.php:235-250 | CoreW/Business/System/Service/Impl/SystemServiceImpl.php:252-267 — both copies are in the same file, so extract the 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 `CoreW/Business/System/Service/Impl/SystemServiceImpl.php:235` it does not close everything it opens, so those exact lines 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) Gb28181Gateway/src/Message/QuerySender.php:309 — Gb28181Gateway/src/Message/QuerySender.php:309-324 | Gb28181Gateway/src/Message/QuerySender.php:385-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 `Gb28181Gateway/src/Message/QuerySender.php:309` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1228 — Gb28181Gateway/src/SwooleServer/GBS.php:1228-1243 | swoole-gbs/gbs-beta.php:1573-1588 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (16 lines × 2) support/utils/SimpleValidator.php:32 — support/utils/SimpleValidator.php:32-47 | support/utils/SimpleValidator.php:73-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D12 · Dependency Hygiene · Abandoned package · ×3
  • Abandoned package: doctrine/annotations — `doctrine/annotations` is marked ABANDONED on Packagist, and this repository requires it at `^2.0` (locked at 2.0.1). An abandoned package receives no further releases — including security releases. Its maintainer named no replacement, so the migration target is yours to choose. This is a migration, not an upgrade: a newer release of an abandoned package is not a fix.
  • Abandoned package: doctrine/common — `doctrine/common` is marked ABANDONED on Packagist, and this repository requires it at `^3.4` (locked at 3.4.3). An abandoned package receives no further releases — including security releases. Its maintainer named no replacement, so the migration target is yours to choose. This is a migration, not an upgrade: a newer release of an abandoned package is not a fix.
  • Abandoned package: swiftmailer/swiftmailer — `swiftmailer/swiftmailer` is marked ABANDONED on Packagist, and this repository requires it at `^6.3` (locked at v6.3.0). An abandoned package receives no further releases — including security releases. Its maintainer names `symfony/mailer` as the replacement. This is a migration, not an upgrade: a newer release of an abandoned package is not a fix.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×3
  • Edited copy of a member (17 corresponding lines) CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:543 — CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:543-559 | CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:571-588 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:47 — REDACTED:47-66 | REDACTED:71-87 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:105 — CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:105-121 | CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:174-192 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) app/admin/controller/GB28181DeviceControlController.php:286 — app/admin/controller/GB28181DeviceControlController.php:286-303 | app/admin/controller/GB28181DeviceControlController.php:313-331 — 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) CoreW/Sdk/AMapSdk/AMapClient.php:153 — CoreW/Sdk/AMapSdk/AMapClient.php:153-170 | CoreW/Sdk/AMapSdk/AMapClient.php:185-207 — 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) CoreW/Sdk/ZLMediaKit/ZLMClient.php:189 — CoreW/Sdk/ZLMediaKit/ZLMClient.php:189-209 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:221-238 — 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 (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) support/utils/FileToolkit.php:30 — support/utils/FileToolkit.php:30-45 | support/utils/FileToolkit.php:58-81 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) CoreW/Business/Menu/Service/Impl/MenuServiceImpl.php:90 — CoreW/Business/Menu/Service/Impl/MenuServiceImpl.php:90-107 | CoreW/Business/Role/Service/Impl/RoleServiceImpl.php:74-89 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Gb28181Gateway/src/Transport/RedisTransport.php:44 — Gb28181Gateway/src/Transport/RedisTransport.php:44-59 | Gb28181Gateway/src/Transport/RedisTransport.php:65-82 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×3
  • Edited copy of a member (23 corresponding lines) CoreW/Business/DataFilters/Filter.php:160 — CoreW/Business/DataFilters/Filter.php:160-182 | CoreW/Business/DataFilters/Filter.php:187-211 — 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) CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:337 — CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:337-364 | CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:476-498 — 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) CoreW/Business/MediaServer/Strategy/SRSStrategy.php:208 — CoreW/Business/MediaServer/Strategy/SRSStrategy.php:208-230 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:1032-1062 — 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 (14 corresponding lines) · ×3
  • Edited copy of a member (14 corresponding lines) CoreW/Business/User/Service/Impl/UserServiceImpl.php:293 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:293-310 | CoreW/Business/User/Service/Impl/UserServiceImpl.php:315-328 — 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) CoreW/Business/DataFilters/Filter.php:99 — CoreW/Business/DataFilters/Filter.php:99-114 | CoreW/Business/DataFilters/Filter.php:122-135 — 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) CoreW/Sdk/ZLMediaKit/ZLMClient.php:833 — CoreW/Sdk/ZLMediaKit/ZLMClient.php:833-847 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:858-871 — 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 (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) CoreW/Sdk/ZLMediaKit/ZLMClient.php:466 — CoreW/Sdk/ZLMediaKit/ZLMClient.php:466-493 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:574-600 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) Gb28181Gateway/src/Message/CommandDispatcher.php:2460 — Gb28181Gateway/src/Message/CommandDispatcher.php:2460-2490 | Gb28181Gateway/src/Message/CommandDispatcher.php:2503-2529 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) CoreW/Business/Auth/Handler/JwtTokenHandler.php:17 — CoreW/Business/Auth/Handler/JwtTokenHandler.php:17-43 | CoreW/Business/Auth/Handler/JwtTokenHandler.php:56-86 — 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 · Duplicated block (36 lines × 2) · ×3
  • Duplicated block (36 lines × 2) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:131 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:131-166 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:125-160 — before extracting anything, compare `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php` and `CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 129 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 `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.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.
  • Duplicated block (36 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:189 — Gb28181Gateway/src/SwooleServer/GBS.php:189-224 | swoole-gbs/gbs-beta.php:534-569 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (36 lines × 2) CoreW/Dao/Connection.php:20 — CoreW/Dao/Connection.php:20-76 | CoreW/Dao/MasterSlaveConnection.php:13-48 — before extracting anything, compare `CoreW/Dao/Connection.php` and `CoreW/Dao/MasterSlaveConnection.php` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `CoreW/Dao/Connection.php:20` 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) · ×3
  • Duplicated block (30 lines × 2) Gb28181Gateway/src/SwooleServer/Channel.php:119 — Gb28181Gateway/src/SwooleServer/Channel.php:119-148 | swoole-gbs/gbs-beta.php:211-240 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/Channel.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 87 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 `Gb28181Gateway/src/SwooleServer/Channel.php:119` it begins part-way through the construct above it, so those 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 (30 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:99 — Gb28181Gateway/src/SwooleServer/GBS.php:99-128 | swoole-gbs/gbs-beta.php:444-473 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) Gb28181Gateway/src/SwooleServer/GBS.php:1072 — Gb28181Gateway/src/SwooleServer/GBS.php:1072-1101 | swoole-gbs/gbs-beta.php:1417-1446 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:227 — CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:227-247 | CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php:224-244 — before extracting anything, compare `CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php` and `CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 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 (21 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:305 — Gb28181Gateway/src/SwooleServer/GBS.php:305-325 | swoole-gbs/gbs-beta.php:650-670 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) Gb28181Gateway/src/SwooleServer/RTPPortManager.php:24 — Gb28181Gateway/src/SwooleServer/RTPPortManager.php:24-44 | swoole-gbs/gbs-beta.php:301-321 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/RTPPortManager.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: 95% 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. 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) · ×3
  • Duplicated block (15 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:887 — Gb28181Gateway/src/SwooleServer/GBS.php:887-901 | swoole-gbs/gbs-beta.php:1232-1246 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) app/process/AutoRecordProcess.php:129 — app/process/AutoRecordProcess.php:129-143 | app/process/AutoRecordProcess.php:195-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 `app/process/AutoRecordProcess.php:129` it begins part-way through the construct above it, so those exact lines 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) CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:200 — CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:200-214 | CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php:254-268 — before extracting anything, compare `CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php` and `CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 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 (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:321 — CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:321-332 | CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:369-380 — both copies are in the same file, so extract the 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) Gb28181Gateway/src/Message/CommandDispatcher.php:1703 — Gb28181Gateway/src/Message/CommandDispatcher.php:1703-1714 | Gb28181Gateway/src/Message/CommandDispatcher.php:1722-1733 — both copies are in the same file, so extract the 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) Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:59 — Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:59-72 | Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:192-203 — both copies are in the same file, so extract the 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 `Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:59` it begins part-way through the construct above it, so those 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 × 4) · ×3
  • Duplicated block (9 lines × 4) Gb28181Gateway/src/SwooleServer/GBS.php:1714 — Gb28181Gateway/src/SwooleServer/GBS.php:1714-1722 | Gb28181Gateway/src/SwooleServer/GBS.php:2375-2383 | swoole-gbs/gbs-beta.php:2059-2067 | swoole-gbs/gbs-beta.php:2720-2728 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:1714` it does not close everything it opens, so those exact lines 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) Gb28181Gateway/src/SwooleServer/GBS.php:1763 — Gb28181Gateway/src/SwooleServer/GBS.php:1763-1771 | Gb28181Gateway/src/SwooleServer/GBS.php:2411-2419 | swoole-gbs/gbs-beta.php:2108-2116 | swoole-gbs/gbs-beta.php:2756-2764 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:1763` it begins part-way through the construct above it, so those 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, `Gb28181Gateway/src/SwooleServer/GBS.php:1762` calls `debug` and `Gb28181Gateway/src/SwooleServer/GBS.php:2410` 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) Gb28181Gateway/src/SwooleServer/GBS.php:1811 — Gb28181Gateway/src/SwooleServer/GBS.php:1811-1819 | Gb28181Gateway/src/SwooleServer/GBS.php:2461-2469 | swoole-gbs/gbs-beta.php:2156-2164 | swoole-gbs/gbs-beta.php:2806-2814 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:1811` it does not close everything it opens, so those 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) CoreW/Business/User/Service/Impl/UserServiceImpl.php:588 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:588-596 | CoreW/Business/User/Service/Impl/UserServiceImpl.php:638-646 | CoreW/Business/User/Service/Impl/UserServiceImpl.php:668-676 — 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 (9 lines × 3) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:822 — CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:822-830 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:875-883 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:905-913 — 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 (9 lines × 3) Gb28181Gateway/src/Message/CommandDispatcher.php:313 — Gb28181Gateway/src/Message/CommandDispatcher.php:313-321 | Gb28181Gateway/src/Message/CommandDispatcher.php:924-932 | Gb28181Gateway/src/Message/CommandDispatcher.php:1108-1116 — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience CoreW/Business/Product/Service/Impl/ProductServiceImpl.php: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 CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:665 — `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 support/utils/ImageToolkit.php:154 — `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.
D1 · Cyclomatic Complexity · Channel.updateAdmin (cyclomatic 18) · ×2
  • Channel.updateAdmin (cyclomatic 18) Gb28181Gateway/src/SwooleServer/Channel.php:63 — Channel.updateAdmin 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.
  • Channel.updateAdmin (cyclomatic 18) swoole-gbs/gbs-beta.php:155 — Channel.updateAdmin 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.
D2 · Cognitive Complexity · Channel.updateAdmin (cognitive 27) · ×2
  • Channel.updateAdmin (cognitive 27) Gb28181Gateway/src/SwooleServer/Channel.php:63 — Channel.updateAdmin has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 8 (10 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Channel.updateAdmin (cognitive 27) swoole-gbs/gbs-beta.php:155 — Channel.updateAdmin has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 8 (10 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Gb28181Gateway/src/SwooleServer/GBS.php:1252 — Gb28181Gateway/src/SwooleServer/GBS.php:1252-1264 | Gb28181Gateway/src/SwooleServer/GBS.php:1292-1301 | Gb28181Gateway/src/SwooleServer/GBS.php:1401-1409 | Gb28181Gateway/src/SwooleServer/GBS.php:1414-1423 | swoole-gbs/gbs-beta.php:1597-1609 | swoole-gbs/gbs-beta.php:1637-1646 | swoole-gbs/gbs-beta.php:1746-1754 | swoole-gbs/gbs-beta.php:1759-1768 — 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) app/admin/controller/GB28181AlarmController.php:23 — app/admin/controller/GB28181AlarmController.php:23-79 | app/admin/controller/GB28181ChannelController.php:31-95 | app/admin/controller/GB28181RecordMergeController.php:23-50 | app/admin/controller/GB28181RecordTaskController.php:22-83 | app/admin/controller/GB28181RecordingController.php:28-73 | app/admin/controller/SipGatewayController.php:17-39 | app/admin/controller/StreamProxyController.php:23-79 | app/admin/controller/StreamProxyController.php:371-415 — 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 (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) app/admin/controller/GB28181RecordingController.php:239 — app/admin/controller/GB28181RecordingController.php:239-293 | app/admin/controller/GB28181RecordingController.php:302-337 — 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.
  • Edited copy of a member (36 corresponding lines) CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:560 — CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:560-608 | CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:644-679 — 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 copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:147 — CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:147-183 | CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php:174-211 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) CoreW/Sdk/AMapSdk/AMapClient.php:255 — CoreW/Sdk/AMapSdk/AMapClient.php:255-291 | CoreW/Sdk/Iot/Driver/Base.php:254-291 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) app/process/StreamProxyAutoReconnectProcess.php:25 — app/process/StreamProxyAutoReconnectProcess.php:25-48 | app/process/StreamProxyHealthCheckProcess.php:25-48 — 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) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:490 — CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:490-514 | CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:519-542 — 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 (40 corresponding lines) · ×2
  • Edited copy of a member (40 corresponding lines) Gb28181Gateway/src/Message/CommandDispatcher.php:2183 — Gb28181Gateway/src/Message/CommandDispatcher.php:2183-2222 | Gb28181Gateway/src/Message/CommandDispatcher.php:2298-2337 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) app/admin/controller/GB28181HookController.php:84 — app/admin/controller/GB28181HookController.php:84-125 | app/admin/controller/GB28181HookController.php:135-174 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:483 — CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:483-500 | CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:508-525 | CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:533-551 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) Gb28181Gateway/src/Message/CommandDispatcher.php:2345 — Gb28181Gateway/src/Message/CommandDispatcher.php:2345-2362 | Gb28181Gateway/src/Message/CommandDispatcher.php:2370-2387 | Gb28181Gateway/src/Message/CommandDispatcher.php:2423-2440 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×2
  • Edited copy of a member (13 corresponding lines) REDACTED:92 — REDACTED:92-108 | CoreW/Oauth2/Client/QQOauthClient.php:88-100 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) CoreW/Business/User/Service/Impl/UserServiceImpl.php:638 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:638-650 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:875-887 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×2
  • Edited copy of a member (10 corresponding lines) CoreW/Dao/DaoProxy.php:385 — CoreW/Dao/DaoProxy.php:385-398 | CoreW/Dao/DaoProxy.php:410-419 — 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) Gb28181Gateway/src/Libs/ClientRedis.php:40 — Gb28181Gateway/src/Libs/ClientRedis.php:40-49 | Gb28181Gateway/src/Libs/ClientRedis.php:55-65 — 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 (9 corresponding lines) · ×2
  • Edited copy of a member (9 corresponding lines) app/admin/controller/AlarmPlanController.php:97 — app/admin/controller/AlarmPlanController.php:97-105 | app/admin/controller/AlarmPlanController.php:137-145 — 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) CoreW/Sdk/AMapSdk/AMapClient.php:90 — CoreW/Sdk/AMapSdk/AMapClient.php:90-98 | CoreW/Sdk/Iot/Driver/Base.php:364-374 — 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 (7 corresponding lines) · ×2
  • Edited copy of a member (7 corresponding lines) CoreW/Oauth2/Client/WechatMobOauthClient.php:13 — CoreW/Oauth2/Client/WechatMobOauthClient.php:13-19 | CoreW/Oauth2/Client/WechatWebOAuthClient.php:13-19 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) CoreW/Business/BaseService.php:50 — CoreW/Business/BaseService.php:50-56 | app/AbstractController.php:104-112 — 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 (5 corresponding lines) · ×2
  • Edited copy of a member (5 corresponding lines) CoreW/Business/Devices/Enums/DeviceCategoryEnum.php:129 — CoreW/Business/Devices/Enums/DeviceCategoryEnum.php:129-133 | CoreW/Business/Devices/Enums/DeviceStatusEnum.php:32-36 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) app/admin/controller/ProductCatalogController.php:146 — app/admin/controller/ProductCatalogController.php:146-150 | app/api/v1/controller/ProductController.php:528-532 — 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 · Duplicated block (51 lines × 2) · ×2
  • Duplicated block (51 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1440 — Gb28181Gateway/src/SwooleServer/GBS.php:1440-1490 | swoole-gbs/gbs-beta.php:1785-1835 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:1440` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (51 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2610 — Gb28181Gateway/src/SwooleServer/GBS.php:2610-2660 | swoole-gbs/gbs-beta.php:2955-3005 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:2610` it begins part-way through the construct above it, so those 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 (47 lines × 2) · ×2
  • Duplicated block (47 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:832 — Gb28181Gateway/src/SwooleServer/GBS.php:832-878 | swoole-gbs/gbs-beta.php:1177-1223 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:832` it begins part-way through the construct above it, so those exact lines 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) Gb28181Gateway/src/SwooleServer/GBS.php:1106 — Gb28181Gateway/src/SwooleServer/GBS.php:1106-1152 | swoole-gbs/gbs-beta.php:1451-1497 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (24–29 lines × 2) · ×2
  • Duplicated block (24–29 lines × 2) REDACTED:92 — REDACTED:92-120 | REDACTED:89-112 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 137 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 (24–29 lines × 2) CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:445 — CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:445-468 | CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:499-527 — both copies are in the same file, so extract the 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 `CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:445` it does not close everything it opens, so those 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 (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:142 — Gb28181Gateway/src/SwooleServer/GBS.php:142-170 | swoole-gbs/gbs-beta.php:487-515 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (29 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1516 — Gb28181Gateway/src/SwooleServer/GBS.php:1516-1544 | swoole-gbs/gbs-beta.php:1861-1889 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:37 — CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:37-60 | CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:73-96 — both copies are in the same file, so extract the 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 (24 lines × 2) Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:83 — Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:83-106 | Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:218-247 — both copies are in the same file, so extract the 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 `Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:218` it does not close everything it opens, so those 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 (52 lines × 2) · ×2
  • Duplicated block (52 lines × 2) Gb28181Gateway/src/SwooleServer/Channel.php:65 — Gb28181Gateway/src/SwooleServer/Channel.php:65-116 | swoole-gbs/gbs-beta.php:157-208 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/Channel.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 87 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 `Gb28181Gateway/src/SwooleServer/Channel.php:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (52 lines × 2) CoreW/Business/User/Dao/Impl/TokenDaoImpl.php:16 — CoreW/Business/User/Dao/Impl/TokenDaoImpl.php:16-67 | CoreW/Business/VIP/Dao/Impl/TokenDaoImpl.php:16-67 — 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 `CoreW/Business/User/Dao/Impl/TokenDaoImpl.php:16` 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 (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) Gb28181Gateway/src/Device/DeviceManager.php:481 — Gb28181Gateway/src/Device/DeviceManager.php:481-502 | Gb28181Gateway/src/Device/DeviceManager.php:517-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Gb28181Gateway/src/Device/DeviceManager.php:481` it begins part-way through the construct above it, so those 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 (21–22 lines × 2) Gb28181Gateway/src/Message/QuerySender.php:251 — Gb28181Gateway/src/Message/QuerySender.php:251-271 | Gb28181Gateway/src/Message/QuerySender.php:390-411 — both copies are in the same file, so extract the 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 (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) CoreW/Sdk/ZLMediaKit/ZLMClient.php:725 — CoreW/Sdk/ZLMediaKit/ZLMClient.php:725-744 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:778-797 — both copies are in the same file, so extract the 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 (20 lines × 2) CoreW/Util/ShellColor.php:91 — CoreW/Util/ShellColor.php:91-110 | support/utils/ShellColorUtil.php:91-110 — before extracting anything, compare `CoreW/Util/ShellColor.php` and `support/utils/ShellColorUtil.php` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) CoreW/Sdk/AMapSdk/Libs/Response.php:96 — CoreW/Sdk/AMapSdk/Libs/Response.php:96-112 | CoreW/Sdk/Iot/HttpResponse.php:97-113 — before extracting anything, compare `CoreW/Sdk/AMapSdk/Libs/Response.php` and `CoreW/Sdk/Iot/HttpResponse.php` as WHOLE FILES: 87% 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 (17 lines × 2) CoreW/Oauth2/Client/WechatMobOauthClient.php:24 — CoreW/Oauth2/Client/WechatMobOauthClient.php:24-40 | CoreW/Oauth2/Client/WechatWebOAuthClient.php:24-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×2
  • Duplicated block (15 lines × 4) Gb28181Gateway/src/Message/CommandDispatcher.php:1483 — Gb28181Gateway/src/Message/CommandDispatcher.php:1483-1497 | Gb28181Gateway/src/Message/CommandDispatcher.php:1505-1519 | Gb28181Gateway/src/Message/CommandDispatcher.php:1527-1541 | Gb28181Gateway/src/Message/CommandDispatcher.php:1549-1563 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 4) Gb28181Gateway/src/SwooleServer/GBS.php:1838 — Gb28181Gateway/src/SwooleServer/GBS.php:1838-1852 | Gb28181Gateway/src/SwooleServer/GBS.php:2499-2513 | swoole-gbs/gbs-beta.php:2183-2197 | swoole-gbs/gbs-beta.php:2844-2858 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) Gb28181Gateway/src/Message/QuerySender.php:249 — Gb28181Gateway/src/Message/QuerySender.php:249-263 | Gb28181Gateway/src/Message/QuerySender.php:312-326 | Gb28181Gateway/src/Message/QuerySender.php:388-402 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 3) CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:338 — CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:338-352 | CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:355-369 | CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:370-386 — 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 `CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) CoreW/Business/DataFilters/Filter.php:168 — CoreW/Business/DataFilters/Filter.php:168-180 | CoreW/Business/DataFilters/Filter.php:189-202 — both copies are in the same file, so extract the 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 `CoreW/Business/DataFilters/Filter.php:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) Gb28181Gateway/src/Message/CommandDispatcher.php:173 — Gb28181Gateway/src/Message/CommandDispatcher.php:173-186 | Gb28181Gateway/src/Message/CommandDispatcher.php:509-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Gb28181Gateway/src/Message/CommandDispatcher.php:173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) CoreW/Sdk/ZLMediaKit/MediaServer.php:158 — CoreW/Sdk/ZLMediaKit/MediaServer.php:158-171 | CoreW/Sdk/ZLMediaKit/MediaServer.php:175-188 — both copies are in the same file, so extract the 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 `CoreW/Sdk/ZLMediaKit/MediaServer.php: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.
  • Duplicated block (14 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2266 — Gb28181Gateway/src/SwooleServer/GBS.php:2266-2279 | swoole-gbs/gbs-beta.php:2611-2624 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:126 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:126-138 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:123-135 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:120-132 — before extracting anything, compare `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php` and `CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 3) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:100 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:100-112 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:97-109 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:94-106 — before extracting anything, compare `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php` and `CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) CoreW/Business/Devices/Traits/GB28181StreamTrait.php:131 — CoreW/Business/Devices/Traits/GB28181StreamTrait.php:131-137 | CoreW/Business/Devices/Traits/GB28181StreamTrait.php:290-298 | CoreW/Business/Devices/Traits/GB28181StreamTrait.php:549-557 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) CoreW/Business/Devices/Traits/GB28181StreamTrait.php:139 — CoreW/Business/Devices/Traits/GB28181StreamTrait.php:139-145 | CoreW/Business/Devices/Traits/GB28181StreamTrait.php:302-312 | CoreW/Business/Devices/Traits/GB28181StreamTrait.php:561-571 — 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 `CoreW/Business/Devices/Traits/GB28181StreamTrait.php:139` it begins part-way through the construct above it, so those 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) · ×2
  • Duplicated block (5 lines × 3) app/admin/controller/SipGatewayController.php:110 — app/admin/controller/SipGatewayController.php:110-114 | app/admin/controller/SipGatewayController.php:133-137 | app/admin/controller/StreamProxyController.php:94-98 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/SipGatewayController.php:110` it begins part-way through the construct above it, so those 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 × 3) app/admin/controller/AttachmentController.php:102 — app/admin/controller/AttachmentController.php:102-106 | app/admin/controller/AttachmentGroupController.php:74-78 | app/admin/controller/ProductCatalogController.php:75-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) CoreW/Business/User/Service/Impl/UserServiceImpl.php:333 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:333-339 | CoreW/Business/User/Service/Impl/UserServiceImpl.php:344-350 | CoreW/Business/User/Service/Impl/UserServiceImpl.php:355-361 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:986-992 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 4) app/admin/controller/GB28181SystemMonitoringController.php:98 — app/admin/controller/GB28181SystemMonitoringController.php:98-104 | app/admin/controller/SystemMonitoringController.php:128-135 | app/admin/controller/SystemMonitoringController.php:146-153 | app/admin/controller/SystemMonitoringController.php:183-190 — 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.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: process — process: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: support — support: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
D1 · Cyclomatic Complexity · GBS.handleMessageRequest (cyclomatic 49) · ×1
  • GBS.handleMessageRequest (cyclomatic 49) Gb28181Gateway/src/SwooleServer/GBS.php:684 — GBS.handleMessageRequest has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GBServer.handleMessageRequest (cyclomatic 49) · ×1
  • GBServer.handleMessageRequest (cyclomatic 49) swoole-gbs/gbs-beta.php:1029 — GBServer.handleMessageRequest has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GBS.parseCatalogResponse (cyclomatic 44) · ×1
  • GBS.parseCatalogResponse (cyclomatic 44) Gb28181Gateway/src/SwooleServer/GBS.php:1986 — GBS.parseCatalogResponse 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 · GBServer.parseCatalogResponse (cyclomatic 44) · ×1
  • GBServer.parseCatalogResponse (cyclomatic 44) swoole-gbs/gbs-beta.php:2331 — GBServer.parseCatalogResponse 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 · DeviceToolkit.getOperatingSystem (cyclomatic 36) · ×1
  • DeviceToolkit.getOperatingSystem (cyclomatic 36) support/utils/DeviceToolkit.php:210 — DeviceToolkit.getOperatingSystem 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 · GBS.requestInvite (cyclomatic 33) · ×1
  • GBS.requestInvite (cyclomatic 33) Gb28181Gateway/src/SwooleServer/GBS.php:2301 — GBS.requestInvite 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 · GBServer.requestInvite (cyclomatic 33) · ×1
  • GBServer.requestInvite (cyclomatic 33) swoole-gbs/gbs-beta.php:2646 — GBServer.requestInvite 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 · Gb28181Server.statusServer (cyclomatic 32) · ×1
  • Gb28181Server.statusServer (cyclomatic 32) app/command/Gb28181Server.php:166 — Gb28181Server.statusServer 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 · SystemServiceImpl.getNetworkBytes (cyclomatic 31) · ×1
  • SystemServiceImpl.getNetworkBytes (cyclomatic 31) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:363 — SystemServiceImpl.getNetworkBytes 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 · GB28181Handler.tick (cyclomatic 30) · ×1
  • GB28181Handler.tick (cyclomatic 30) Gb28181Gateway/src/Handlers/GB28181Handler.php:468 — GB28181Handler.tick 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 · GBS.sendInvite (cyclomatic 29) · ×1
  • GBS.sendInvite (cyclomatic 29) Gb28181Gateway/src/SwooleServer/GBS.php:1681 — GBS.sendInvite 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 · GBServer.sendInvite (cyclomatic 29) · ×1
  • GBServer.sendInvite (cyclomatic 29) swoole-gbs/gbs-beta.php:2026 — GBServer.sendInvite 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 · GB28181RecordingController.startRecord (cyclomatic 28) · ×1
  • GB28181RecordingController.startRecord (cyclomatic 28) app/admin/controller/GB28181RecordingController.php:95 — GB28181RecordingController.startRecord 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 · GBS.checkExpiredDevices (cyclomatic 27) · ×1
  • GBS.checkExpiredDevices (cyclomatic 27) Gb28181Gateway/src/SwooleServer/GBS.php:1547 — GBS.checkExpiredDevices 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 · GBServer.checkExpiredDevices (cyclomatic 27) · ×1
  • GBServer.checkExpiredDevices (cyclomatic 27) swoole-gbs/gbs-beta.php:1892 — GBServer.checkExpiredDevices 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 · CommandDispatcher.handlePlaybackControl (cyclomatic 24) · ×1
  • CommandDispatcher.handlePlaybackControl (cyclomatic 24) Gb28181Gateway/src/Message/CommandDispatcher.php:958 — CommandDispatcher.handlePlaybackControl 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. This is NOT this file's highest cyclomatic complexity: CommandDispatcher.dispatch (cyclomatic 57) 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 · EasyProcessor.render (cyclomatic 23) · ×1
  • EasyProcessor.render (cyclomatic 23) CoreW/Gii/Template/Easy/EasyProcessor.php:28 — EasyProcessor.render 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 · CustomRoute.resource (cyclomatic 22) · ×1
  • CustomRoute.resource (cyclomatic 22) CoreW/CustomRoute.php:11 — CustomRoute.resource 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 · SubscribeServiceImpl.applySubscribeConfig (cyclomatic 20) · ×1
  • SubscribeServiceImpl.applySubscribeConfig (cyclomatic 20) CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:95 — SubscribeServiceImpl.applySubscribeConfig 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 · Gb28181Client.subscribeAlarm (cyclomatic 20) · ×1
  • Gb28181Client.subscribeAlarm (cyclomatic 20) CoreW/Sdk/PSipGateway/Gb28181Client.php:590 — Gb28181Client.subscribeAlarm 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 · GB28181Handler.handleTask (cyclomatic 20) · ×1
  • GB28181Handler.handleTask (cyclomatic 20) Gb28181Gateway/src/Handlers/GB28181Handler.php:734 — GB28181Handler.handleTask 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 · ProductCatalogServiceImpl.updateProductCatalog (cyclomatic 19) · ×1
  • ProductCatalogServiceImpl.updateProductCatalog (cyclomatic 19) CoreW/Business/Product/Service/Impl/ProductCatalogServiceImpl.php:227 — ProductCatalogServiceImpl.updateProductCatalog 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 · VIPServiceImpl.editVIPInfo (cyclomatic 19) · ×1
  • VIPServiceImpl.editVIPInfo (cyclomatic 19) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:504 — VIPServiceImpl.editVIPInfo 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 · AlarmPlanServiceImpl.matchPlan (cyclomatic 18) · ×1
  • AlarmPlanServiceImpl.matchPlan (cyclomatic 18) CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:206 — AlarmPlanServiceImpl.matchPlan 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 · ZLMediaKitStrategy.getStats (cyclomatic 18) · ×1
  • ZLMediaKitStrategy.getStats (cyclomatic 18) CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:19 — ZLMediaKitStrategy.getStats has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · GB28181Handler.handleResponse (cyclomatic 18) · ×1
  • GB28181Handler.handleResponse (cyclomatic 18) Gb28181Gateway/src/Handlers/GB28181Handler.php:1872 — GB28181Handler.handleResponse 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 · GisUtil.getPolygonCorners (cyclomatic 18) · ×1
  • GisUtil.getPolygonCorners (cyclomatic 18) support/utils/GisUtil.php:32 — GisUtil.getPolygonCorners 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 · JsonToolkit.prettyPrint (cyclomatic 18) · ×1
  • JsonToolkit.prettyPrint (cyclomatic 18) support/utils/JsonToolkit.php:9 — JsonToolkit.prettyPrint 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 · StringToolkit.jsonPettry (cyclomatic 18) · ×1
  • StringToolkit.jsonPettry (cyclomatic 18) support/utils/StringToolkit.php:140 — StringToolkit.jsonPettry 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 · DeviceServiceImpl.batchUpdateOrCreateChannels (cyclomatic 17) · ×1
  • DeviceServiceImpl.batchUpdateOrCreateChannels (cyclomatic 17) CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:358 — DeviceServiceImpl.batchUpdateOrCreateChannels 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 · UserDaoImpl.createQueryBuilder (cyclomatic 17) · ×1
  • UserDaoImpl.createQueryBuilder (cyclomatic 17) CoreW/Business/User/Dao/Impl/UserDaoImpl.php:151 — UserDaoImpl.createQueryBuilder 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 · VIPServiceImpl.login (cyclomatic 17) · ×1
  • VIPServiceImpl.login (cyclomatic 17) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:622 — VIPServiceImpl.login 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 · DeviceManager.loadDevices (cyclomatic 17) · ×1
  • DeviceManager.loadDevices (cyclomatic 17) Gb28181Gateway/src/Device/DeviceManager.php:475 — DeviceManager.loadDevices 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 · GB28181Handler.handleRegister (cyclomatic 17) · ×1
  • GB28181Handler.handleRegister (cyclomatic 17) Gb28181Gateway/src/Handlers/GB28181Handler.php:1062 — GB28181Handler.handleRegister 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 · SdpBuilder.buildInviteSdp (cyclomatic 17) · ×1
  • SdpBuilder.buildInviteSdp (cyclomatic 17) Gb28181Gateway/src/Message/SdpBuilder.php:32 — SdpBuilder.buildInviteSdp 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 · GB28181DeviceController.update (cyclomatic 17) · ×1
  • GB28181DeviceController.update (cyclomatic 17) app/admin/controller/GB28181DeviceController.php:153 — GB28181DeviceController.update 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 · GB28181DeviceController.eventStream (cyclomatic 17) · ×1
  • GB28181DeviceController.eventStream (cyclomatic 17) app/admin/controller/GB28181DeviceController.php:419 — GB28181DeviceController.eventStream 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 · VIPServiceImpl.applyCompany (cyclomatic 16) · ×1
  • VIPServiceImpl.applyCompany (cyclomatic 16) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:138 — VIPServiceImpl.applyCompany 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 · Device.updateConfig (cyclomatic 16) · ×1
  • Device.updateConfig (cyclomatic 16) Gb28181Gateway/src/Device/Device.php:301 — Device.updateConfig 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 · GBS.stop (cyclomatic 16) · ×1
  • GBS.stop (cyclomatic 16) Gb28181Gateway/src/SwooleServer/GBS.php:227 — GBS.stop has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · GBS.handleRegister (cyclomatic 16) · ×1
  • GBS.handleRegister (cyclomatic 16) Gb28181Gateway/src/SwooleServer/GBS.php:557 — GBS.handleRegister 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 · GBS.verifyAuth (cyclomatic 16) · ×1
  • GBS.verifyAuth (cyclomatic 16) Gb28181Gateway/src/SwooleServer/GBS.php:1438 — GBS.verifyAuth 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 · DeviceToolkit.matchBrowser (cyclomatic 16) · ×1
  • DeviceToolkit.matchBrowser (cyclomatic 16) support/utils/DeviceToolkit.php:140 — DeviceToolkit.matchBrowser 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 · GBServer.stop (cyclomatic 16) · ×1
  • GBServer.stop (cyclomatic 16) swoole-gbs/gbs-beta.php:572 — GBServer.stop has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · GBServer.handleRegister (cyclomatic 16) · ×1
  • GBServer.handleRegister (cyclomatic 16) swoole-gbs/gbs-beta.php:902 — GBServer.handleRegister 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 · GBServer.verifyAuth (cyclomatic 16) · ×1
  • GBServer.verifyAuth (cyclomatic 16) swoole-gbs/gbs-beta.php:1783 — GBServer.verifyAuth 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.
D16 · Bus Factor · bus factor 1 · ×1
  • bus factor 1 — one contributor carries this repository — 2 contributor(s) have commits in this repository (automation and bot accounts excluded), but the commits of a single one of them cover most of its history — 88% of the 306 commit(s) sampled — so the number of people who actually carry it is 1. This is not the ambient state of a solo project: there ARE other contributors, and if the one who carries the repository becomes unavailable, the knowledge behind most of its history goes with them. Spread the next changes deliberately — have a second contributor review or pair on them — and write down the parts only one person can currently change.
D2 · Cognitive Complexity · DeviceToolkit.getOperatingSystem (cognitive 335) · ×1
  • DeviceToolkit.getOperatingSystem (cognitive 335) support/utils/DeviceToolkit.php:210 — DeviceToolkit.getOperatingSystem has cognitive complexity 335 (threshold 15). Drivers by points: if/else 49 (325 pts), boolean chains 10 (nesting depth added 276). 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 · GBS.parseCatalogResponse (cognitive 126) · ×1
  • GBS.parseCatalogResponse (cognitive 126) Gb28181Gateway/src/SwooleServer/GBS.php:1986 — GBS.parseCatalogResponse has cognitive complexity 126 (threshold 15). Drivers by points: if/else 25 (79 pts), loops 7 (23 pts), ternaries 8 (18 pts), boolean chains 5, error handling 1 (nesting depth added 80). 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 · GBServer.parseCatalogResponse (cognitive 126) · ×1
  • GBServer.parseCatalogResponse (cognitive 126) swoole-gbs/gbs-beta.php:2331 — GBServer.parseCatalogResponse has cognitive complexity 126 (threshold 15). Drivers by points: if/else 25 (79 pts), loops 7 (23 pts), ternaries 8 (18 pts), boolean chains 5, error handling 1 (nesting depth added 80). 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 · GBS.handleMessageRequest (cognitive 115) · ×1
  • GBS.handleMessageRequest (cognitive 115) Gb28181Gateway/src/SwooleServer/GBS.php:684 — GBS.handleMessageRequest has cognitive complexity 115 (threshold 15). Drivers by points: if/else 32 (71 pts), ternaries 4 (16 pts), loops 5 (15 pts), boolean chains 8, error handling 3 (5 pts) (nesting depth added 63). 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 · GBServer.handleMessageRequest (cognitive 115) · ×1
  • GBServer.handleMessageRequest (cognitive 115) swoole-gbs/gbs-beta.php:1029 — GBServer.handleMessageRequest has cognitive complexity 115 (threshold 15). Drivers by points: if/else 32 (71 pts), ternaries 4 (16 pts), loops 5 (15 pts), boolean chains 8, error handling 3 (5 pts) (nesting depth added 63). 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 · SystemServiceImpl.getNetworkBytes (cognitive 114) · ×1
  • SystemServiceImpl.getNetworkBytes (cognitive 114) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:363 — SystemServiceImpl.getNetworkBytes has cognitive complexity 114 (threshold 15). Drivers by points: if/else 17 (72 pts), loops 4 (17 pts), ternaries 3 (17 pts), boolean chains 8 (nesting depth added 82). 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 · DeviceToolkit.matchBrowser (cognitive 106) · ×1
  • DeviceToolkit.matchBrowser (cognitive 106) support/utils/DeviceToolkit.php:140 — DeviceToolkit.matchBrowser has cognitive complexity 106 (threshold 15). Drivers by points: if/else 27 (105 pts), boolean chains 1 (nesting depth added 78). 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 · FileToolkit.getDownloadTaskTypeByExtension (cognitive 77) · ×1
  • FileToolkit.getDownloadTaskTypeByExtension (cognitive 77) support/utils/FileToolkit.php:983 — FileToolkit.getDownloadTaskTypeByExtension has cognitive complexity 77 (threshold 15). Drivers by points: if/else 22 (77 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 · GBS.checkExpiredDevices (cognitive 76) · ×1
  • GBS.checkExpiredDevices (cognitive 76) Gb28181Gateway/src/SwooleServer/GBS.php:1547 — GBS.checkExpiredDevices has cognitive complexity 76 (threshold 15). Drivers by points: if/else 17 (58 pts), loops 9 (17 pts), boolean chains 1 (nesting depth added 49). 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 · GBServer.checkExpiredDevices (cognitive 76) · ×1
  • GBServer.checkExpiredDevices (cognitive 76) swoole-gbs/gbs-beta.php:1892 — GBServer.checkExpiredDevices has cognitive complexity 76 (threshold 15). Drivers by points: if/else 17 (58 pts), loops 9 (17 pts), boolean chains 1 (nesting depth added 49). 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 · GBS.sendInvite (cognitive 58) · ×1
  • GBS.sendInvite (cognitive 58) Gb28181Gateway/src/SwooleServer/GBS.php:1681 — GBS.sendInvite has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (48 pts), ternaries 3 (5 pts), boolean chains 3, error handling 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 · GBServer.sendInvite (cognitive 58) · ×1
  • GBServer.sendInvite (cognitive 58) swoole-gbs/gbs-beta.php:2026 — GBServer.sendInvite has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (48 pts), ternaries 3 (5 pts), boolean chains 3, error handling 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 · GBS.requestInvite (cognitive 55) · ×1
  • GBS.requestInvite (cognitive 55) Gb28181Gateway/src/SwooleServer/GBS.php:2301 — GBS.requestInvite has cognitive complexity 55 (threshold 15). Drivers by points: if/else 25 (44 pts), ternaries 5, error handling 3 (4 pts), boolean chains 2 (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 · GBServer.requestInvite (cognitive 55) · ×1
  • GBServer.requestInvite (cognitive 55) swoole-gbs/gbs-beta.php:2646 — GBServer.requestInvite has cognitive complexity 55 (threshold 15). Drivers by points: if/else 25 (44 pts), ternaries 5, error handling 3 (4 pts), boolean chains 2 (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 · GB28181Handler.tick (cognitive 53) · ×1
  • GB28181Handler.tick (cognitive 53) Gb28181Gateway/src/Handlers/GB28181Handler.php:468 — GB28181Handler.tick has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 6 (14 pts), boolean chains 5, error handling 4, ternaries 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Gb28181Server.statusServer (cognitive 47) · ×1
  • Gb28181Server.statusServer (cognitive 47) app/command/Gb28181Server.php:166 — Gb28181Server.statusServer has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 13 (15 pts), loops 3 (6 pts), boolean chains 5, 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 · LeChangeStrategy.getLiveUrl (cognitive 44) · ×1
  • LeChangeStrategy.getLiveUrl (cognitive 44) CoreW/Business/LiveProvider/Strategy/Impl/LeChangeStrategy.php:49 — LeChangeStrategy.getLiveUrl has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 5 (19 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 · GB28181Handler.handleResponse (cognitive 44) · ×1
  • GB28181Handler.handleResponse (cognitive 44) Gb28181Gateway/src/Handlers/GB28181Handler.php:1872 — GB28181Handler.handleResponse has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 7 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SubscribeServiceImpl.applySubscribeConfig (cognitive 43) · ×1
  • SubscribeServiceImpl.applySubscribeConfig (cognitive 43) CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:95 — SubscribeServiceImpl.applySubscribeConfig has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (30 pts), error handling 6 (12 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlarmPlanServiceImpl.matchPlan (cognitive 41) · ×1
  • AlarmPlanServiceImpl.matchPlan (cognitive 41) CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:206 — AlarmPlanServiceImpl.matchPlan has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (24 pts), ternaries 4 (13 pts), boolean chains 3, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemServiceImpl.getMemoryUsage (cognitive 41) · ×1
  • SystemServiceImpl.getMemoryUsage (cognitive 41) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:107 — SystemServiceImpl.getMemoryUsage has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 5 (15 pts), loops 1 (3 pts) (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 · CustomRoute.resource (cognitive 41) · ×1
  • CustomRoute.resource (cognitive 41) CoreW/CustomRoute.php:11 — CustomRoute.resource has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 1 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GB28181Handler.handleTask (cognitive 41) · ×1
  • GB28181Handler.handleTask (cognitive 41) Gb28181Gateway/src/Handlers/GB28181Handler.php:734 — GB28181Handler.handleTask has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 3 (9 pts), boolean chains 7 (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 · SystemServiceImpl.getCpuUsage (cognitive 38) · ×1
  • SystemServiceImpl.getCpuUsage (cognitive 38) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:28 — SystemServiceImpl.getCpuUsage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (7 pts), ternaries 2 (4 pts), boolean chains 2 (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 · GBS.handleMessage (cognitive 37) · ×1
  • GBS.handleMessage (cognitive 37) Gb28181Gateway/src/SwooleServer/GBS.php:464 — GBS.handleMessage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (36 pts), error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GBServer.handleMessage (cognitive 37) · ×1
  • GBServer.handleMessage (cognitive 37) swoole-gbs/gbs-beta.php:809 — GBServer.handleMessage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (36 pts), error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GB28181RecordingController.startRecord (cognitive 36) · ×1
  • GB28181RecordingController.startRecord (cognitive 36) app/admin/controller/GB28181RecordingController.php:95 — GB28181RecordingController.startRecord has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 5 (10 pts), boolean chains 7, 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 · DeviceManager.loadDevices (cognitive 35) · ×1
  • DeviceManager.loadDevices (cognitive 35) Gb28181Gateway/src/Device/DeviceManager.php:475 — DeviceManager.loadDevices has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (7 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileToolkit.getFileTypeByExtension (cognitive 35) · ×1
  • FileToolkit.getFileTypeByExtension (cognitive 35) support/utils/FileToolkit.php:960 — FileToolkit.getFileTypeByExtension has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (35 pts) (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 · SdpBuilder.buildInviteSdp (cognitive 31) · ×1
  • SdpBuilder.buildInviteSdp (cognitive 31) Gb28181Gateway/src/Message/SdpBuilder.php:32 — SdpBuilder.buildInviteSdp has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VIPServiceImpl.login (cognitive 30) · ×1
  • VIPServiceImpl.login (cognitive 30) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:622 — VIPServiceImpl.login has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EasyProcessor.render (cognitive 30) · ×1
  • EasyProcessor.render (cognitive 30) CoreW/Gii/Template/Easy/EasyProcessor.php:28 — EasyProcessor.render has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 8, 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 · Base.afterResponse (cognitive 30) · ×1
  • Base.afterResponse (cognitive 30) CoreW/Sdk/Iot/Driver/Base.php:294 — Base.afterResponse has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 19). 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 · Gb28181Client.subscribeAlarm (cognitive 30) · ×1
  • Gb28181Client.subscribeAlarm (cognitive 30) CoreW/Sdk/PSipGateway/Gb28181Client.php:590 — Gb28181Client.subscribeAlarm has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (23 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 · LeChangeStrategy.stopLive (cognitive 29) · ×1
  • LeChangeStrategy.stopLive (cognitive 29) CoreW/Business/LiveProvider/Strategy/Impl/LeChangeStrategy.php:205 — LeChangeStrategy.stopLive has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (29 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 · GBS.stop (cognitive 29) · ×1
  • GBS.stop (cognitive 29) Gb28181Gateway/src/SwooleServer/GBS.php:227 — GBS.stop has cognitive complexity 29 (threshold 15). Drivers by points: error handling 3 (11 pts), if/else 6 (11 pts), loops 5 (6 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 · GBS.handleInviteResponse (cognitive 29) · ×1
  • GBS.handleInviteResponse (cognitive 29) Gb28181Gateway/src/SwooleServer/GBS.php:1000 — GBS.handleInviteResponse has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (27 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 · GBServer.stop (cognitive 29) · ×1
  • GBServer.stop (cognitive 29) swoole-gbs/gbs-beta.php:572 — GBServer.stop has cognitive complexity 29 (threshold 15). Drivers by points: error handling 3 (11 pts), if/else 6 (11 pts), loops 5 (6 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 · GBServer.handleInviteResponse (cognitive 29) · ×1
  • GBServer.handleInviteResponse (cognitive 29) swoole-gbs/gbs-beta.php:1345 — GBServer.handleInviteResponse has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (27 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 · TableStrategy.afterWave (cognitive 28) · ×1
  • TableStrategy.afterWave (cognitive 28) CoreW/Dao/CacheStrategy/TableStrategy.php:60 — TableStrategy.afterWave has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (12 pts), boolean chains 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 · GB28181DeviceController.eventStream (cognitive 28) · ×1
  • GB28181DeviceController.eventStream (cognitive 28) app/admin/controller/GB28181DeviceController.php:419 — GB28181DeviceController.eventStream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeviceServiceImpl.batchUpdateOrCreateChannels (cognitive 27) · ×1
  • DeviceServiceImpl.batchUpdateOrCreateChannels (cognitive 27) CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:358 — DeviceServiceImpl.batchUpdateOrCreateChannels has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 6 (8 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscribeServiceImpl.renewExpiringSubscriptions (cognitive 27) · ×1
  • SubscribeServiceImpl.renewExpiringSubscriptions (cognitive 27) CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:316 — SubscribeServiceImpl.renewExpiringSubscriptions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandDispatcher.handlePlaybackControl (cognitive 27) · ×1
  • CommandDispatcher.handlePlaybackControl (cognitive 27) Gb28181Gateway/src/Message/CommandDispatcher.php:958 — CommandDispatcher.handlePlaybackControl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 3 (4 pts), boolean chains 2, match/switch 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 · GBS.handleRegister (cognitive 27) · ×1
  • GBS.handleRegister (cognitive 27) Gb28181Gateway/src/SwooleServer/GBS.php:557 — GBS.handleRegister has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 2 (3 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 · GBS.releaseChannelByCallid (cognitive 27) · ×1
  • GBS.releaseChannelByCallid (cognitive 27) Gb28181Gateway/src/SwooleServer/GBS.php:1155 — GBS.releaseChannelByCallid has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (4 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 · JsonToolkit.prettyPrint (cognitive 27) · ×1
  • JsonToolkit.prettyPrint (cognitive 27) support/utils/JsonToolkit.php:9 — JsonToolkit.prettyPrint has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (5 pts), loops 1 (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 · StringToolkit.jsonPettry (cognitive 27) · ×1
  • StringToolkit.jsonPettry (cognitive 27) support/utils/StringToolkit.php:140 — StringToolkit.jsonPettry has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (5 pts), loops 1 (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 · GBServer.handleRegister (cognitive 27) · ×1
  • GBServer.handleRegister (cognitive 27) swoole-gbs/gbs-beta.php:902 — GBServer.handleRegister has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 2 (3 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 · GBServer.releaseChannelByCallid (cognitive 27) · ×1
  • GBServer.releaseChannelByCallid (cognitive 27) swoole-gbs/gbs-beta.php:1500 — GBServer.releaseChannelByCallid has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (4 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 · Bfw.init (cognitive 26) · ×1
  • Bfw.init (cognitive 26) CoreW/Bfw.php:112 — Bfw.init has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VIPServiceImpl.applyCompany (cognitive 26) · ×1
  • VIPServiceImpl.applyCompany (cognitive 26) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:138 — VIPServiceImpl.applyCompany has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (25 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 · MakeResourceCommand.execute (cognitive 26) · ×1
  • MakeResourceCommand.execute (cognitive 26) app/command/MakeResourceCommand.php:36 — MakeResourceCommand.execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 4 (8 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 · UnifiedAuthenticationListener.getTokenHandler (cognitive 26) · ×1
  • UnifiedAuthenticationListener.getTokenHandler (cognitive 26) app/middleware/security/firewall/UnifiedAuthenticationListener.php:213 — UnifiedAuthenticationListener.getTokenHandler has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (26 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 · VIPServiceImpl.editVIPInfo (cognitive 25) · ×1
  • VIPServiceImpl.editVIPInfo (cognitive 25) CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:504 — VIPServiceImpl.editVIPInfo has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 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 · DefaultMail.doSend (cognitive 25) · ×1
  • DefaultMail.doSend (cognitive 25) CoreW/Mail/DefaultMail.php:15 — DefaultMail.doSend has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 1 (3 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GBS.handleNotify (cognitive 25) · ×1
  • GBS.handleNotify (cognitive 25) Gb28181Gateway/src/SwooleServer/GBS.php:909 — GBS.handleNotify has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (4 pts), boolean chains 3, 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 · GBS.trySendByeOn486 (cognitive 25) · ×1
  • GBS.trySendByeOn486 (cognitive 25) Gb28181Gateway/src/SwooleServer/GBS.php:1104 — GBS.trySendByeOn486 has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileToolkit.autoCharset (cognitive 25) · ×1
  • FileToolkit.autoCharset (cognitive 25) support/utils/FileToolkit.php:84 — FileToolkit.autoCharset has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1 (3 pts), ternaries 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 · GBServer.handleNotify (cognitive 25) · ×1
  • GBServer.handleNotify (cognitive 25) swoole-gbs/gbs-beta.php:1254 — GBServer.handleNotify has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (4 pts), boolean chains 3, 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 · GBServer.trySendByeOn486 (cognitive 25) · ×1
  • GBServer.trySendByeOn486 (cognitive 25) swoole-gbs/gbs-beta.php:1449 — GBServer.trySendByeOn486 has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeviceServiceImpl.getAreaDeviceTree (cognitive 24) · ×1
  • DeviceServiceImpl.getAreaDeviceTree (cognitive 24) CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:810 — DeviceServiceImpl.getAreaDeviceTree has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 2 (5 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GB28181DeviceController.update (cognitive 24) · ×1
  • GB28181DeviceController.update (cognitive 24) app/admin/controller/GB28181DeviceController.php:153 — GB28181DeviceController.update has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 2 (3 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XdbSearcher.search (cognitive 23) · ×1
  • XdbSearcher.search (cognitive 23) CoreW/Business/Ip2Region/XdbSearcher.php:97 — XdbSearcher.search has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (22 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 · SipGatewayServiceImpl.registerGateway (cognitive 23) · ×1
  • SipGatewayServiceImpl.registerGateway (cognitive 23) CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:383 — SipGatewayServiceImpl.registerGateway has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 7 (8 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExceptionUtil.getErrorAndHttpCodeFromException (cognitive 23) · ×1
  • ExceptionUtil.getErrorAndHttpCodeFromException (cognitive 23) CoreW/Exception/ExceptionUtil.php:13 — ExceptionUtil.getErrorAndHttpCodeFromException has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 6 (9 pts), boolean chains 2 (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 · DaoImplTemplate.splitDeclares (cognitive 23) · ×1
  • DaoImplTemplate.splitDeclares (cognitive 23) CoreW/Gii/Template/Easy/DaoImplTemplate.php:57 — DaoImplTemplate.splitDeclares has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (7 pts) (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 · AutoRecordProcess.handleDeviceRecording (cognitive 23) · ×1
  • AutoRecordProcess.handleDeviceRecording (cognitive 23) app/process/AutoRecordProcess.php:98 — AutoRecordProcess.handleDeviceRecording has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 1 (2 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 · ArrayToolkit.filter (cognitive 23) · ×1
  • ArrayToolkit.filter (cognitive 23) support/utils/ArrayToolkit.php:168 — ArrayToolkit.filter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Gb28181Service.createPlaybackSessionAndOpenRtp (cognitive 22) · ×1
  • Gb28181Service.createPlaybackSessionAndOpenRtp (cognitive 22) CoreW/Business/GB/Gb28181Service.php:808 — Gb28181Service.createPlaybackSessionAndOpenRtp has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 4 (8 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProductServiceImpl.updateScene (cognitive 22) · ×1
  • ProductServiceImpl.updateScene (cognitive 22) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:153 — ProductServiceImpl.updateScene has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 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 · UserDaoImpl.createQueryBuilder (cognitive 22) · ×1
  • UserDaoImpl.createQueryBuilder (cognitive 22) CoreW/Business/User/Dao/Impl/UserDaoImpl.php:151 — UserDaoImpl.createQueryBuilder has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RedisSubscriber.run (cognitive 22) · ×1
  • RedisSubscriber.run (cognitive 22) Gb28181Gateway/src/Handlers/LongTask/RedisSubscriber.php:48 — RedisSubscriber.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthController.login (cognitive 22) · ×1
  • AuthController.login (cognitive 22) app/admin/controller/AuthController.php:27 — AuthController.login has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoRecordProcess.handleStreamProxyRecording (cognitive 22) · ×1
  • AutoRecordProcess.handleStreamProxyRecording (cognitive 22) app/process/AutoRecordProcess.php:159 — AutoRecordProcess.handleStreamProxyRecording has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeMachineToolkit.formatTime (cognitive 22) · ×1
  • TimeMachineToolkit.formatTime (cognitive 22) support/utils/TimeMachineToolkit.php:25 — TimeMachineToolkit.formatTime has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 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 · Gb28181SendRtpPortService.getNextPort (cognitive 21) · ×1
  • Gb28181SendRtpPortService.getNextPort (cognitive 21) CoreW/Business/GB/Gb28181SendRtpPortService.php:38 — Gb28181SendRtpPortService.getNextPort has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 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 · GiiFactory.delDir (cognitive 21) · ×1
  • GiiFactory.delDir (cognitive 21) CoreW/Gii/GiiFactory.php:39 — GiiFactory.delDir has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 1 (3 pts), boolean chains 1 (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 · GB28181Handler.handleRegister (cognitive 21) · ×1
  • GB28181Handler.handleRegister (cognitive 21) Gb28181Gateway/src/Handlers/GB28181Handler.php:1062 — GB28181Handler.handleRegister has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GB28181StreamController.playbackDownload (cognitive 21) · ×1
  • GB28181StreamController.playbackDownload (cognitive 21) app/admin/controller/GB28181StreamController.php:265 — GB28181StreamController.playbackDownload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 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 · SystemMonitoringController.getSystemStats (cognitive 21) · ×1
  • SystemMonitoringController.getSystemStats (cognitive 21) app/admin/controller/SystemMonitoringController.php:23 — SystemMonitoringController.getSystemStats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4, 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 · ZLMHookController.handleVoicePublish (cognitive 21) · ×1
  • ZLMHookController.handleVoicePublish (cognitive 21) app/api/v2/controller/ZLMHookController.php:165 — ZLMHookController.handleVoicePublish has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (21 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExceptionUtil.getErrorAndHttpCodeFromException (cognitive 21) · ×1
  • ExceptionUtil.getErrorAndHttpCodeFromException (cognitive 21) support/utils/ExceptionUtil.php:14 — ExceptionUtil.getErrorAndHttpCodeFromException has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (11 pts), if/else 6 (9 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GisUtil.getPolygonCorners (cognitive 21) · ×1
  • GisUtil.getPolygonCorners (cognitive 21) support/utils/GisUtil.php:32 — GisUtil.getPolygonCorners has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (8 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ProductServiceImpl.getDouYinVideoRedirectUrl (cognitive 20) · ×1
  • ProductServiceImpl.getDouYinVideoRedirectUrl (cognitive 20) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:622 — ProductServiceImpl.getDouYinVideoRedirectUrl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GBS.handleTcpClient (cognitive 20) · ×1
  • GBS.handleTcpClient (cognitive 20) Gb28181Gateway/src/SwooleServer/GBS.php:382 — GBS.handleTcpClient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), 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 · GBS.verifyAuth (cognitive 20) · ×1
  • GBS.verifyAuth (cognitive 20) Gb28181Gateway/src/SwooleServer/GBS.php:1438 — GBS.verifyAuth has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, ternaries 2 (6 pts), if/else 5, 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 · GenerateAlarmDataCommand.execute (cognitive 20) · ×1
  • GenerateAlarmDataCommand.execute (cognitive 20) app/command/GenerateAlarmDataCommand.php:39 — GenerateAlarmDataCommand.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 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 · UnifiedAuthenticationListener.handleTokenAuth (cognitive 20) · ×1
  • UnifiedAuthenticationListener.handleTokenAuth (cognitive 20) app/middleware/security/firewall/UnifiedAuthenticationListener.php:94 — UnifiedAuthenticationListener.handleTokenAuth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 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 · Monitor.checkFilesChange (cognitive 20) · ×1
  • Monitor.checkFilesChange (cognitive 20) process/Monitor.php:117 — Monitor.checkFilesChange has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 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 · GBServer.handleTcpClient (cognitive 20) · ×1
  • GBServer.handleTcpClient (cognitive 20) swoole-gbs/gbs-beta.php:727 — GBServer.handleTcpClient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), 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 · GBServer.verifyAuth (cognitive 20) · ×1
  • GBServer.verifyAuth (cognitive 20) swoole-gbs/gbs-beta.php:1783 — GBServer.verifyAuth has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, ternaries 2 (6 pts), if/else 5, 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 · AttachmentServiceImpl.mergeSnippetFile (cognitive 19) · ×1
  • AttachmentServiceImpl.mergeSnippetFile (cognitive 19) CoreW/Business/Attachment/Service/Impl/AttachmentServiceImpl.php:269 — AttachmentServiceImpl.mergeSnippetFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZLMediaKitStrategy.getStats (cognitive 19) · ×1
  • ZLMediaKitStrategy.getStats (cognitive 19) CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:19 — ZLMediaKitStrategy.getStats has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 6, loops 3 (5 pts), error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemServiceImpl.getCpuStats (cognitive 19) · ×1
  • SystemServiceImpl.getCpuStats (cognitive 19) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:278 — SystemServiceImpl.getCpuStats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CurlRequest.mergeArray (cognitive 19) · ×1
  • CurlRequest.mergeArray (cognitive 19) CoreW/Sdk/Ys7Sdk/CurlRequest.php:55 — CurlRequest.mergeArray has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProductCatalogServiceImpl.updateProductCatalog (cognitive 18) · ×1
  • ProductCatalogServiceImpl.updateProductCatalog (cognitive 18) CoreW/Business/Product/Service/Impl/ProductCatalogServiceImpl.php:227 — ProductCatalogServiceImpl.updateProductCatalog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 3, ternaries 2, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RecordFileServiceImpl.createFromHook (cognitive 18) · ×1
  • RecordFileServiceImpl.createFromHook (cognitive 18) CoreW/Business/RecordFile/Service/Impl/RecordFileServiceImpl.php:27 — RecordFileServiceImpl.createFromHook has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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 · GB28181ChannelController.getZLMediaKitSchemaFromUrl (cognitive 18) · ×1
  • GB28181ChannelController.getZLMediaKitSchemaFromUrl (cognitive 18) app/admin/controller/GB28181ChannelController.php:423 — GB28181ChannelController.getZLMediaKitSchemaFromUrl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProductServiceImpl.setProductTourNodes (cognitive 17) · ×1
  • ProductServiceImpl.setProductTourNodes (cognitive 17) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:740 — ProductServiceImpl.setProductTourNodes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 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 · RecordMergeTaskServiceImpl.formatTask (cognitive 17) · ×1
  • RecordMergeTaskServiceImpl.formatTask (cognitive 17) CoreW/Business/RecordMerge/Service/Impl/RecordMergeTaskServiceImpl.php:351 — RecordMergeTaskServiceImpl.formatTask has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (6 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 · DoctrineServiceProvider.register (cognitive 17) · ×1
  • DoctrineServiceProvider.register (cognitive 17) CoreW/Provider/DoctrineServiceProvider.php:20 — DoctrineServiceProvider.register has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4, ternaries 1 (2 pts), boolean chains 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 · Device.updateConfig (cognitive 17) · ×1
  • Device.updateConfig (cognitive 17) Gb28181Gateway/src/Device/Device.php:301 — Device.updateConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), 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.
D2 · Cognitive Complexity · GBS.receiveLoop (cognitive 17) · ×1
  • GBS.receiveLoop (cognitive 17) Gb28181Gateway/src/SwooleServer/GBS.php:303 — GBS.receiveLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileAfterUploadProcess.consume (cognitive 17) · ×1
  • FileAfterUploadProcess.consume (cognitive 17) app/queue/redis/fast/FileAfterUploadProcess.php:23 — FileAfterUploadProcess.consume has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, 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 · GBServer.receiveLoop (cognitive 17) · ×1
  • GBServer.receiveLoop (cognitive 17) swoole-gbs/gbs-beta.php:648 — GBServer.receiveLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeviceServiceImpl.getDeviceChannelTree (cognitive 16) · ×1
  • DeviceServiceImpl.getDeviceChannelTree (cognitive 16) CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:747 — DeviceServiceImpl.getDeviceChannelTree has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 1 (3 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VoiceTalkServiceImpl.stopVoiceTalkBySession (cognitive 16) · ×1
  • VoiceTalkServiceImpl.stopVoiceTalkBySession (cognitive 16) CoreW/Business/Devices/Service/Impl/VoiceTalkServiceImpl.php:377 — VoiceTalkServiceImpl.stopVoiceTalkBySession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 4 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProductServiceImpl.makeHotPoint (cognitive 16) · ×1
  • ProductServiceImpl.makeHotPoint (cognitive 16) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:562 — ProductServiceImpl.makeHotPoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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 · StreamProxyServiceImpl.updateProxy (cognitive 16) · ×1
  • StreamProxyServiceImpl.updateProxy (cognitive 16) CoreW/Business/StreamProxy/Service/Impl/StreamProxyServiceImpl.php:124 — StreamProxyServiceImpl.updateProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemServiceImpl.getProcessInfo (cognitive 16) · ×1
  • SystemServiceImpl.getProcessInfo (cognitive 16) CoreW/Business/System/Service/Impl/SystemServiceImpl.php:231 — SystemServiceImpl.getProcessInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 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 · AnnotationCacheBuilder.scanNamespace (cognitive 16) · ×1
  • AnnotationCacheBuilder.scanNamespace (cognitive 16) CoreW/Dao/Annotation/AnnotationCacheBuilder.php:25 — AnnotationCacheBuilder.scanNamespace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetadataReader.read (cognitive 16) · ×1
  • MetadataReader.read (cognitive 16) CoreW/Dao/Annotation/MetadataReader.php:17 — MetadataReader.read has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CurlRequest.sendMultiRequest (cognitive 16) · ×1
  • CurlRequest.sendMultiRequest (cognitive 16) CoreW/Sdk/Ys7Sdk/CurlRequest.php:347 — CurlRequest.sendMultiRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 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 · GBS.handleResponse (cognitive 16) · ×1
  • GBS.handleResponse (cognitive 16) Gb28181Gateway/src/SwooleServer/GBS.php:971 — GBS.handleResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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 · GB28181ChannelController.parseCodecInfo (cognitive 16) · ×1
  • GB28181ChannelController.parseCodecInfo (cognitive 16) app/admin/controller/GB28181ChannelController.php:611 — GB28181ChannelController.parseCodecInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (2 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 · DeleteSceneJob.consume (cognitive 16) · ×1
  • DeleteSceneJob.consume (cognitive 16) app/queue/redis/fast/DeleteSceneJob.php:21 — DeleteSceneJob.consume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · GBServer.handleResponse (cognitive 16) · ×1
  • GBServer.handleResponse (cognitive 16) swoole-gbs/gbs-beta.php:1316 — GBServer.handleResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 51 shared lines) · ×1
  • Near-duplicate member family (4 members, 51 shared lines) Gb28181Gateway/src/SwooleServer/GBS.php:1683 — Gb28181Gateway/src/SwooleServer/GBS.php:1683-1854 | Gb28181Gateway/src/SwooleServer/GBS.php:2303-2518 | swoole-gbs/gbs-beta.php:2028-2199 | swoole-gbs/gbs-beta.php:2648-2863 — These 4 members are variants of one another: a block of 51 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 pair (172 shared lines) · ×1
  • Near-duplicate member pair (172 shared lines) Gb28181Gateway/src/SwooleServer/GBS.php:686 — Gb28181Gateway/src/SwooleServer/GBS.php:686-878 | swoole-gbs/gbs-beta.php:1031-1223 — These two members are variants of one another: 172 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) app/admin/controller/StreamProxyController.php:120 — app/admin/controller/StreamProxyController.php:120-134 | app/admin/controller/StreamProxyController.php:142-154 | app/admin/controller/StreamProxyController.php:162-170 | app/admin/controller/StreamProxyController.php:178-190 | app/admin/controller/StreamProxyController.php:198-206 | app/admin/controller/StreamProxyController.php:214-222 | app/admin/controller/StreamProxyController.php:230-238 | app/admin/controller/StreamProxyController.php:246-264 | app/admin/controller/StreamProxyController.php:272-284 — 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Gb28181Gateway/src/SwooleServer/GBS.php:1859 — Gb28181Gateway/src/SwooleServer/GBS.php:1859-1897 | Gb28181Gateway/src/SwooleServer/GBS.php:1902-1940 | Gb28181Gateway/src/SwooleServer/GBS.php:2207-2246 | swoole-gbs/gbs-beta.php:2204-2242 | swoole-gbs/gbs-beta.php:2247-2285 | swoole-gbs/gbs-beta.php:2552-2591 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) CoreW/Gii/Template/Easy/DaoImplTemplate.php:18 — CoreW/Gii/Template/Easy/DaoImplTemplate.php:18-54 | CoreW/Gii/Template/Easy/DaoInterfaceTemplate.php:13-39 | CoreW/Gii/Template/Easy/ExceptionTemplate.php:13-53 | CoreW/Gii/Template/Easy/ServiceImplTemplate.php:13-80 | CoreW/Gii/Template/Easy/ServiceInterfaceTemplate.php:13-45 — 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 (202 corresponding lines) · ×1
  • Edited copy of a member (202 corresponding lines) Gb28181Gateway/src/SwooleServer/GBS.php:1988 — Gb28181Gateway/src/SwooleServer/GBS.php:1988-2189 | swoole-gbs/gbs-beta.php:2333-2534 — These two members are one piece of code written twice and then edited apart: 202 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (84 corresponding lines) · ×1
  • Edited copy of a member (84 corresponding lines) Gb28181Gateway/src/SwooleServer/Channel.php:65 — Gb28181Gateway/src/SwooleServer/Channel.php:65-148 | swoole-gbs/gbs-beta.php:157-240 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) app/queue/redis/fast/PanoramaChunkTilesJob.php:176 — app/queue/redis/fast/PanoramaChunkTilesJob.php:176-246 | app/queue/redis/fast/PanoramaChunkTilesJob.php:261-307 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
  • Edited copy of a member (54 corresponding lines) app/process/AutoRecordProcess.php:100 — app/process/AutoRecordProcess.php:100-153 | app/process/AutoRecordProcess.php:161-222 — 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 (74 corresponding lines) · ×1
  • Edited copy of a member (74 corresponding lines) CoreW/Business/Devices/Traits/GB28181StreamTrait.php:285 — CoreW/Business/Devices/Traits/GB28181StreamTrait.php:285-358 | CoreW/Business/Devices/Traits/GB28181StreamTrait.php:546-636 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:371 — CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:371-459 | CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:473-532 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) Gb28181Gateway/src/Message/CommandDispatcher.php:313 — Gb28181Gateway/src/Message/CommandDispatcher.php:313-414 | Gb28181Gateway/src/Message/CommandDispatcher.php:1108-1183 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (100 corresponding lines) · ×1
  • Edited copy of a member (100 corresponding lines) Gb28181Gateway/src/Message/CommandDispatcher.php:169 — Gb28181Gateway/src/Message/CommandDispatcher.php:169-268 | Gb28181Gateway/src/Message/CommandDispatcher.php:505-606 — These two members are one piece of code written twice and then edited apart: 100 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) support/utils/JsonToolkit.php:11 — support/utils/JsonToolkit.php:11-68 | support/utils/StringToolkit.php:142-200 — 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 (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:207 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:207-256 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:202-250 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) support/utils/FileToolkit.php:962 — support/utils/FileToolkit.php:962-980 | support/utils/FileToolkit.php:985-1011 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 63+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 63+ corresponding lines) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:126 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:126-193 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:123-185 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:120-188 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 63 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) Gb28181Gateway/src/Message/CommandDispatcher.php:277 — Gb28181Gateway/src/Message/CommandDispatcher.php:277-304 | Gb28181Gateway/src/Message/CommandDispatcher.php:422-449 | Gb28181Gateway/src/Message/CommandDispatcher.php:632-673 — 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 copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) app/admin/controller/GB28181DeviceController.php:104 — app/admin/controller/GB28181DeviceController.php:104-131 | app/api/v2/controller/GB28181DeviceController.php:135-162 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) app/middleware/admin/OpenApiAuth.php:29 — app/middleware/admin/OpenApiAuth.php:29-63 | app/middleware/security/firewall/UnifiedAuthenticationListener.php:62-91 — 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 (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) Gb28181Gateway/src/Message/CommandDispatcher.php:1741 — Gb28181Gateway/src/Message/CommandDispatcher.php:1741-1777 | Gb28181Gateway/src/Message/CommandDispatcher.php:1885-1919 — 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 copies of one member (6 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 19+ corresponding lines) app/admin/controller/GB28181DeviceControlController.php:61 — app/admin/controller/GB28181DeviceControlController.php:61-81 | app/admin/controller/GB28181DeviceControlController.php:92-112 | app/admin/controller/GB28181DeviceControlController.php:207-236 | app/admin/controller/GB28181PTZController.php:70-88 | app/admin/controller/GB28181PTZController.php:96-117 | app/admin/controller/GB28181PTZController.php:125-146 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) CoreW/Business/GB/Gb28181SendRtpPortService.php:138 — CoreW/Business/GB/Gb28181SendRtpPortService.php:138-159 | CoreW/Business/GB/Gb28181SendRtpPortService.php:167-187 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) app/admin/controller/ProductCatalogController.php:43 — app/admin/controller/ProductCatalogController.php:43-61 | app/admin/controller/ProductTagController.php:15-33 | app/admin/controller/SystemController.php:22-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) CoreW/Business/User/Service/Impl/UserServiceImpl.php:588 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:588-607 | CoreW/Business/User/Service/Impl/UserServiceImpl.php:668-689 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:905-926 — 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 copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:32 — CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:32-62 | CoreW/Business/Alarm/Service/Impl/AlarmPlanServiceImpl.php:67-100 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) app/admin/controller/GB28181DeviceControlController.php:35 — app/admin/controller/GB28181DeviceControlController.php:35-50 | app/admin/controller/GB28181DeviceControlController.php:154-169 | app/admin/controller/GB28181PTZController.php:209-224 | app/admin/controller/GB28181StreamController.php:57-78 | app/admin/controller/GB28181StreamController.php:86-112 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) app/admin/controller/MenuController.php:142 — app/admin/controller/MenuController.php:142-153 | app/admin/controller/RoleController.php:165-176 | app/admin/controller/UserController.php:258-274 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 34+ corresponding lines) CoreW/Sdk/ZLMediaKit/ZLMClient.php:636 — CoreW/Sdk/ZLMediaKit/ZLMClient.php:636-677 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:701-744 | CoreW/Sdk/ZLMediaKit/ZLMClient.php:764-797 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 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 (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) app/api/v1/controller/ProductController.php:50 — app/api/v1/controller/ProductController.php:50-71 | app/api/v1/controller/ProductController.php:160-187 — 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, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) CoreW/Mail/AbstractMail.php:78 — CoreW/Mail/AbstractMail.php:78-86 | CoreW/Sdk/AMapSdk/AMapClient.php:77-85 | CoreW/Sdk/Iot/Driver/Base.php:342-352 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) app/api/filters/ProductFilter.php:94 — app/api/filters/ProductFilter.php:94-103 | app/api/filters/ProductSceneFilter.php:59-62 | app/api/filters/ProductSceneFilter.php:67-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) app/admin/controller/GB28181RecordPlanController.php:153 — app/admin/controller/GB28181RecordPlanController.php:153-164 | app/admin/controller/GB28181RecordPlanController.php:187-198 | app/admin/controller/GB28181SubscribeController.php:58-70 | app/admin/controller/GB28181SubscribeController.php:79-90 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) app/admin/controller/MediaServerController.php:53 — app/admin/controller/MediaServerController.php:53-68 | app/admin/controller/MediaServerController.php:76-87 | app/admin/controller/MediaServerController.php:175-186 | app/admin/controller/MediaServerController.php:242-253 | app/admin/controller/MediaServerController.php:261-276 — 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 (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:191 — CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:191-204 | CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:212-225 | CoreW/Business/MediaServer/Strategy/ZLMediaKitStrategy.php:311-325 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:345 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:345-357 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:333-347 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:338-353 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) app/api/v2/controller/GBGatewayConfigController.php:19 — app/api/v2/controller/GBGatewayConfigController.php:19-29 | app/api/v2/controller/GBGatewayConfigController.php:38-56 | app/api/v2/controller/GBGatewayConfigController.php:65-104 — 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, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) app/api/v1/controller/ProductController.php:302 — app/api/v1/controller/ProductController.php:302-309 | app/api/v1/controller/ProductController.php:323-330 | app/api/v1/controller/ProductController.php:425-432 — 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) · ×1
  • Edited copy of a member (6 corresponding lines) app/admin/controller/ProductTagController.php:45 — app/admin/controller/ProductTagController.php:45-51 | app/api/v1/controller/ProductController.php:467-472 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×1
  • Edited copy of a member (2 corresponding lines) app/middleware/admin/OpenApiAuth.php:68 — app/middleware/admin/OpenApiAuth.php:68-69 | app/middleware/security/firewall/UnifiedAuthenticationListener.php:159-160 — 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 · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) Gb28181Gateway/src/SwooleServer/Helper.php:62 — Gb28181Gateway/src/SwooleServer/Helper.php:62-64 | swoole-gbs/gbs-beta.php:61-63 — 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 · Duplicated block (216 lines × 2) · ×1
  • Duplicated block (216 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2303 — Gb28181Gateway/src/SwooleServer/GBS.php:2303-2518 | swoole-gbs/gbs-beta.php:2648-2863 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (172 lines × 2) · ×1
  • Duplicated block (172 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1683 — Gb28181Gateway/src/SwooleServer/GBS.php:1683-1854 | swoole-gbs/gbs-beta.php:2028-2199 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (99 lines × 2) · ×1
  • Duplicated block (99 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1549 — Gb28181Gateway/src/SwooleServer/GBS.php:1549-1647 | swoole-gbs/gbs-beta.php:1894-1992 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (93 lines × 2) · ×1
  • Duplicated block (93 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:559 — Gb28181Gateway/src/SwooleServer/GBS.php:559-651 | swoole-gbs/gbs-beta.php:904-996 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (77 lines × 2) · ×1
  • Duplicated block (77 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2526 — Gb28181Gateway/src/SwooleServer/GBS.php:2526-2602 | swoole-gbs/gbs-beta.php:2871-2947 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:2526` it begins part-way through the construct above it, so those 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 (68 lines × 2) · ×1
  • Duplicated block (68 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:229 — Gb28181Gateway/src/SwooleServer/GBS.php:229-296 | swoole-gbs/gbs-beta.php:574-641 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (67 lines × 2) · ×1
  • Duplicated block (67 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1157 — Gb28181Gateway/src/SwooleServer/GBS.php:1157-1223 | swoole-gbs/gbs-beta.php:1502-1568 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) Gb28181Gateway/src/SwooleServer/GBS.php:763 — Gb28181Gateway/src/SwooleServer/GBS.php:763-825 | swoole-gbs/gbs-beta.php:1108-1170 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:763` it begins part-way through the construct above it, so those 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 (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:686 — Gb28181Gateway/src/SwooleServer/GBS.php:686-747 | swoole-gbs/gbs-beta.php:1031-1092 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:686` it does not close everything it opens, so those 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 (142 lines × 2) · ×1
  • Duplicated block (142 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:2048 — Gb28181Gateway/src/SwooleServer/GBS.php:2048-2189 | swoole-gbs/gbs-beta.php:2393-2534 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:2048` it begins part-way through the construct above it, so those 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 (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:911 — Gb28181Gateway/src/SwooleServer/GBS.php:911-964 | swoole-gbs/gbs-beta.php:1256-1309 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:384 — Gb28181Gateway/src/SwooleServer/GBS.php:384-431 | swoole-gbs/gbs-beta.php:729-776 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (39–42 lines × 3) · ×1
  • Duplicated block (39–42 lines × 3) Gb28181Gateway/src/Message/CommandDispatcher.php:376 — Gb28181Gateway/src/Message/CommandDispatcher.php:376-414 | Gb28181Gateway/src/Message/CommandDispatcher.php:565-606 | Gb28181Gateway/src/Message/CommandDispatcher.php:1145-1183 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Gb28181Gateway/src/Message/CommandDispatcher.php:561` calls `log` and `Gb28181Gateway/src/Message/CommandDispatcher.php:373` 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) · ×1
  • Duplicated block (42 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1324 — Gb28181Gateway/src/SwooleServer/GBS.php:1324-1365 | swoole-gbs/gbs-beta.php:1669-1710 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (37–40 lines × 2) · ×1
  • Duplicated block (37–40 lines × 2) REDACTED:140 — REDACTED:140-179 | REDACTED:131-167 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 137 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 (27–39 lines × 2) · ×1
  • Duplicated block (27–39 lines × 2) Gb28181Gateway/src/Message/CommandDispatcher.php:2252 — Gb28181Gateway/src/Message/CommandDispatcher.php:2252-2290 | Gb28181Gateway/src/Message/CommandDispatcher.php:2311-2337 — both copies are in the same file, so extract the 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 `Gb28181Gateway/src/Message/CommandDispatcher.php:2252` 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–38 lines × 4) · ×1
  • Duplicated block (27–38 lines × 4) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:270 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:270-296 | CoreW/Business/Attachment/Implementors/Impl/LocalFileImplementor.php:172-209 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:258-284 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:264-290 — before extracting anything, compare `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php` and `CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 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 `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:270` it does not close everything it opens, so those 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 (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:466 — Gb28181Gateway/src/SwooleServer/GBS.php:466-500 | swoole-gbs/gbs-beta.php:811-845 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:1992 — Gb28181Gateway/src/SwooleServer/GBS.php:1992-2024 | swoole-gbs/gbs-beta.php:2337-2369 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:1992` it does not close everything it opens, so those 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) Gb28181Gateway/src/SwooleServer/GBS.php:1002 — Gb28181Gateway/src/SwooleServer/GBS.php:1002-1033 | swoole-gbs/gbs-beta.php:1347-1378 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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) support/utils/JsonToolkit.php:29 — support/utils/JsonToolkit.php:29-58 | support/utils/StringToolkit.php:160-190 — 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 `support/utils/JsonToolkit.php:29` it begins part-way through the construct above it, so those 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 lines × 6) · ×1
  • Duplicated block (29 lines × 6) Gb28181Gateway/src/SwooleServer/GBS.php:1864 — Gb28181Gateway/src/SwooleServer/GBS.php:1864-1892 | Gb28181Gateway/src/SwooleServer/GBS.php:1907-1935 | Gb28181Gateway/src/SwooleServer/GBS.php:2215-2243 | swoole-gbs/gbs-beta.php:2209-2237 | swoole-gbs/gbs-beta.php:2252-2280 | swoole-gbs/gbs-beta.php:2560-2588 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:1864` it does not close everything it opens, so those 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–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) CoreW/Gii/Template/Easy/ExceptionTemplate.php:21 — CoreW/Gii/Template/Easy/ExceptionTemplate.php:21-48 | CoreW/Gii/Template/Easy/ServiceImplTemplate.php:22-50 — before extracting anything, compare `CoreW/Gii/Template/Easy/ExceptionTemplate.php` and `CoreW/Gii/Template/Easy/ServiceImplTemplate.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 92 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 `CoreW/Gii/Template/Easy/ExceptionTemplate.php:21` it begins part-way through the construct above it, so those 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) · ×1
  • Duplicated block (28 lines × 2) CoreW/Business/User/Service/Impl/UserServiceImpl.php:448 — CoreW/Business/User/Service/Impl/UserServiceImpl.php:448-475 | CoreW/Business/VIP/Service/Impl/VIPServiceImpl.php:941-968 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22–27 lines × 2) · ×1
  • Duplicated block (22–27 lines × 2) REDACTED:191 — REDACTED:191-217 | REDACTED:179-200 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 137 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 (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:107 — CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php:107-132 | CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php:134-159 — before extracting anything, compare `CoreW/Business/Devices/Handler/BroadcastStreamArrivalHandler.php` and `CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) app/api/v2/controller/GBServerHookController.php:382 — app/api/v2/controller/GBServerHookController.php:382-405 | app/api/v2/controller/GBServerHookController.php:1097-1121 — both copies are in the same file, so extract the 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 (20–24 lines × 2) · ×1
  • Duplicated block (20–24 lines × 2) app/admin/controller/GB28181RecordingController.php:243 — app/admin/controller/GB28181RecordingController.php:243-266 | app/admin/controller/GB28181RecordingController.php:306-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/GB28181RecordingController.php:243` it does not close everything it opens, so those 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–23 lines × 3) · ×1
  • Duplicated block (20–23 lines × 3) CoreW/Gii/Template/Easy/DaoImplTemplate.php:30 — CoreW/Gii/Template/Easy/DaoImplTemplate.php:30-49 | CoreW/Gii/Template/Easy/ExceptionTemplate.php:21-43 | CoreW/Gii/Template/Easy/ServiceImplTemplate.php:22-44 — before extracting anything, compare `CoreW/Gii/Template/Easy/DaoImplTemplate.php` and `CoreW/Gii/Template/Easy/ExceptionTemplate.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 `CoreW/Gii/Template/Easy/DaoImplTemplate.php:30` it begins part-way through the construct above it, so those 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–23 lines × 3) · ×1
  • Duplicated block (19–23 lines × 3) Gb28181Gateway/src/Message/CommandDispatcher.php:286 — Gb28181Gateway/src/Message/CommandDispatcher.php:286-304 | Gb28181Gateway/src/Message/CommandDispatcher.php:431-449 | Gb28181Gateway/src/Message/CommandDispatcher.php:651-673 — 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 `Gb28181Gateway/src/Message/CommandDispatcher.php:286` it begins part-way through the construct above it, so those 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–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:383 — CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:383-405 | CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:485-504 — both copies are in the same file, so extract the 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 `CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php:383` it begins part-way through the construct above it, so those 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 (20–22 lines × 4) · ×1
  • Duplicated block (20–22 lines × 4) CoreW/Gii/Template/Easy/DaoImplTemplate.php:29 — CoreW/Gii/Template/Easy/DaoImplTemplate.php:29-48 | CoreW/Gii/Template/Easy/ExceptionTemplate.php:20-41 | CoreW/Gii/Template/Easy/ServiceImplTemplate.php:21-42 | CoreW/Gii/Template/Easy/ServiceInterfaceTemplate.php:20-40 — before extracting anything, compare `CoreW/Gii/Template/Easy/DaoImplTemplate.php` and `CoreW/Gii/Template/Easy/ExceptionTemplate.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 `CoreW/Gii/Template/Easy/DaoImplTemplate.php:29` it begins part-way through the construct above it, so those 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–22 lines × 4) · ×1
  • Duplicated block (17–22 lines × 4) app/command/MakeBizCommand.php:51 — app/command/MakeBizCommand.php:51-67 | app/command/MakeBizDaoCommand.php:47-68 | app/command/MakeBizExceptionCommand.php:46-64 | app/command/MakeBizServiceCommand.php:47-66 — before extracting anything, compare `app/command/MakeBizExceptionCommand.php` and `app/command/MakeBizServiceCommand.php` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/command/MakeBizCommand.php:51` calls `getOption` and `app/command/MakeBizDaoCommand.php:47` 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 lines × 2) · ×1
  • Duplicated block (22 lines × 2) Gb28181Gateway/src/SwooleServer/GBS.php:436 — Gb28181Gateway/src/SwooleServer/GBS.php:436-457 | swoole-gbs/gbs-beta.php:781-802 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:114 — CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:114-134 | CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:163-183 | CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:211-231 — 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 `CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) CoreW/Business/User/Service/Impl/TokenServiceImpl.php:48 — CoreW/Business/User/Service/Impl/TokenServiceImpl.php:48-67 | CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php:56-76 — before extracting anything, compare `CoreW/Business/User/Service/Impl/TokenServiceImpl.php` and `CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 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 (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:207 — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:207-226 | CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php:199-218 | CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php:202-221 — before extracting anything, compare `CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php` and `CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) app/api/v2/controller/GBServerHookController.php:281 — app/api/v2/controller/GBServerHookController.php:281-298 | app/api/v2/controller/GBServerHookController.php:334-353 — both copies are in the same file, so extract the 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 (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) app/command/Gb28181Server.php:129 — app/command/Gb28181Server.php:129-147 | app/command/Gb28181Server.php:169-188 — both copies are in the same file, so extract the 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 (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) Gb28181Gateway/src/SwooleServer/GBS.php:2430 — Gb28181Gateway/src/SwooleServer/GBS.php:2430-2448 | Gb28181Gateway/src/SwooleServer/GBS.php:2632-2650 | swoole-gbs/gbs-beta.php:2775-2793 | swoole-gbs/gbs-beta.php:2977-2995 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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–19 lines × 2) · ×1
  • Duplicated block (13–19 lines × 2) CoreW/Business/Devices/Traits/GB28181StreamTrait.php:132 — CoreW/Business/Devices/Traits/GB28181StreamTrait.php:132-144 | CoreW/Business/Devices/Traits/GB28181StreamTrait.php:550-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `CoreW/Business/Devices/Traits/GB28181StreamTrait.php:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:346 — CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:346-364 | CoreW/Business/SipGateway/Service/Impl/SipGatewayServiceImpl.php:480-498 — both copies are in the same file, so extract the 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 (17–18 lines × 5) · ×1
  • Duplicated block (17–18 lines × 5) CoreW/Gii/Template/Easy/DaoImplTemplate.php:26 — CoreW/Gii/Template/Easy/DaoImplTemplate.php:26-43 | CoreW/Gii/Template/Easy/DaoInterfaceTemplate.php:18-34 | CoreW/Gii/Template/Easy/ExceptionTemplate.php:17-34 | CoreW/Gii/Template/Easy/ServiceImplTemplate.php:18-35 | CoreW/Gii/Template/Easy/ServiceInterfaceTemplate.php:17-34 — before extracting anything, compare `CoreW/Gii/Template/Easy/DaoImplTemplate.php` and `CoreW/Gii/Template/Easy/ExceptionTemplate.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) Gb28181Gateway/src/Message/CommandDispatcher.php:1622 — Gb28181Gateway/src/Message/CommandDispatcher.php:1622-1640 | Gb28181Gateway/src/Message/CommandDispatcher.php:1656-1675 | Gb28181Gateway/src/Message/CommandDispatcher.php:1816-1833 | Gb28181Gateway/src/Message/CommandDispatcher.php:1860-1877 — 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 (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) Gb28181Gateway/src/Handlers/GB28181Handler.php:755 — Gb28181Gateway/src/Handlers/GB28181Handler.php:755-772 | Gb28181Gateway/src/Handlers/GB28181Handler.php:788-803 — both copies are in the same file, so extract the 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 `Gb28181Gateway/src/Handlers/GB28181Handler.php:755` it does not close everything it opens, so those 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) · ×1
  • Duplicated block (27 lines × 2) Gb28181Gateway/src/SwooleServer/Helper.php:76 — Gb28181Gateway/src/SwooleServer/Helper.php:76-102 | swoole-gbs/gbs-beta.php:250-276 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/Helper.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 (14–16 lines × 4) · ×1
  • Duplicated block (14–16 lines × 4) Gb28181Gateway/src/SwooleServer/GBS.php:1269 — Gb28181Gateway/src/SwooleServer/GBS.php:1269-1284 | Gb28181Gateway/src/SwooleServer/GBS.php:1378-1391 | swoole-gbs/gbs-beta.php:1614-1629 | swoole-gbs/gbs-beta.php:1723-1736 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (15–16 lines × 4) · ×1
  • Duplicated block (15–16 lines × 4) Gb28181Gateway/src/SwooleServer/GBS.php:2119 — Gb28181Gateway/src/SwooleServer/GBS.php:2119-2133 | Gb28181Gateway/src/SwooleServer/GBS.php:2163-2178 | swoole-gbs/gbs-beta.php:2464-2478 | swoole-gbs/gbs-beta.php:2508-2523 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:2163` it begins part-way through the construct above it, so those 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 × 3) · ×1
  • Duplicated block (16 lines × 3) Gb28181Gateway/src/Message/QuerySender.php:457 — Gb28181Gateway/src/Message/QuerySender.php:457-472 | Gb28181Gateway/src/Message/QuerySender.php:486-501 | Gb28181Gateway/src/Message/QuerySender.php:515-530 — 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 `Gb28181Gateway/src/Message/QuerySender.php:457` it does not close everything it opens, so those 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 × 4) · ×1
  • Duplicated block (13–15 lines × 4) REDACTED:113 — REDACTED:113-127 | REDACTED:210-224 | REDACTED:106-118 | REDACTED:194-206 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 137 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:112` calls `curl_setopt`, `is_array`, `http_build_query` and `REDACTED:209` 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–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) app/admin/controller/GB28181RecordingController.php:104 — app/admin/controller/GB28181RecordingController.php:104-118 | app/admin/controller/GB28181RecordingController.php:243-257 | app/admin/controller/GB28181RecordingController.php:306-318 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/admin/controller/GB28181RecordingController.php:122` calls `createErrorJsonResponse` and `app/admin/controller/GB28181RecordingController.php:260` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–14 lines × 8) · ×1
  • Duplicated block (9–14 lines × 8) app/admin/controller/GB28181AlarmController.php:23 — app/admin/controller/GB28181AlarmController.php:23-36 | app/admin/controller/GB28181ChannelController.php:31-44 | app/admin/controller/GB28181RecordMergeController.php:23-31 | app/admin/controller/GB28181RecordTaskController.php:22-35 | app/admin/controller/GB28181RecordingController.php:28-36 | app/admin/controller/SipGatewayController.php:17-25 | app/admin/controller/StreamProxyController.php:23-36 | app/admin/controller/StreamProxyController.php:371-384 — there are 8 copies across 7 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/GB28181AlarmController.php:23` it does not close everything it opens, so those 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:13 — REDACTED:13-26 | REDACTED:44-55 — both copies are in the same file, so extract the 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:11` calls `curl_setopt`, `json_encode` and `REDACTED:43` 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–13 lines × 4) · ×1
  • Duplicated block (10–13 lines × 4) REDACTED:99 — REDACTED:99-111 | REDACTED:197-209 | REDACTED:95-104 | REDACTED:184-193 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 137 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 (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) app/admin/controller/GB28181ChannelController.php:492 — app/admin/controller/GB28181ChannelController.php:492-500 | app/admin/controller/GB28181DeviceController.php:308-320 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/GB28181DeviceController.php:308` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) app/middleware/admin/OpenApiAuth.php:51 — app/middleware/admin/OpenApiAuth.php:51-63 | app/middleware/security/firewall/UnifiedAuthenticationListener.php:80-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) Gb28181Gateway/src/SwooleServer/GBS.php:2100 — Gb28181Gateway/src/SwooleServer/GBS.php:2100-2111 | Gb28181Gateway/src/SwooleServer/GBS.php:2142-2153 | swoole-gbs/gbs-beta.php:2445-2456 | swoole-gbs/gbs-beta.php:2487-2498 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:2100` it does not close everything it opens, so those 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–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) app/admin/controller/AttachmentController.php:56 — app/admin/controller/AttachmentController.php:56-64 | app/admin/controller/MediaServerController.php:16-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/AttachmentController.php: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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) app/queue/redis/fast/PanoramaChunkTilesJob.php:193 — app/queue/redis/fast/PanoramaChunkTilesJob.php:193-204 | app/queue/redis/fast/PanoramaChunkTilesJob.php:266-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/queue/redis/fast/PanoramaChunkTilesJob.php:193` it begins part-way through the construct above it, so those 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 × 3) · ×1
  • Duplicated block (9–11 lines × 3) CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:151 — CoreW/Business/Devices/Service/Impl/DeviceServiceImpl.php:151-161 | app/admin/controller/AttachmentController.php:58-66 | app/admin/controller/MediaServerController.php:19-29 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) app/admin/controller/GB28181DeviceControlController.php:61 — app/admin/controller/GB28181DeviceControlController.php:61-71 | app/admin/controller/GB28181DeviceControlController.php:92-102 | app/admin/controller/GB28181DeviceControlController.php:207-217 — 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.
D4 · Code Duplication · Duplicated block (7–11 lines × 2) · ×1
  • Duplicated block (7–11 lines × 2) CoreW/Exception/ExceptionUtil.php:15 — CoreW/Exception/ExceptionUtil.php:15-25 | support/utils/ExceptionUtil.php:16-22 — 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 `CoreW/Exception/ExceptionUtil.php:15` it does not close everything it opens, so those 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) · ×1
  • Duplicated block (10 lines × 4) Gb28181Gateway/src/SwooleServer/GBS.php:2524 — Gb28181Gateway/src/SwooleServer/GBS.php:2524-2533 | Gb28181Gateway/src/SwooleServer/GBS.php:2608-2617 | swoole-gbs/gbs-beta.php:2869-2878 | swoole-gbs/gbs-beta.php:2953-2962 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:2524` it does not close everything it opens, so those 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 × 3) · ×1
  • Duplicated block (10 lines × 3) Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:58 — Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:58-69 | Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:131-140 | Gb28181Gateway/src/Message/CommandType/DeviceToServerSubscribeHandler.php:191-200 — 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 (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) Gb28181Gateway/src/Message/CommandDispatcher.php:316 — Gb28181Gateway/src/Message/CommandDispatcher.php:316-325 | Gb28181Gateway/src/Message/CommandDispatcher.php:1111-1118 — both copies are in the same file, so extract the 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, `Gb28181Gateway/src/Message/CommandDispatcher.php:328` calls `errorResponse` and `Gb28181Gateway/src/Message/CommandDispatcher.php:1119` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 10) · ×1
  • Duplicated block (8 lines × 10) Gb28181Gateway/src/SwooleServer/GBS.php:1739 — Gb28181Gateway/src/SwooleServer/GBS.php:1739-1746 | Gb28181Gateway/src/SwooleServer/GBS.php:1751-1758 | Gb28181Gateway/src/SwooleServer/GBS.php:1765-1772 | Gb28181Gateway/src/SwooleServer/GBS.php:2400-2407 | Gb28181Gateway/src/SwooleServer/GBS.php:2413-2420 | swoole-gbs/gbs-beta.php:2084-2091 | swoole-gbs/gbs-beta.php:2096-2103 | swoole-gbs/gbs-beta.php:2110-2117 | swoole-gbs/gbs-beta.php:2745-2752 | swoole-gbs/gbs-beta.php:2758-2765 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (7–8 lines × 6) · ×1
  • Duplicated block (7–8 lines × 6) Gb28181Gateway/src/SwooleServer/GBS.php:1294 — Gb28181Gateway/src/SwooleServer/GBS.php:1294-1301 | Gb28181Gateway/src/SwooleServer/GBS.php:1403-1409 | Gb28181Gateway/src/SwooleServer/GBS.php:1416-1423 | swoole-gbs/gbs-beta.php:1639-1646 | swoole-gbs/gbs-beta.php:1748-1754 | swoole-gbs/gbs-beta.php:1761-1768 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 `Gb28181Gateway/src/SwooleServer/GBS.php:1294` it begins part-way through the construct above it, so those 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 × 9) · ×1
  • Duplicated block (7 lines × 9) app/admin/controller/GB28181AlarmController.php:26 — app/admin/controller/GB28181AlarmController.php:26-36 | app/admin/controller/GB28181ChannelController.php:35-44 | app/admin/controller/GB28181RecordMergeController.php:25-31 | app/admin/controller/GB28181RecordTaskController.php:25-35 | app/admin/controller/GB28181RecordingController.php:30-36 | app/admin/controller/GB28181RecordingController.php:42-50 | app/admin/controller/SipGatewayController.php:19-25 | app/admin/controller/StreamProxyController.php:26-36 | app/admin/controller/StreamProxyController.php:374-384 — there are 9 copies across 7 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/GB28181AlarmController.php:26` it does not close everything it opens, so those 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–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) CoreW/Dao/DaoProxy.php:244 — CoreW/Dao/DaoProxy.php:244-250 | CoreW/Dao/DaoProxy.php:280-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) app/admin/controller/StreamProxyController.php:130 — app/admin/controller/StreamProxyController.php:130-134 | app/admin/controller/StreamProxyController.php:150-154 | app/admin/controller/StreamProxyController.php:166-170 | app/admin/controller/StreamProxyController.php:186-190 | app/admin/controller/StreamProxyController.php:202-206 | app/admin/controller/StreamProxyController.php:218-222 | app/admin/controller/StreamProxyController.php:234-238 | app/admin/controller/StreamProxyController.php:260-264 | app/admin/controller/StreamProxyController.php:280-284 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/admin/controller/StreamProxyController.php:130` it begins part-way through the construct above it, so those 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 (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) Gb28181Gateway/src/SwooleServer/GBS.php:1254 — Gb28181Gateway/src/SwooleServer/GBS.php:1254-1258 | Gb28181Gateway/src/SwooleServer/GBS.php:1292-1296 | Gb28181Gateway/src/SwooleServer/GBS.php:1401-1405 | Gb28181Gateway/src/SwooleServer/GBS.php:1414-1418 | swoole-gbs/gbs-beta.php:1599-1603 | swoole-gbs/gbs-beta.php:1637-1641 | swoole-gbs/gbs-beta.php:1746-1750 | swoole-gbs/gbs-beta.php:1759-1763 — before extracting anything, compare `Gb28181Gateway/src/SwooleServer/GBS.php` and `swoole-gbs/gbs-beta.php` as WHOLE FILES: this scan already matched 65 separate duplicated blocks between them, totalling at least 2194 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 (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:731 — CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:731-737 | CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:1005-1012 — both copies are in the same file, so extract the 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 `CoreW/Business/Product/Service/Impl/ProductServiceImpl.php:731` it does not close everything it opens, so those 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 (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) CoreW/Business/Alarm/Dao/Impl/AlarmEventDaoImpl.php:14 — CoreW/Business/Alarm/Dao/Impl/AlarmEventDaoImpl.php:14-93 | CoreW/Business/Devices/Dao/Impl/AlarmDaoImpl.php:15-79 — before extracting anything, compare `CoreW/Business/Alarm/Dao/Impl/AlarmEventDaoImpl.php` and `CoreW/Business/Devices/Dao/Impl/AlarmDaoImpl.php` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `CoreW/Business/Alarm/Dao/Impl/AlarmEventDaoImpl.php:14` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (73 lines × 2) · ×1
  • Duplicated block (73 lines × 2) CoreW/Business/User/Dao/Impl/UserBindDaoImpl.php:16 — CoreW/Business/User/Dao/Impl/UserBindDaoImpl.php:16-88 | CoreW/Business/VIP/Dao/Impl/VIPBindDaoImpl.php:14-86 — before extracting anything, compare `CoreW/Business/User/Dao/Impl/UserBindDaoImpl.php` and `CoreW/Business/VIP/Dao/Impl/VIPBindDaoImpl.php` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `CoreW/Business/User/Dao/Impl/UserBindDaoImpl.php:16` 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 (39 lines × 3) · ×1
  • Duplicated block (39 lines × 3) CoreW/Business/VIP/Dao/Impl/VIPCompanyDaoImpl.php:15 — CoreW/Business/VIP/Dao/Impl/VIPCompanyDaoImpl.php:15-55 | CoreW/Business/VIP/Dao/Impl/VIPCompanyIotDaoImpl.php:15-53 | CoreW/Business/VIP/Dao/Impl/VIPDaoImpl.php:15-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `CoreW/Business/VIP/Dao/Impl/VIPCompanyDaoImpl.php:15` 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) app/middleware/admin/AuthIdentityMiddleware.php:16 — app/middleware/admin/AuthIdentityMiddleware.php:16-46 | app/middleware/api/AuthIdentityMiddleware.php:16-46 — `app/middleware/admin/AuthIdentityMiddleware.php` and `app/middleware/api/AuthIdentityMiddleware.php` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `app/middleware/admin/AuthIdentityMiddleware.php:16` 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 (15 lines × 27) · ×1
  • Duplicated block (15 lines × 27) migrations/20230312162251_product_table.php:12 — migrations/20230312162251_product_table.php:12-43 | migrations/20230312162314_scene_table.php:12-41 | migrations/20230312162325_hotpot_table.php:12-49 | migrations/20230505161918_create_attachment_table.php:12-46 | migrations/20230510211435_create_biz_token_table.php:12-34 | migrations/20230806122626_create_product_catalog_table.php:12-38 | migrations/20230806122641_create_tag_table.php:12-31 | migrations/20230806122649_create_product_catalog_tag_table.php:12-26 | migrations/20231207024810_add_product_tag_table.php:12-28 | migrations/20240103104025_add_product_tour_table.php:12-35 | migrations/20240103104030_add_product_tour_node_table.php:12-37 | migrations/20240118072954_add_product_plane_graph_table.php:12-34 | migrations/20240123032252_add_product_setting_table.php:12-31 | migrations/20240812090119_create_vip_company_table.php:12-38 | migrations/20240812090124_create_vip_company_iot_table.php:12-36 | migrations/20251231075323_media_server_table.php:12-55 | migrations/20260105102242_menu_table.php:12-47 | migrations/20260112022030_device_presets_table.php:12-36 | migrations/20260115073326_create_gb_session_viewers_table.php:12-32 | migrations/20260122065647_create_alarm_plan_table.php:12-37 | migrations/20260122070047_create_alarm_plan_channel_table.php:12-35 | migrations/20260122070409_create_alarm_event_table.php:12-50 | migrations/20260122070415_create_alarm_event_asset_table.php:12-36 | migrations/20260122070615_create_gv_snapshot_file_table.php:12-61 | migrations/20260122080000_create_device_subscribe_config_table.php:12-48 | migrations/20260128073200_alter_device_subscribe_config_add_fields.php:12-34 | migrations/20260130000001_gb28181_voice_sessions.php:9-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 27 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `migrations/20230312162251_product_table.php:12` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20 lines × 7) · ×1
  • Duplicated block (20 lines × 7) migrations/20260227000003_create_device_positions_table.php:12 — migrations/20260227000003_create_device_positions_table.php:12-47 | migrations/20260306000001_create_stream_proxies_table.php:12-91 | migrations/20260306000002_create_stream_proxy_logs_table.php:12-46 | migrations/20260519000001_create_sip_gateways_table.php:12-69 | migrations/20260519000003_create_record_merge_tasks_table.php:12-50 | migrations/20260521000001_add_user_api_key_fields.php:12-35 | migrations/20260526084848_alter_merge_task_record_fields.php:12-31 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `migrations/20260227000003_create_device_positions_table.php:12` 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) CoreW/Business/User/Dao/Impl/UserDaoImpl.php:129 — CoreW/Business/User/Dao/Impl/UserDaoImpl.php:129-136 | CoreW/Business/User/Dao/Impl/UserDaoImpl.php:141-148 | CoreW/Dao/GeneralDaoImpl.php:277-284 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) app/admin/controller/GB28181RecordMergeController.php:59 — app/admin/controller/GB28181RecordMergeController.php:59-64 | app/admin/controller/SipGatewayController.php:44-49 | app/admin/controller/StreamProxyController.php:106-112 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: Filter (LCOM4 6) CoreW/Business/DataFilters/Filter.php:22 — Filter'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.
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.
Minor — 120 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:228 — `debug` at line 228 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:232 — `debug` at line 232 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:505 — `error` at line 505 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->error('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::error('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:528 — `debug` at line 528 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:529 — `debug` at line 529 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:541 — `debug` at line 541 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:546 — `debug` at line 546 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:606 — `debug` at line 606 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:623 — `debug` at line 623 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:715 — `debug` at line 715 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:774 — `debug` at line 774 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:816 — `debug` at line 816 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:967 — `info` at line 967 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:974 — `debug` at line 974 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:983 — `debug` at line 983 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:987 — `info` at line 987 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1059 — `debug` at line 1059 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1119 — `debug` at line 1119 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1130 — `debug` at line 1130 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1134 — `debug` at line 1134 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1149 — `debug` at line 1149 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1165 — `debug` at line 1165 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1177 — `debug` at line 1177 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1194 — `debug` at line 1194 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging swoole-gbs/gbs-beta.php:1206 — `debug` at line 1206 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×24
  • Duplicated predicate CoreW/Business/GB/Gb28181Service.php:1390 — `!$mediaServer || $mediaServer['type'] !== MediaServerType::ZLM` appears character-identically in 2 files — CoreW/Business/GB/Gb28181Service.php, CoreW/Business/Record/Service/Impl/RecordTaskServiceImpl.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php:94 — `!$openResult || $openResult['code'] != 0` appears character-identically in 2 files — CoreW/Business/Devices/Handler/TalkStreamArrivalHandler.php, CoreW/Business/Devices/Service/Impl/VoiceTalkServiceImpl.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Gii/Template/Easy/DaoImplTemplate.php:27 — `!empty($args['scene']) && $args['scene'] === 'make-dao' && substr_count($this->prefix, '\\') > 2` appears character-identically in 2 files — CoreW/Gii/Template/Easy/DaoImplTemplate.php, CoreW/Gii/Template/Easy/DaoInterfaceTemplate.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Gii/Template/Easy/ServiceImplTemplate.php:19 — `!empty($args['scene']) && $args['scene'] === 'make-service' && substr_count($this->prefix, '\\') > 2` appears character-identically in 2 files — CoreW/Gii/Template/Easy/ServiceImplTemplate.php, CoreW/Gii/Template/Easy/ServiceInterfaceTemplate.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Dao/Connection.php:74 — `!is_null($exceptionFunc) && $exceptionFunc($this)` appears character-identically in 2 files — CoreW/Dao/Connection.php, CoreW/Dao/MasterSlaveConnection.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Business/Menu/Service/Impl/MenuServiceImpl.php:164 — `!isset($menuData['menus']) || !is_array($menuData['menus'])` appears character-identically in 2 files — CoreW/Business/Menu/Service/Impl/MenuServiceImpl.php, app/command/MenuCommand.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:1472 — `!isset($this->devices[$deviceId]) || ($device && !$device->registered)` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:1701 — `$channel && ($channel->streaming || $channel->forwardState === 1 || $channel->inviting)` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Exception/ExceptionUtil.php:24 — `$exception instanceof NotFoundExceptionInterface || $exception instanceof NotFoundException` appears character-identically in 2 files — CoreW/Exception/ExceptionUtil.php, support/utils/ExceptionUtil.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Mail/AbstractMail.php:82 — `$fileSize > self::MAX_LOG_SIZE && unlink($logFile)` appears character-identically in 4 files — CoreW/Mail/AbstractMail.php, CoreW/Sdk/AMapSdk/AMapClient.php, CoreW/Sdk/LeChangeSdk/Api.php, CoreW/Sdk/Ys7Sdk/OpenYs7.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:1125 — `$oldCallId === '' && $foundChannelId !== ''` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/Helper.php:77 — `$parts === false || empty($parts['host'])` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/Helper.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:1019 — `$statusCode === 100 || $statusCode === 180` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:1462 — `$username === '' || $realm === '' || $nonce === '' || $response === '' || $uriVal === ''` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/command/Gb28181Server.php:96 — `($handlerConfig['mq_type'] === 'rabbitmq') && !empty($config['rabbitmq'])` appears character-identically in 2 files — app/command/Gb28181Server.php, 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 CoreW/Business/User/Service/Impl/TokenServiceImpl.php:57 — `($token['expiredTime'] > 0) && ($token['expiredTime'] < time())` appears character-identically in 2 files — CoreW/Business/User/Service/Impl/TokenServiceImpl.php, CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Business/User/Service/Impl/TokenServiceImpl.php:109 — `($token['times'] > 0) && ($token['remainedTimes'] <= 1)` appears character-identically in 2 files — CoreW/Business/User/Service/Impl/TokenServiceImpl.php, CoreW/Business/VIP/Service/Impl/TokenServiceImpl.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:2072 — `adminHost && !isset($oldChannelMap[$chId])` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php:465 — `empty($config['event_catalog']) && empty($config['event_alarm']) && empty($config['event_mobile_position'])` appears character-identically in 2 files — CoreW/Business/Subscribe/Service/Impl/SubscribeServiceImpl.php, app/admin/controller/GB28181SubscribeController.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:345 — `empty($file) || empty($file['filepath'])` appears character-identically in 3 files — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php, CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php, CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/JsonLogger.php:22 — `isset($_SERVER['TRACE_ID']) && $_SERVER['TRACE_ID']` appears character-identically in 2 files — CoreW/JsonLogger.php, CoreW/Mail/Logger/JsonLogger.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:2595 — `isset($allocatedRtpPort) && $allocatedRtpPort > 0` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Gb28181Gateway/src/SwooleServer/GBS.php:798 — `str_contains($body, '<Response>') || str_contains($body, '<Item>')` appears character-identically in 2 files — Gb28181Gateway/src/SwooleServer/GBS.php, swoole-gbs/gbs-beta.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php:277 — `stristr($heads[0], "200") && stristr($heads[0], "OK")` appears character-identically in 4 files — CoreW/Business/Attachment/Implementors/Impl/AliFileImplementor.php, CoreW/Business/Attachment/Implementors/Impl/LocalFileImplementor.php, CoreW/Business/Attachment/Implementors/Impl/QiNiuFileImplementor.php, CoreW/Business/Attachment/Implementors/Impl/TenCentFileImplementor.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
AX6 · Interface segregation · Fat interface · ×12
  • Fat interface: AttachmentService (17 methods) CoreW/Business/Attachment/Service/AttachmentService.php:8 — `AttachmentService` declares 17 methods: `getAttachmentById`, `getAttachmentByHashId`, `countAttachments`, `searchAttachments`, `updateAttachment`, `deleteAttachmentById`, `unlinkFile`, `deleteFilesByIds`, `uploadFile`, `uploadFiles`, `uploadBase64Image`, `uploadRemoteFile`, `getChunkFilesByHashID`, `uploadSnippet`, `mergeSnippetFile`, `mergeTmpFile`, `moveGroup`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: VoiceSessionDao (17 methods) CoreW/Business/Devices/Dao/VoiceSessionDao.php:7 — `VoiceSessionDao` declares 17 methods: `getBySessionId`, `getByDeviceAndChannel`, `getByDialogId`, `getByStream`, `getByStreamAndMediaServerId`, `getByNoEndedStreamAndMediaServerId`, `updStatus`, `updateStatusBySessionId`, `getByCallId`, `getActiveSessions`, `getActiveByDeviceAndChannel`, `findActiveByDeviceChannelAndMode`, `getBySsrc`, `updStatusIf`, `findExpiredSessions`, `markAsEnded`, `endSession`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: DeviceService (58 methods) CoreW/Business/Devices/Service/DeviceService.php:5 — `DeviceService` declares 58 methods: `getDevicesById`, `getDeviceByDeviceId`, `countDevices`, `searchDevices`, `findDevicesByDeviceIds`, `summaryDevices`, `createDevice`, `updateDevice`, `updateDeviceExtendInfo`, `deleteDeviceById`, `handleDeviceRegister`, `updateDeviceHeartbeat`, `updateDeviceStatus`, `getChannelById`, `getChannelByDeviceAndChannel`, `countChannels`, `searchChannels`, `getChannelsByDeviceId`, `createChannel`, `updateChannel`, `updateChannelByMainId`, `batchUpdateChannels`, `batchUpdateOrCreateChannels`, `deleteChannel`, `getSessionById`, `getSessionByCallId`, `getSessionBySsrc`, `getSessionByStreamId`, `getActiveSessionByStreamIdAndType`, `incrementSessionViewerCount`, `decrementSessionViewerCount`, `casDecrementSessionViewerCount`, `createSession`, `updateSession`, `updateSessionByCallId`, `updateSessionBySSRC`, `deleteSession`, `deleteSessionByCallId`, `deleteSessionByStreamIdAndMediaServerId`, `cleanupExpiredSessions`, and 18 more. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: LiveProvider (18 methods) CoreW/Business/LiveProvider/Strategy/LiveProvider.php:14 — `LiveProvider` declares 18 methods: `activeAndOpenLiveWithCameras`, `openLiveWithCameras`, `closeLiveWithCameras`, `deviceTrees`, `countVideoChannels`, `countRecorders`, `searchRecorders`, `searchCameras`, `getDevices`, `getCameras`, `getLiveUrl`, `getCamera`, `getVideoRecorder`, `devicePtzStart`, `devicePtzStp`, `stopLive`, `getVideoCover`, `getAccessToken`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: MediaServerService (16 methods) CoreW/Business/MediaServer/Service/MediaServerService.php:7 — `MediaServerService` declares 16 methods: `getMediaServerById`, `getMediaServerByServerId`, `findServersByIds`, `findServersByServerIds`, `countMediaServers`, `searchMediaServers`, `getSimpleList`, `createMediaServer`, `updateMediaServer`, `deleteMediaServerById`, `getStats`, `getConfig`, `setConfig`, `restart`, `syncStatus`, `getStrategy`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ProductService (41 methods) CoreW/Business/Product/Service/ProductService.php:9 — `ProductService` declares 41 methods: `getProductById`, `getProductByCode`, `countProducts`, `searchProducts`, `createProduct`, `updateProduct`, `closeProduct`, `publishProduct`, `deleteProduct`, `typeList`, `getSceneUploadConfig`, `updateSceneByProductAndIndex`, `addScene`, `updateScene`, `deleteScene`, `updateSceneSortNum`, `getScene`, `searchScenes`, `setProductCover`, `makeHotPoint`, `deleteHotPoint`, `deleteHotPointBySceneId`, `getHotpointByUUID`, `searchHotPoints`, `getProductTour`, `setProductTour`, `getProductTourNodes`, `setProductTourNodes`, `deleteProductTour`, `savePlaneGraphMarkers`, `getPlaneGraphByProductId`, `setProductLogo`, `geProductLogo`, `setProductConfig`, `getProductConfigs`, `getProductConfig`, `validateViewPwd`, `makeShareUrl`, `checkShareToken`, `increaseViewCount`, and 1 more. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: RecordTaskService (21 methods) CoreW/Business/Record/Service/RecordTaskService.php:5 — `RecordTaskService` declares 21 methods: `createAlarmRecordTask`, `createDownloadRecordTask`, `executeRecordTask`, `stopRecording`, `searchRecordTasks`, `countRecordTasks`, `processPendingTasks`, `stopExpiredRecordings`, `updateTaskStatusWhenMediaReady`, `startRecordingForStableRtp`, `stopCompletedRecordings`, `completeFinalizingTasks`, `getValidityDownloadTaskByStreamId`, `getDoneRecordTaskByStreamId`, `getByStreamId`, `deleteRecordTask`, `cancelRecordTask`, `updateRecordStartTimeByStreamId`, `updateRecordEndTimeByStreamId`, `updateLastRtpTime`, `completeTaskFromHook`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: SipGatewayService (16 methods) CoreW/Business/SipGateway/Service/SipGatewayService.php:5 — `SipGatewayService` declares 16 methods: `createGateway`, `updateGateway`, `deleteGateway`, `getGateway`, `getGatewayByGatewayId`, `searchGateways`, `countGateways`, `toggleGateway`, `getGatewayFullConfig`, `updateHeartbeat`, `checkOfflineGateways`, `bindDeviceToGateway`, `bindDevicesToGateway`, `unbindDeviceFromGateway`, `unbindDevicesFromGateway`, `registerGateway`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: StreamProxyService (27 methods) CoreW/Business/StreamProxy/Service/StreamProxyService.php:5 — `StreamProxyService` declares 27 methods: `createProxy`, `updateProxy`, `deleteProxy`, `getProxy`, `getProxyByProxyId`, `searchProxies`, `countProxies`, `startProxy`, `stopProxy`, `restartProxy`, `getPlayUrls`, `getPushUrl`, `updateStatus`, `healthCheck`, `batchHealthCheck`, `autoReconnect`, `bindRecordPlan`, `unbindRecordPlan`, `updateViewerCount`, `incrementRetryCount`, `resetRetryCount`, `syncPushStreamStatus`, `addLog`, `getProxyLogs`, `searchLogs`, `countLogs`, `cleanupOldLogs`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: UserDao (21 methods) CoreW/Business/User/Dao/UserDao.php:7 — `UserDao` declares 21 methods: `getByEmail`, `getUserByType`, `getByNickname`, `getByApiKey`, `getUnDestroyedUserByNickname`, `getUnDestroyedUserByNickNameOrVerifiedMobile`, `getByUUID`, `countByMobileNotEmpty`, `getByVerifiedMobile`, `countByLessThanCreatedTime`, `findUnDestroyedUsersByIds`, `findByNicknames`, `findByIds`, `getByInviteCode`, `waveCounterById`, `deleteCounterById`, `analysisRegisterDataByTime`, `searchUsersJoinUserFace`, `countUsersJoinUserFace`, `findUnLockedUsersByUserIds`, `findUserLikeNickname`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: UserService (55 methods) CoreW/Business/User/Service/UserService.php:5 — `UserService` declares 55 methods: `getUser`, `getUserByUUID`, `initSystemUsers`, `countUsers`, `searchUsers`, `deleteUserBindByUserId`, `findUserLikeNickname`, `getSimpleUser`, `getUserByNickname`, `getUserByApiKey`, `getUserByLoginField`, `getUserByEmail`, `findUsersByIds`, `findUnDestroyedUsersByIds`, `setEmailVerified`, `changeEmail`, `isNicknameAvaliable`, `isEmailAvaliable`, `isMobileAvaliable`, `changePassword`, `isMobileUnique`, `verifyInSaltOut`, `verifyPasswordById`, `verifyPasswordByUser`, `getUserByType`, `generateNickname`, `generateEmail`, `changeUserRoles`, `makeToken`, `getToken`, `countTokens`, `deleteToken`, `findBindsByUserId`, `unBindUserByTypeAndToId`, `getUserBindByTypeAndFromId`, `findUserBindByTypeAndFromIds`, `findUserBindByTypeAndToIds`, `getUserBindByToken`, `getUserBindByTypeAndUserId`, `findUserBindByTypeAndUserId`, and 15 more. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: VIPService (38 methods) CoreW/Business/VIP/Service/VIPService.php:7 — `VIPService` declares 38 methods: `getVIPById`, `countVIPs`, `searchVIPs`, `createVIP`, `updateVIP`, `editVIPInfo`, `deleteVIPById`, `register`, `createSystemVIP`, `makeAuthToken`, `emailVerify`, `sendEmailVerifyNotification`, `destroyToken`, `login`, `getVIPByUUID`, `getVIPByNickname`, `sendAccountEmailLoginCode`, `deleteUserBindByUserId`, `getUserBindByTypeAndFromId`, `unBindUserByTypeAndToId`, `findBindsByUserId`, `findUserBindByTypeAndFromIds`, `findUserBindByTypeAndToIds`, `getUserBindByToken`, `getUserBindByTypeAndUserId`, `findUserBindByTypeAndUserId`, `bindVIP`, `addUsedSpaceSize`, `subUsedSpaceSize`, `applyCompany`, `getVIPCompany`, `getVIPCompanyByUserId`, `checkCompany`, `setCompanyIotConfig`, `getCompanyIotConfig`, `searchCompanyList`, `getCompanyIotConfigByUserId`, `getCompanyIotConfigByAppId`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×6
  • Diagnostic log message is built whether or not it is wanted swoole-gbs/gbs-beta.php:1338 — `debug` at line 1338 is called with an argument built by `json_encode($addr)` (line 1338), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on.
  • Diagnostic log message is built whether or not it is wanted swoole-gbs/gbs-beta.php:1340 — `debug` at line 1340 is called with an argument built by `json_encode($addr)` (line 1340), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on.
  • Diagnostic log message is built whether or not it is wanted swoole-gbs/gbs-beta.php:1809 — `debug` at line 1809 is called with an argument built by `json_encode($authParams)` (line 1809), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on.
  • Diagnostic log message is built whether or not it is wanted Gb28181Gateway/src/SwooleServer/GBS.php:993 — `debug` at line 993 is called with an argument built by `json_encode($addr)` (line 993), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on.
  • Diagnostic log message is built whether or not it is wanted Gb28181Gateway/src/SwooleServer/GBS.php:995 — `debug` at line 995 is called with an argument built by `json_encode($addr)` (line 995), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on.
  • Diagnostic log message is built whether or not it is wanted Gb28181Gateway/src/SwooleServer/GBS.php:1464 — `debug` at line 1464 is called with an argument built by `json_encode($authParams)` (line 1464), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×6
  • Hand-rolled JSON/XML parsing via regex swoole-gbs/gbs-beta.php:1038 — 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 swoole-gbs/gbs-beta.php:1145 — 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 swoole-gbs/gbs-beta.php:1269 — 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 Gb28181Gateway/src/SwooleServer/GBS.php:693 — 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 Gb28181Gateway/src/SwooleServer/GBS.php:800 — 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 Gb28181Gateway/src/SwooleServer/GBS.php:924 — 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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×6
  • Silent fallback default in catch CoreW/Business/Devices/Traits/GB28181StreamTrait.php:453 — `getPlayUrlsCore` 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 CoreW/Business/GB/Gb28181Service.php:46 — `getMediaList` 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 CoreW/Business/GB/Gb28181Service.php:65 — `getMediaPlayerList` 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 CoreW/Dao/GeneralDaoImpl.php:89 — `increment` 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 CoreW/Dao/GeneralDaoImpl.php:99 — `decrement` 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 support/utils/DeviceToolkit.php:135 — `getBrowse` 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.
D28 · Secrets (history) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found composer.json:3 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `composer.json` makes this repository a deployable product (line 3).
D28 · Secrets (history) · Rotate the exposed credentials · ×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.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift README.md:536 — README.md links to `www.easygbs.com`, but `www.easygbs.com` 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.
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.
P4 · Deployment & Rollback · No rollback/health safety · ×1
  • No rollback/health safety — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
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.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure CoreW/Business/Auth/Handler/JwtManager.php:194 — `verifyToken` returns `-1` when `InvalidArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
Minor — 14 finding(s)
D12 · Dependency Hygiene · Outdated · ×14
  • Outdated: aliyuncs/oss-sdk-php — `aliyuncs/oss-sdk-php` is locked at v2.7.2 but v2.7.3 is the current stable release on Packagist, and it already satisfies the `^2.7` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update aliyuncs/oss-sdk-php` and commit the updated REDACTED.
  • Outdated: imagine/imagine — `imagine/imagine` is locked at 1.3.5 but 1.5.4 is the current stable release on Packagist, and it already satisfies the `^1.3` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update imagine/imagine` and commit the updated REDACTED.
  • Outdated: pimple/pimple — `pimple/pimple` is locked at v3.5.0 but v3.6.2 is the current stable release on Packagist, and it already satisfies the `^3.5` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update pimple/pimple` and commit the updated REDACTED.
  • Outdated: ramsey/uuid — `ramsey/uuid` is locked at 4.2.3 but 4.10.0 is the current stable release on Packagist, and it already satisfies the `^4.2` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update ramsey/uuid` and commit the updated REDACTED.
  • Outdated: symfony/security-acl — `symfony/security-acl` is locked at v3.3.2 but v3.5.0 is the current stable release on Packagist, and it already satisfies the `^3.3` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update symfony/security-acl` and commit the updated REDACTED.
  • Outdated: twig/twig — `twig/twig` is locked at v3.8.0 but v3.30.0 is the current stable release on Packagist, and it already satisfies the `^3.5` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update twig/twig` and commit the updated REDACTED.
  • Outdated: vlucas/phpdotenv — `vlucas/phpdotenv` is locked at v5.5.0 but v5.8.0 is the current stable release on Packagist, and it already satisfies the `^5.4` 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.
  • Outdated: webman/captcha — `webman/captcha` is locked at v1.0.3 but v1.0.5 is the current stable release on Packagist, and it already satisfies the `^1.0` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update webman/captcha` and commit the updated REDACTED.
  • Outdated: webman/log — `webman/log` is locked at v2.1.3 but v2.1.4 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 webman/log` and commit the updated REDACTED.
  • Outdated: webman/redis — `webman/redis` is locked at v2.1.3 but v2.1.5 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 webman/redis` and commit the updated REDACTED.
  • Outdated: workerman/globaldata — `workerman/globaldata` is locked at v1.0.4 but v1.0.6 is the current stable release on Packagist, and it already satisfies the `^1.0` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update workerman/globaldata` and commit the updated REDACTED.
  • Outdated: workerman/validation — `workerman/validation` is locked at v3.0.2 but v3.1.3 is the current stable release on Packagist, and it already satisfies the `^3.0` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update workerman/validation` and commit the updated REDACTED.
  • Outdated: workerman/webman-framework — `workerman/webman-framework` is locked at v2.1.1 but v2.2.5 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 workerman/webman-framework` and commit the updated REDACTED.
  • Outdated: workerman/workerman — `workerman/workerman` is locked at v5.1.6 but v5.2.4 is the current stable release on Packagist, and it already satisfies the `~5.1` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update workerman/workerman` and commit the updated REDACTED.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-382e5f09b9904ace9180b9c88f1df00e/history.json --exit-code 0 --source .63artifacts/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=106" --report-format json --report-path /tmp/watchdog-gitleaks-382e5f09b9904ace9180b9c88f1df00e/history-1.json --exit-code 0 --source .0artifacts/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-382e5f09b9904ace9180b9c88f1df00e/tree.json --exit-code 0 --source .4artifacts/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 .15artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .9artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .3artifacts/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 1 file(s) — `CoreW/Sdk/ZLMediaKit/MediaServer.php` — 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 Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1ea50-2179-7fe5-8199-f8a360802785 · 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