Public report of fecshop/yii2_fecshop, published 20 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 20 October 2026, 22:31 UTC · Survey ID cd_1ee0c29d67934ccfb8983e4bcaf09a82
fecshop/yii2_fecshop
Measured 20 October 2026, 22:27 UTC, at code version 19c5cb8
CAI scoreCritical ⚠
CriticalWeakAdequateStrongExemplary
Down 3 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 217,460 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Production Readiness, 16
Findings by how serious they are
26 critical1468 serious627 minor
22 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
20 October 2026, 22:27 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸
55of 57 dimensions measured by tools. The other 2 are advisory notes from an AI model, which explain the code but don't count towards the score.
2108of 2121 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
57dimensions across 6 lenses, read from 217,460 lines of product code in 1 project.
fecshop/yii2_fecshop scores 25 out of 100 and is rated Critical, while three of its six lenses score higher still: Architecture at 83 and Security and Compliance at 64, both rated Adequate, and Maturity at 46, rated Weak.
The score is lower than those three because the weakest lens counts most, and here that is Production Readiness, which scores 16 and is rated Critical. Its REDACTED Scanning dimension scores 0 out of 10, and until that reaches 4, Production Readiness can't be rated higher than Adequate. The first actions are to resolve the 10 Leaked secret finding(s) in REDACTED Scanning and to give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label, and if Production Readiness rose to 70, the score would rise from 25 to about 33.
26 findings are critical: ten in REDACTED Scanning, nine in Secrets (history) and seven in Forms & labels.
Watchdog couldn't measure 20 dimensions in this code, among them Code Coverage, Test Reliability and Dependency Hygiene, so they are left out of the score. The product code is 217,460 lines, which would take an estimated 1.3 person-years, around €190,000, to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 29 findings
These 29 critical or serious findings were in the previous survey, on 4 October 2026, and are gone from this one.
€62,000 to €310,000, for 1,025 to 3,252 hours of work, about 1.3 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 25. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 217,460 lines of product code
How the estimate is made: Watchdog prices 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 10 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (2), REDACTED.
Raises the score by about 9 points · Medium effort · REDACTED Scanning
2
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Raises the score by about 5 points · Medium effort · Forms & labels
3
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 4 points · Medium effort · CI/CD gates
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 €190,000 to build again, about 1.3 person-years of work. Its weakest lens is Production Readiness, at 16 (Critical). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 10 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 9 points for medium effort, because it clears the 10 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.8 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 7% on every change.
How this is estimated: It rests on an assumption of Watchdog's 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. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4)
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
296 modules, with 232 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 256 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
app.appadmin.modules.Catalog uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog, while a change to app.appadmin.modules.Catalog can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.category uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.category, while a change to app.appadmin.modules.Catalog.block.category can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.category uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.category uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.category, while a change to app.appadmin.modules.Catalog.block.category can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.category uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productattr uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.productattr, while a change to app.appadmin.modules.Catalog.block.productattr can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productattr uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productattr uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.productattr, while a change to app.appadmin.modules.Catalog.block.productattr can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productattr uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productattrgroup uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.productattrgroup, while a change to app.appadmin.modules.Catalog.block.productattrgroup can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productattrgroup uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productattrgroup uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.productattrgroup, while a change to app.appadmin.modules.Catalog.block.productattrgroup can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productattrgroup uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productbrand uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.productbrand, while a change to app.appadmin.modules.Catalog.block.productbrand can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productbrand uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productbrand uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.productbrand, while a change to app.appadmin.modules.Catalog.block.productbrand can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productbrand uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productbrandcategory uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.productbrandcategory, while a change to app.appadmin.modules.Catalog.block.productbrandcategory can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productbrandcategory uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productbrandcategory uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.productbrandcategory, while a change to app.appadmin.modules.Catalog.block.productbrandcategory can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productbrandcategory uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productfavorite uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.productfavorite, while a change to app.appadmin.modules.Catalog.block.productfavorite can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productfavorite uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productfavorite uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.productfavorite, while a change to app.appadmin.modules.Catalog.block.productfavorite can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productfavorite uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productinfo uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.productinfo, while a change to app.appadmin.modules.Catalog.block.productinfo can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productinfo uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productinfo uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.productinfo, while a change to app.appadmin.modules.Catalog.block.productinfo can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productinfo uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productreview uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.productreview, while a change to app.appadmin.modules.Catalog.block.productreview can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productreview uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.productreview uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.productreview, while a change to app.appadmin.modules.Catalog.block.productreview can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.productreview uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.urlrewrite uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Catalog.block.urlrewrite, while a change to app.appadmin.modules.Catalog.block.urlrewrite can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.urlrewrite uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Catalog.block.urlrewrite uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Catalog.block.urlrewrite, while a change to app.appadmin.modules.Catalog.block.urlrewrite can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Catalog.block.urlrewrite uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Cms uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Cms, while a change to app.appadmin.modules.Cms can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Cms uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Cms.block.article uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Cms.block.article, while a change to app.appadmin.modules.Cms.block.article can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Cms.block.article uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Cms.block.article uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Cms.block.article, while a change to app.appadmin.modules.Cms.block.article can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Cms.block.article uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Cms.block.staticblock uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Cms.block.staticblock, while a change to app.appadmin.modules.Cms.block.staticblock can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Cms.block.staticblock uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Cms.block.staticblock uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Cms.block.staticblock, while a change to app.appadmin.modules.Cms.block.staticblock can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Cms.block.staticblock uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config, while a change to app.appadmin.modules.Config can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontaccount uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appfrontaccount, while a change to app.appadmin.modules.Config.block.appfrontaccount can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontaccount uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontaccount uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appfrontaccount, while a change to app.appadmin.modules.Config.block.appfrontaccount can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontaccount uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontbase uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appfrontbase, while a change to app.appadmin.modules.Config.block.appfrontbase can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontbase uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontbase uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appfrontbase, while a change to app.appadmin.modules.Config.block.appfrontbase can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontbase uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontcache uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appfrontcache, while a change to app.appadmin.modules.Config.block.appfrontcache can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontcache uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontcache uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appfrontcache, while a change to app.appadmin.modules.Config.block.appfrontcache can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontcache uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontcatalog uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appfrontcatalog, while a change to app.appadmin.modules.Config.block.appfrontcatalog can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontcatalog uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontcatalog uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appfrontcatalog, while a change to app.appadmin.modules.Config.block.appfrontcatalog can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontcatalog uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfronthome uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appfronthome, while a change to app.appadmin.modules.Config.block.appfronthome can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfronthome uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfronthome uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appfronthome, while a change to app.appadmin.modules.Config.block.appfronthome can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfronthome uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontpayment uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appfrontpayment, while a change to app.appadmin.modules.Config.block.appfrontpayment can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontpayment uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontpayment uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appfrontpayment, while a change to app.appadmin.modules.Config.block.appfrontpayment can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontpayment uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontstore uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appfrontstore, while a change to app.appadmin.modules.Config.block.appfrontstore can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontstore uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appfrontstore uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appfrontstore, while a change to app.appadmin.modules.Config.block.appfrontstore can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appfrontstore uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5account uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.apphtml5account, while a change to app.appadmin.modules.Config.block.apphtml5account can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5account uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5account uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.apphtml5account, while a change to app.appadmin.modules.Config.block.apphtml5account can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5account uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5base uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.apphtml5base, while a change to app.appadmin.modules.Config.block.apphtml5base can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5base uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5base uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.apphtml5base, while a change to app.appadmin.modules.Config.block.apphtml5base can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5base uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5cache uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.apphtml5cache, while a change to app.appadmin.modules.Config.block.apphtml5cache can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5cache uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5cache uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.apphtml5cache, while a change to app.appadmin.modules.Config.block.apphtml5cache can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5cache uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5catalog uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.apphtml5catalog, while a change to app.appadmin.modules.Config.block.apphtml5catalog can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5catalog uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5catalog uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.apphtml5catalog, while a change to app.appadmin.modules.Config.block.apphtml5catalog can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5catalog uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5home uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.apphtml5home, while a change to app.appadmin.modules.Config.block.apphtml5home can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5home uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5home uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.apphtml5home, while a change to app.appadmin.modules.Config.block.apphtml5home can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5home uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5payment uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.apphtml5payment, while a change to app.appadmin.modules.Config.block.apphtml5payment can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5payment uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5payment uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.apphtml5payment, while a change to app.appadmin.modules.Config.block.apphtml5payment can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5payment uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5store uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.apphtml5store, while a change to app.appadmin.modules.Config.block.apphtml5store can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5store uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.apphtml5store uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.apphtml5store, while a change to app.appadmin.modules.Config.block.apphtml5store can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.apphtml5store uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appserveraccount uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appserveraccount, while a change to app.appadmin.modules.Config.block.appserveraccount can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appserveraccount uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appserveraccount uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appserveraccount, while a change to app.appadmin.modules.Config.block.appserveraccount can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appserveraccount uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appserverbase uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appserverbase, while a change to app.appadmin.modules.Config.block.appserverbase can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appserverbase uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appserverbase uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appserverbase, while a change to app.appadmin.modules.Config.block.appserverbase can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appserverbase uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appservercache uses app.appadmin.interfaces.base, so a change to app.appadmin.interfaces.base can break app.appadmin.modules.Config.block.appservercache, while a change to app.appadmin.modules.Config.block.appservercache can't break app.appadmin.interfaces.base.
Position
Below the diagonal: app.appadmin.modules.Config.block.appservercache uses a module listed above it, which is the healthy direction.
app.appadmin.modules.Config.block.appservercache uses app.appadmin.modules, so a change to app.appadmin.modules can break app.appadmin.modules.Config.block.appservercache, while a change to app.appadmin.modules.Config.block.appservercache can't break app.appadmin.modules.
Position
Below the diagonal: app.appadmin.modules.Config.block.appservercache uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 25% · Critical · gated by D1, R1, R2, R3, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A07:2025 — Authentication Failures
20
High / Critical
A05:2025 — Injection
6
Medium
A01:2025 — Broken Access Control
1
Medium
A02:2025 — Security Misconfiguration
1
Medium
Roadmap
Immediately resolve the ten leaked secrets, prioritizing REDACTED, REDACTED, and the migration file, while ensuring all form controls and buttons have proper programmatic labels. Establish a CI pipeline that builds and tests on every push, integrating static analysis and secret scanning to fail the build on security regressions. Finally, enforce accessibility standards by adding assertions to the test suite and gating them in CI to prevent future regressions.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 10 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (2), REDACTED.
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.
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
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.
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.
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 — 26
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 — 1468
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 — 627
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 22
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 55 of 57 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 2 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 57 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2108 of 2121 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.php) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.php) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 9 direct Composer requirement(s) were read, but the outdated signal needs Packagist, and no committed composer.lock resolves them to releases, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — this repository declares a composer.json but commits no composer.lock this pass can read, so the set of packages it installs is not on disk: its composer.json states version CONSTRAINTS, and Composer's guidance is that a library leaves the lock uncommitted. Producing the graph needs Composer's solver, which this pass does not run, and grading whichever release happens to be newest today would be a verdict about a dependency graph nobody resolved. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (composer.json), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
AC6 Visual & motion safety — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex').
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is Yii's 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.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 1 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's PHP is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's PHP is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M3 Folder & project structure — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Whether the tests sit apart from production code is not visible here, because the suite is not in a form this pass reads. The test-separation credit is granted rather than withheld: this is a gap in the analyzer's language coverage, not a finding about the repository's tests. You can widen what we reach: keep the test surface somewhere a reader can find it without opening a binary — an exported/checked-in test source tree beside the production code makes the suite reviewable, diffable and discoverable by tooling.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These 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.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin 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.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
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").
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.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
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.
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.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (2): D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
160 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was sm-extend.Swiper at 688. A further 2 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 handleEvent at 29 — they are counted neither in the figure above nor in this dimension's score.
+ 105 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with sm-extend.Swiper (cyclomatic 688), sm.Calendar (cyclomatic 291), sm-extend.PhotoBrowser (cyclomatic 150). — 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 Cyclomatic Complexity from 4.0 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Stand up a CI pipeline, then gate Cyclomatic Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 281 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 8 bodies over 120 down to 120 or less in Cognitive Complexity — start with sm-extend.Swiper (cognitive 210), Managerbatchedit.initParamType (cognitive 163), Manageredit.initParamType (cognitive 163). — 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 8 together lifts Cognitive Complexity from 5.2 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Stand up a CI pipeline, then gate Cognitive Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 29 TooManyMethods finding(s) in God Classes — start with WxPay.Data.php (4), AlipaySecurityRiskDetectRequest.php, AlipayAcquireCreateandpayRequest.php. — One of this dimension's main actionable groups (29 warning-level).
Resolve the 15 MethodTooLong finding(s) in God Classes — start with Manager.php (4), Page.php (2), Manageredit.php (2). — One of this dimension's main actionable groups (15 warning-level).
Resolve the 11 FileTooLong finding(s) in God Classes — start with REDACTED, sm-extend.js, jquery.fancybox.js. — One of this dimension's main actionable groups (11 warning-level).
Stand up a CI pipeline, then gate God Classes in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
719 duplicated block group(s) detected. A further 92 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
Members sharing a duplicated core (4 members, 50+ identical tokens) · ×21app/appadmin/modules/Config/block/appserverstorelang/Manager.php:31
+ 316 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 25 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with Index.php (4), ProductMongodb.php (3), Role.php (2). — One of this dimension's main actionable groups (25 warning-level).
Resolve the 24 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with Managerbatchedit.php (8), AppadminbaseBlock.php (3), Index.php (2). — One of this dimension's main actionable groups (24 warning-level).
Resolve the 23 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with Manager.php (4), Index.php (2), CategoryMongodb.php (2). — One of this dimension's main actionable groups (23 warning-level).
Stand up a CI pipeline, then gate Code Duplication in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with REDACTED, Url.php, Extension.php. — One of this dimension's main actionable groups (5 warning-level).
Stand up a CI pipeline, then gate Cohesion (LCOM4) in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 10 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (10 issue-level).
Stand up a CI pipeline, then gate REDACTED Scanning in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
1 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is services/Cart.php. Counted over 173 of the 1775 production source files in this repository: 1188 are under the ~2,400-byte size floor this dimension measures over, and the remaining 414 have no attributable history left to measure.
Off-boarding risk: anonymized user #1
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
4 deducted task-comment markers across 217460 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 4 TodoComment finding(s) in Explicit Debt — start with AlipayMobilePublicMultiMediaClient.php (2), download.php, WxPay.Notify.php. — One of this dimension's main actionable groups (4 warning-level).
Stand up a CI pipeline, then gate Explicit Debt in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
1 of 1 build units (Composer) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
9 finding(s): 0 critical, 9 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 9 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (9 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
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.
Do you agree with this assessment?
D32 · Data Compliance (PII/GDPR)9.0 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.
Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using Watchdog's own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.
Resolve the 1 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d32_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
586 of 587 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is app/appfront/theme/base/front/layouts/wxpay_start.php. Counted over 587 of the 1775 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Most significant orphaned file · ×3app/appfront/theme/base/front/layouts/wxpay_start.php:1
Concentrated knowledge decay
What to do
Resolve the 583 Orphaned file finding(s) in Knowledge Freshness — start with Manager.php (49), Index.php (37), index.php (28). — One of this dimension's main actionable groups (583 recommendation-level).
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with wxpay_start.php, MobileDetect.php, ProductMysqldb.php. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Concentrated knowledge decay finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 9 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels1.0 / 10Critical✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — REDACTED:1340
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×2) — REDACTED:1365, REDACTED:1392
A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×4) — REDACTED:1730, REDACTED:1732, REDACTED:1737, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Maturity · Maturity — Whether the repo and its projects have a REDACTED, and whether it's substantive and current.
Method: Filesystem scan: REDACTED presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root REDACTED — the first thing a newcomer needs.
Explain in the REDACTED how to run the tests. Add a section called Testing to the REDACTED in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root REDACTED — the high-level shape.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the REDACTED, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the REDACTED actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: REDACTED accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Do you agree with this assessment?
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.
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.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`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) — REDACTED:231, lib/google/lib/io/Google_IO.php:557, lib/google/lib/io/Google_IO.php:564
What to do
Give every client an explicit bound: `new Client(['timeout' => 10, 'connect_timeout' => 3])` for Guzzle (whose default is to wait forever), `CURLOPT_TIMEOUT`/`CURLOPT_CONNECTTIMEOUT` before `curl_exec`, `timeout`/`max_duration` on Symfony HttpClient (or `framework.http_client.default_options`), and a stream-context `timeout` or `connection_timeout` for `file_get_contents`/`SoapClient`. In Drupal, use the `http_client` service, which carries core's site-wide timeout, rather than `new Client()`. Add retries with back-off (Guzzle `Middleware::retry`, Symfony `RetryableHttpClient`, Laravel `->retry()`) around dependencies that fail.
Readiness · 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.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 8 plain JS — the untyped files are app/appadmin/theme/base/default/assets/js/appadmin.js, app/appadmin/theme/base/default/assets/js/jquery-editable-select.js, app/appfront/theme/base/front/assets/js/js.js, app/appfront/theme/base/front/assets/js/owl.carousel.js, app/apphtml5/theme/base/html5/assets/js/fec.js, app/apphtml5/theme/base/html5/assets/js/sm-city-picker.js (+2 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
REDACTED:1863 · REDACTED:1976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:1863
REDACTED:2721 · REDACTED:3352 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2721
app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1493 · REDACTED:96 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1493
REDACTED:1352 · REDACTED:1379 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:1352
REDACTED:5254 · REDACTED:5394 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:5254
app/apphtml5/theme/base/html5/assets/js/sm-extend.js:652 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:690 — the two spans are one implementation copied and then locally edited — 153 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:652
REDACTED:5589 · REDACTED:5613 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:5589
REDACTED:5648 · REDACTED:5667 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:5648
REDACTED:2824 · REDACTED:3437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:2824
app/appadmin/theme/base/default/assets/js/appadmin.js:1 · app/appfront/theme/base/front/assets/js/js.js:79 · app/apphtml5/theme/base/html5/assets/js/fec.js:7 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — app/appadmin/theme/base/default/assets/js/appadmin.js:1
app/appfront/theme/base/front/assets/js/js.js:79 · app/apphtml5/theme/base/html5/assets/js/fec.js:7 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — app/appfront/theme/base/front/assets/js/js.js:79
REDACTED:2464 · REDACTED:2544 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2464
REDACTED:2766 · REDACTED:3398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:2766
REDACTED:4637 · REDACTED:4654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:4637
REDACTED:7625 · REDACTED:7652 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:7625
REDACTED:238 · REDACTED:252 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:238
REDACTED:2894 · REDACTED:3479 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2894
REDACTED:7141 · REDACTED:7325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:7141
REDACTED:1314 · REDACTED:1329 · REDACTED:1354 · REDACTED:1381 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:1314
REDACTED:2484 · REDACTED:2582 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2484
REDACTED:2531 · REDACTED:2570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:2531
REDACTED:5754 · REDACTED:5765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:5754
REDACTED:5883 · REDACTED:5895 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:5883
app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1641 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1662 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1641
app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1817 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1817
REDACTED:521 · REDACTED:1140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:521
REDACTED:4815 · REDACTED:4967 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:4815
REDACTED:5567 · REDACTED:5578 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:5567
app/apphtml5/theme/base/html5/assets/js/sm-extend.js:607 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:607
app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2057 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2057
REDACTED:2439 · REDACTED:2497 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2439
app/appfront/theme/base/front/assets/js/owl.carousel.js:125 · app/appfront/theme/base/front/assets/js/owl.carousel.js:157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/appfront/theme/base/front/assets/js/owl.carousel.js:125
app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1383 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1383
REDACTED:1494 · REDACTED:1522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:1494
REDACTED:2450 · REDACTED:2511 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2450
REDACTED:5942 · REDACTED:6195 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:5942
REDACTED:227 · REDACTED:234 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:227
REDACTED:2157 · REDACTED:2219 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2157
REDACTED:2512 · REDACTED:2551 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2512
REDACTED:2795 · REDACTED:3413 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2795
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
onTouchMove has cyclomatic complexity 62 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:946
onTouchEnd has cyclomatic complexity 57 and cognitive complexity 125; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1096
Swiper has cyclomatic complexity 45 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:15
updateSlidesSize has cyclomatic complexity 40 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:312
handleTouchMove has cyclomatic complexity 40 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:6723
_move has cyclomatic complexity 36 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:4110
_key has cyclomatic complexity 35 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:5125
(anonymous) has cyclomatic complexity 35 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:296
setTranslate has cyclomatic complexity 33 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1754
refresh has cyclomatic complexity 31 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:5556
PhotoBrowser has cyclomatic complexity 31 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2769
monthHTML has cyclomatic complexity 28 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:2261
handleTouchMove has cyclomatic complexity 28 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:6345
setYearMonth has cyclomatic complexity 27 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:2595
_end has cyclomatic complexity 27 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:4213
onSlideTouchMove has cyclomatic complexity 27 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:3158
handleTouchEnd has cyclomatic complexity 26 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:6825
init has cyclomatic complexity 26 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2368
setTranslate has cyclomatic complexity 25 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1861
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
app/apphtml5/theme/base/html5/assets/js/sm-city-picker.js has 13351 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/apphtml5/theme/base/html5/assets/js/sm-city-picker.js:1
REDACTED has 7022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
app/apphtml5/theme/base/html5/assets/js/sm-extend.js has 3127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1
app/appfront/theme/base/front/assets/js/owl.carousel.js has 1310 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/appfront/theme/base/front/assets/js/owl.carousel.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
`getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 218, put back at line 220) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — services/payment/WxpayMicro.php:215
`getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 233, put back at line 235) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — services/payment/WxpayJsApi.php:230
`getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 247, put back at line 249) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — services/payment/WxpayH5.php:244
`getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 239, put back at line 241) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — services/payment/Wxpay.php:236
What to do
Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment variable passed to the operation that needs it (the `cwd` and `env` options of `child_process`, or of `Deno.Command`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional. In PHP the same holds for `chdir`, `putenv`, `setlocale`, `date_default_timezone_set`, `ini_set` and the error-handler stack: pass the value to the operation (`Process` with `cwd`/`env`, an explicit `DateTimeZone`) or restore in a `finally`.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped7.4 / 10Strong✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`modal.trim()` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1483
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — app/appfront/theme/base/front/assets/fancybox/jquery.fancybox.js:1004, app/appfront/theme/base/front/assets/fancybox/jquery.fancybox.js:1239
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether PHP's static analysis checks null and is not undermined by a nullness baseline — PHPStan from level 8 (`checkNullables`) or Psalm at `errorLevel` 3 or stricter is what makes `?User` a type whose method call is an error, and the null entries of a baseline, `@psalm-suppress PossiblyNull…` and `@phpstan-ignore *.nonObject` are what silence it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.
What to do
Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it. Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 3 of 55 WCAG 2.2 Level A/AA success criteria (5%; ≈6% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 52 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'PDO' (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'PDO' (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'PDO' (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 64 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 — No image/media element found in the parsed markup — AC1 not applicable here.
AC3 Page structure — No structural check found in the parsed markup — AC3 not applicable here.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — Not applicable: PHP builds its object graph per request and shares none of it between requests. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: this repository stores data through 'PDO' (lib/alipay/lotusphp_runtime/DB/Adapter/ConnectionAdapter/DbConnectionAdapterPdo.php:38) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route (no Laravel Route::…, no Symfony #[Route], no Filament panel, no WordPress REST route or AJAX action). Access control is therefore N/A here — a Composer library is authorized by the application that mounts it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D10 Test Quality — ~79 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
D12 Dependency Hygiene — Not scored — 9 direct Composer requirement(s) were read, but the outdated signal needs Packagist, and no committed composer.lock resolves them to releases, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — Composer package licences not graded — this repository commits no composer.lock and this pass does not run Composer's solver
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.
D19 Documentation Quality — LLM evaluation failed
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Aggregate roots were found in only one source directory (models), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.php), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).
D5 Coupling — Not applicable — this Composer build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
D9 Test Distribution — Test source is present (.php) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (2 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit))
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 and Scala, 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
P2 Observability — This repository's JavaScript/TypeScript, PHP source (2 module(s), 1925 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for 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 applicable: PHP and TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
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.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — the JS/TS workspace (8 production file(s)) has no JavaScript/TypeScript test, but it is 11.69% of this repository's production source and the other 88.31% carries 79 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
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.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. PHP gives a request one thread of its own; the event-loop libraries (ReactPHP, Amp) run callbacks one at a time, and ext-parallel copies every value across its channels, so no array or collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
AC2 · Forms & labels· Link with no accessible name · ×4
Link with no accessible name REDACTED:1730— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:1732— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:1737— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:1739— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
AC2 · Forms & labels· <input> without a programmatic label · ×3
<input> without a programmatic label REDACTED:1340— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label REDACTED:1365— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label REDACTED:1392— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
TooManyMethods: AlipaySecurityRiskDetectRequest lib/alipay/aop/request/AlipaySecurityRiskDetectRequest.php:8— TooManyMethods — 128 methods. The bar is 30 methods; this is 98 over it, 4.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: AlipayAcquireCreateandpayRequest lib/alipay/aop/request/AlipayAcquireCreateandpayRequest.php:8— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipaySecurityInfoAnalysisRequest lib/alipay/aop/request/AlipaySecurityInfoAnalysisRequest.php:8— 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: WxPayUnifiedOrder lib/wxpay/lib/WxPay.Data.php:281— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipayAcquirePrecreateRequest lib/alipay/aop/request/AlipayAcquirePrecreateRequest.php:8— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Product services/Product.php:32— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipayEbppPdeductSignAddRequest lib/alipay/aop/request/AlipayEbppPdeductSignAddRequest.php:8— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ProductMysqldb services/product/ProductMysqldb.php:22— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WxPayMicroPay lib/wxpay/lib/WxPay.Data.php:2161— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipayEbppBillAddRequest lib/alipay/aop/request/AlipayEbppBillAddRequest.php:8— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipayOpenPublicLifeMsgSendRequest lib/alipay/aop/request/AlipayOpenPublicLifeMsgSendRequest.php:8— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Order services/Order.php:23— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AopClient REDACTED:5— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 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.
TooManyMethods: WxPayReport lib/wxpay/lib/WxPay.Data.php:1677— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.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: Customer services/Customer.php:39— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.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: AlipayEbppPdeductPayRequest lib/alipay/aop/request/AlipayEbppPdeductPayRequest.php:8— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipayTransferThirdpartyBillCreateRequest lib/alipay/aop/request/AlipayTransferThirdpartyBillCreateRequest.php:8— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ProductMongodb services/product/ProductMongodb.php:22— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipayEcapiprodDataPutRequest lib/alipay/aop/request/AlipayEcapiprodDataPutRequest.php:8— 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: AlipayMobileCodeCreateRequest lib/alipay/aop/request/AlipayMobileCodeCreateRequest.php:8— 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: AlipayOpenPublicLifeAccountCreateRequest lib/alipay/aop/request/AlipayOpenPublicLifeAccountCreateRequest.php:8— 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: AlipayUserTradeSearchRequest lib/alipay/aop/request/AlipayUserTradeSearchRequest.php:8— 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: WxPayRefund lib/wxpay/lib/WxPay.Data.php:1006— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MobileDetect services/helper/MobileDetect.php:32— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AlipayAcquireRefundRequest lib/alipay/aop/request/AlipayAcquireRefundRequest.php:8— 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.
Duplicated block (9 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:365— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:365-373 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:364-372 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) app/appapi/modules/V1/controllers/ArticleController.php:125— app/appapi/modules/V1/controllers/ArticleController.php:125-133 | app/appapi/modules/V1/controllers/CategoryController.php:147-155 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/ArticleController.php:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appapi/modules/V1/controllers/ArticleController.php:134` calls `getDefaultLangAttrVal`, `getDefaultLangAttrName` and `app/appapi/modules/V1/controllers/CategoryController.php:155` 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 × 2) app/appapi/modules/V1/controllers/CategoryController.php:38— app/appapi/modules/V1/controllers/CategoryController.php:38-46 | REDACTED:52-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:151— app/appfront/modules/Catalog/block/category/Index.php:151-159 | app/apphtml5/modules/Catalog/block/category/Index.php:172-180 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) app/appfront/modules/Customer/block/address/Edit.php:151— app/appfront/modules/Customer/block/address/Edit.php:151-159 | app/apphtml5/modules/Customer/block/address/Edit.php:144-152 — before extracting anything, compare `app/appfront/modules/Customer/block/address/Edit.php` and `app/apphtml5/modules/Customer/block/address/Edit.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) app/appserver/modules/Checkout/block/onepage/Placeorder.php:51— app/appserver/modules/Checkout/block/onepage/Placeorder.php:51-59 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:52-60 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Placeorder.php` and `app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 250 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) app/appserver/modules/Customer/controllers/OrderController.php:229— app/appserver/modules/Customer/controllers/OrderController.php:229-237 | app/appserver/modules/Customer/controllers/OrderController.php:273-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Customer/controllers/OrderController.php:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) app/appserver/modules/Payment/controllers/Wxpayh5Controller.php:30— app/appserver/modules/Payment/controllers/Wxpayh5Controller.php:30-38 | app/appserver/modules/Payment/controllers/WxpayjsapiController.php:27-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) services/Url.php:445— services/Url.php:445-453 | services/Url.php:457-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) services/admin/Role.php:211— services/admin/Role.php:211-219 | services/admin/UserRole.php:99-107 — before extracting anything, compare `services/admin/Role.php` and `services/admin/UserRole.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 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 `services/admin/Role.php:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/admin/Role.php:221` calls `removeByRoleId` and `services/admin/UserRole.php:108` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) services/admin/Role.php:299— services/admin/Role.php:299-307 | services/admin/Role.php:313-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/admin/Role.php:299` it begins part-way through the construct above it, so those exact lines 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) services/cms/article/ArticleMysqldb.php:214— services/cms/article/ArticleMysqldb.php:214-222 | services/url/rewrite/RewriteMysqldb.php:146-154 — before extracting anything, compare `services/cms/article/ArticleMysqldb.php` and `services/url/rewrite/RewriteMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `services/cms/article/ArticleMysqldb.php:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) services/product/ProductMongodb.php:586— services/product/ProductMongodb.php:586-594 | services/product/ProductMysqldb.php:677-685 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:586` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) services/product/ProductMongodb.php:767— services/product/ProductMongodb.php:767-775 | services/product/ProductMysqldb.php:916-924 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:767` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) services/product/ProductMysqldb.php:191— services/product/ProductMysqldb.php:191-199 | services/product/ProductMysqldb.php:228-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) services/product/Stock.php:215— services/product/Stock.php:215-223 | services/product/Stock.php:313-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/product/Stock.php:215` it begins part-way through the construct above it, so those exact lines 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) services/product/favorite/FavoriteMongodb.php:134— services/product/favorite/FavoriteMongodb.php:134-142 | services/product/favorite/FavoriteMysqldb.php:134-142 — before extracting anything, compare `services/product/favorite/FavoriteMongodb.php` and `services/product/favorite/FavoriteMysqldb.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) services/product/review/ReviewMongodb.php:110— services/product/review/ReviewMongodb.php:110-118 | services/product/review/ReviewMysqldb.php:112-120 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) app/appadmin/modules/Catalog/block/category/Image.php:23— app/appadmin/modules/Catalog/block/category/Image.php:23-31 | app/appadmin/modules/Catalog/block/productbrand/Image.php:23-31 — `app/appadmin/modules/Catalog/block/category/Image.php` and `app/appadmin/modules/Catalog/block/productbrand/Image.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 9 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.
Duplicated block (9 lines × 2) app/appadmin/modules/Config/block/categorysort/Manager.php:63— app/appadmin/modules/Config/block/categorysort/Manager.php:63-71 | app/appadmin/modules/Config/block/mutillang/Manager.php:62-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) app/appfront/modules/Catalogsearch/block/index/Index.php:71— app/appfront/modules/Catalogsearch/block/index/Index.php:71-79 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:78-86 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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) app/appfront/modules/Catalogsearch/block/index/Index.php:190— app/appfront/modules/Catalogsearch/block/index/Index.php:190-198 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:213-221 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) app/appfront/modules/Customer/block/account/Forgotpassword.php:93— app/appfront/modules/Customer/block/account/Forgotpassword.php:93-101 | app/apphtml5/modules/Customer/block/account/Forgotpassword.php:82-90 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Forgotpassword.php` and `app/apphtml5/modules/Customer/block/account/Forgotpassword.php` as WHOLE FILES: this scan already matched 4 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 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) app/apphtml5/modules/Catalog/block/category/Index.php:126— app/apphtml5/modules/Catalog/block/category/Index.php:126-134 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:94-102 — before extracting anything, compare `app/apphtml5/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 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) services/product/ProductMongodb.php:1404— services/product/ProductMongodb.php:1404-1412 | services/product/ProductMysqldb.php:1610-1618 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) app/appadmin/modules/AppadminbaseBlock.php:327— app/appadmin/modules/AppadminbaseBlock.php:327-333 | app/appadmin/modules/Catalog/block/category/Product.php:224-229 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:327` it does not close everything it opens, so those exact lines 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/appadmin/modules/AppadminbaseBlock.php:423— app/appadmin/modules/AppadminbaseBlock.php:423-428 | app/appadmin/modules/Catalog/block/category/Product.php:89-94 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) app/appadmin/modules/AppadminbaseBlock.php:467— app/appadmin/modules/AppadminbaseBlock.php:467-472 | app/appadmin/modules/System/block/error/Index.php:276-281 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/System/block/error/Index.php` as WHOLE FILES: this scan already matched 6 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:467` it begins part-way through the construct above it, so those exact lines 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/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:161— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:161-166 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:160-165 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:355— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:355-360 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:354-359 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:355` it begins part-way through the construct above it, so those exact lines 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/appadmin/modules/Fecadmin/block/log/Index.php:191— app/appadmin/modules/Fecadmin/block/log/Index.php:191-196 | app/appadmin/modules/Fecadmin/block/logtj/Index.php:232-237 — `app/appadmin/modules/Fecadmin/block/log/Index.php` and `app/appadmin/modules/Fecadmin/block/logtj/Index.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 5 separate duplicated blocks between them, totalling at least 72 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.
Duplicated block (6 lines × 2) app/appapi/modules/V1/controllers/CategoryController.php:291— app/appapi/modules/V1/controllers/CategoryController.php:291-296 | app/appapi/modules/V1/controllers/CategoryController.php:392-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/appserver/modules/Customer/controllers/ForgotController.php:153— app/appserver/modules/Customer/controllers/ForgotController.php:153-158 | app/appserver/modules/Customer/controllers/LoginController.php:41-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appserver/modules/Customer/controllers/LoginController.php:40` calls `post` and `app/appserver/modules/Customer/controllers/ForgotController.php:151` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) services/Order.php:643— services/Order.php:643-648 | services/Order.php:668-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) services/url/rewrite/RewriteMongodb.php:128— services/url/rewrite/RewriteMongodb.php:128-133 | services/url/rewrite/RewriteMysqldb.php:154-159 — before extracting anything, compare `services/url/rewrite/RewriteMongodb.php` and `services/url/rewrite/RewriteMysqldb.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 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 `services/url/rewrite/RewriteMongodb.php:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:171— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:171-176 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:170-175 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:181— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:181-186 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:181-186 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:191— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:191-196 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:191-196 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:201— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:201-206 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:201-206 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:211— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:211-216 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:211-216 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:221— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:221-226 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:221-226 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) app/appfront/modules/Customer/block/address/Edit.php:141— app/appfront/modules/Customer/block/address/Edit.php:141-146 | app/apphtml5/modules/Customer/block/address/Edit.php:134-139 — before extracting anything, compare `app/appfront/modules/Customer/block/address/Edit.php` and `app/apphtml5/modules/Customer/block/address/Edit.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) app/appfront/modules/Customer/controllers/AccountController.php:174— app/appfront/modules/Customer/controllers/AccountController.php:174-179 | app/apphtml5/modules/Customer/controllers/AccountController.php:187-192 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AccountController.php` and `app/apphtml5/modules/Customer/controllers/AccountController.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 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 (6 lines × 2) lib/wxpay/lib/WxPay.Api.php:434— lib/wxpay/lib/WxPay.Api.php:434-439 | services/Helper.php:151-157 — 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 (6 lines × 2) services/product/ProductMongodb.php:1198— services/product/ProductMongodb.php:1198-1203 | services/product/ProductMysqldb.php:1400-1405 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) app/appserver/modules/Payment/controllers/paypal/ExpressController.php:45— app/appserver/modules/Payment/controllers/paypal/ExpressController.php:45-50 | app/appserver/modules/Payment/controllers/paypal/StandardController.php:42-48 — 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/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:38— app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:38-43 | app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:58-63 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:63` calls `getMenuStrChild` and `app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:43` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) app/appfront/modules/Customer/block/editaccount/Index.php:48— app/appfront/modules/Customer/block/editaccount/Index.php:48-53 | app/apphtml5/modules/Customer/block/editaccount/Index.php:38-43 — before extracting anything, compare `app/appfront/modules/Customer/block/editaccount/Index.php` and `app/apphtml5/modules/Customer/block/editaccount/Index.php` as WHOLE FILES: 98% 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/editaccount/Index.php:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) services/Order.php:780— services/Order.php:780-785 | services/Order.php:831-836 — both copies are in the same file, so extract the 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/appadmin/modules/Catalog/block/categoryupload/Manager.php:44— app/appadmin/modules/Catalog/block/categoryupload/Manager.php:44-53 | app/appadmin/modules/Catalog/block/productupload/Manager.php:33-42 — `app/appadmin/modules/Catalog/block/categoryupload/Manager.php` and `app/appadmin/modules/Catalog/block/productupload/Manager.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 3 separate duplicated blocks between them, totalling at least 32 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/appadmin/modules/Catalog/block/categoryupload/Manager.php:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/appadmin/modules/Fecadmin/block/cache/Index.php:116— app/appadmin/modules/Fecadmin/block/cache/Index.php:116-125 | app/appadmin/modules/Fecadmin/block/cache/Index.php:172-181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Fecadmin/block/cache/Index.php:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/appfront/modules/Catalog/controllers/ReviewproductController.php:52— app/appfront/modules/Catalog/controllers/ReviewproductController.php:52-61 | app/apphtml5/modules/Catalog/controllers/ReviewproductController.php:50-59 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/ReviewproductController.php` and `app/apphtml5/modules/Catalog/controllers/ReviewproductController.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 3 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 `app/appfront/modules/Catalog/controllers/ReviewproductController.php:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appfront/modules/Catalog/controllers/ReviewproductController.php:50` calls `htmlEncode` and `app/apphtml5/modules/Catalog/controllers/ReviewproductController.php:49` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) app/appfront/modules/Customer/block/newsletter/Index.php:30— app/appfront/modules/Customer/block/newsletter/Index.php:30-39 | app/apphtml5/modules/Customer/block/newsletter/Index.php:29-38 — before extracting anything, compare `app/appfront/modules/Customer/block/newsletter/Index.php` and `app/apphtml5/modules/Customer/block/newsletter/Index.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/newsletter/Index.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.
Duplicated block (10 lines × 2) app/appfront/modules/Customer/controllers/AccountController.php:48— app/appfront/modules/Customer/controllers/AccountController.php:48-57 | app/appfront/modules/Customer/controllers/AccountController.php:73-82 — both copies are in the same file, so extract the 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/appfront/modules/Customer/controllers/AccountController.php:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/appfront/modules/Customer/controllers/EditaccountController.php:31— app/appfront/modules/Customer/controllers/EditaccountController.php:31-40 | app/apphtml5/modules/Customer/controllers/EditaccountController.php:30-39 — before extracting anything, compare `app/appfront/modules/Customer/controllers/EditaccountController.php` and `app/apphtml5/modules/Customer/controllers/EditaccountController.php` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) app/appfront/modules/Payment/controllers/paypal/ExpressController.php:62— app/appfront/modules/Payment/controllers/paypal/ExpressController.php:62-71 | app/appfront/modules/Payment/controllers/paypal/StandardController.php:46-55 — 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/appfront/modules/Payment/controllers/paypal/ExpressController.php:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/appfront/modules/Payment/controllers/paypal/StandardController.php:63— app/appfront/modules/Payment/controllers/paypal/StandardController.php:63-72 | app/apphtml5/modules/Payment/controllers/paypal/StandardController.php:61-70 — before extracting anything, compare `app/appfront/modules/Payment/controllers/paypal/StandardController.php` and `app/apphtml5/modules/Payment/controllers/paypal/StandardController.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 (10 lines × 2) app/appserver/modules/Customer/controllers/ForgotController.php:159— app/appserver/modules/Customer/controllers/ForgotController.php:159-168 | app/appserver/modules/Customer/controllers/LoginController.php:48-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) services/Order.php:336— services/Order.php:336-345 | services/Order.php:384-393 — both copies are in the same file, so extract the 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, `services/Order.php:383` calls `findOne` and `services/Order.php:334` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) services/Product.php:269— services/Product.php:269-278 | services/Product.php:280-289 — both copies are in the same file, so extract the 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) services/category/CategoryMongodb.php:342— services/category/CategoryMongodb.php:342-351 | services/category/CategoryMysqldb.php:405-414 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:342` it does not close everything it opens, so those 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, `services/category/CategoryMysqldb.php:416` calls `removeCategoryProductRelationByCategoryId` and `services/category/CategoryMongodb.php:352` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) services/category/CategoryMongodb.php:511— services/category/CategoryMongodb.php:511-520 | services/category/CategoryMysqldb.php:578-587 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:511` it does not close everything it opens, so those exact lines 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) services/helper/Errors.php:48— services/helper/Errors.php:48-57 | services/helper/Errors.php:65-74 — both copies are in the same file, so extract the 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 `services/helper/Errors.php:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) REDACTED:242— REDACTED:242-251 | REDACTED:476-485 — both copies are in the same file, so extract the 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) services/product/ProductMongodb.php:76— services/product/ProductMongodb.php:76-85 | services/product/ProductMysqldb.php:135-144 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) app/appadmin/modules/AppadminbaseBlock.php:115— app/appadmin/modules/AppadminbaseBlock.php:115-124 | app/appadmin/modules/System/block/extensionmarket/Manager.php:122-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) app/appadmin/modules/Config/block/appfrontstore/Manager.php:31— app/appadmin/modules/Config/block/appfrontstore/Manager.php:31-40 | app/appadmin/modules/Config/block/apphtml5store/Manager.php:31-40 — `app/appadmin/modules/Config/block/appfrontstore/Manager.php` and `app/appadmin/modules/Config/block/apphtml5store/Manager.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 3 separate duplicated blocks between them, totalling at least 48 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.
Duplicated block (10 lines × 2) lib/alipay/lotusphp_runtime/Cache/Cache.php:51— lib/alipay/lotusphp_runtime/Cache/Cache.php:51-60 | lib/alipay/lotusphp_runtime/DB/Db.php:66-75 — `lib/alipay/lotusphp_runtime/Cache/Cache.php` and `lib/alipay/lotusphp_runtime/DB/Db.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 3 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. 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) lib/alipay/lotusphp_runtime/Cache/Cache.php:65— lib/alipay/lotusphp_runtime/Cache/Cache.php:65-74 | lib/alipay/lotusphp_runtime/DB/Db.php:80-89 — `lib/alipay/lotusphp_runtime/Cache/Cache.php` and `lib/alipay/lotusphp_runtime/DB/Db.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 3 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. 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) services/search/MysqlSearch.php:76— services/search/MysqlSearch.php:76-85 | services/search/XunSearch.php:77-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) app/appadmin/modules/Catalog/block/productattr/Manager.php:31— app/appadmin/modules/Catalog/block/productattr/Manager.php:31-40 | app/appadmin/modules/Catalog/block/productattrgroup/Manager.php:31-40 — `app/appadmin/modules/Catalog/block/productattr/Manager.php` and `app/appadmin/modules/Catalog/block/productattrgroup/Manager.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 2 separate duplicated blocks between them, totalling at least 30 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.
Duplicated block (10 lines × 2) app/appadmin/modules/Catalog/block/productbrand/Manager.php:32— app/appadmin/modules/Catalog/block/productbrand/Manager.php:32-41 | app/appadmin/modules/Catalog/block/productbrandcategory/Manager.php:31-40 — `app/appadmin/modules/Catalog/block/productbrand/Manager.php` and `app/appadmin/modules/Catalog/block/productbrandcategory/Manager.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 3 separate duplicated blocks between them, totalling at least 95 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.
Duplicated block (8 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:284— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:284-291 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:283-290 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/appfront/modules/Catalog/controllers/ReviewproductController.php:36— app/appfront/modules/Catalog/controllers/ReviewproductController.php:36-43 | app/apphtml5/modules/Catalog/controllers/ReviewproductController.php:36-43 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/ReviewproductController.php` and `app/apphtml5/modules/Catalog/controllers/ReviewproductController.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 3 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 (8 lines × 2) app/appfront/modules/Checkout/block/onepage/Index.php:38— app/appfront/modules/Checkout/block/onepage/Index.php:38-45 | app/apphtml5/modules/Checkout/block/onepage/Index.php:38-45 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appfront/modules/Checkout/block/onepage/Index.php:46` calls `breadcrumbs`, `__` and `app/apphtml5/modules/Checkout/block/onepage/Index.php:47` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) app/appfront/modules/Customer/controllers/ContactsController.php:30— app/appfront/modules/Customer/controllers/ContactsController.php:30-37 | app/apphtml5/modules/Customer/controllers/ContactsController.php:30-37 — before extracting anything, compare `app/appfront/modules/Customer/controllers/ContactsController.php` and `app/apphtml5/modules/Customer/controllers/ContactsController.php` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) app/appfront/modules/Payment/controllers/alipay/StandardController.php:39— app/appfront/modules/Payment/controllers/alipay/StandardController.php:39-46 | app/apphtml5/modules/Payment/controllers/alipay/StandardController.php:40-47 — before extracting anything, compare `app/appfront/modules/Payment/controllers/alipay/StandardController.php` and `app/apphtml5/modules/Payment/controllers/alipay/StandardController.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 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/appfront/widgets/Head.php:19— app/appfront/widgets/Head.php:19-26 | app/apphtml5/widgets/Head.php:19-26 — before extracting anything, compare `app/appfront/widgets/Head.php` and `app/apphtml5/widgets/Head.php` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) app/apphtml5/modules/Checkout/block/cart/Index.php:24— app/apphtml5/modules/Checkout/block/cart/Index.php:24-31 | app/appserver/modules/Checkout/controllers/CartController.php:29-36 — before extracting anything, compare `app/apphtml5/modules/Checkout/block/cart/Index.php` and `app/appserver/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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 (8 lines × 2) app/appserver/modules/Catalog/block/reviewproduct/Add.php:66— app/appserver/modules/Catalog/block/reviewproduct/Add.php:66-73 | app/appserver/modules/Catalog/controllers/ReviewproductController.php:97-104 — 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) app/appserver/modules/Checkout/block/onepage/Index.php:43— app/appserver/modules/Checkout/block/onepage/Index.php:43-50 | app/appserver/modules/Payment/block/paypal/express/Review.php:39-46 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Index.php` and `app/appserver/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 254 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Checkout/block/onepage/Index.php:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) services/category/CategoryMongodb.php:582— services/category/CategoryMongodb.php:582-589 | services/category/CategoryMysqldb.php:653-660 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:582` it does not close everything it opens, so those 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, `services/category/CategoryMysqldb.php:661` calls `unserializeData` and `services/category/CategoryMongodb.php:590` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) services/product/ProductMongodb.php:536— services/product/ProductMongodb.php:536-543 | services/product/ProductMysqldb.php:623-630 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:536` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) services/product/ProductMysqldb.php:449— services/product/ProductMysqldb.php:449-456 | services/product/ProductMysqldb.php:1435-1442 — both copies are in the same file, so extract the 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, `services/product/ProductMysqldb.php:447` calls `isset` and `services/product/ProductMysqldb.php:1433` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) services/product/ProductMysqldb.php:579— services/product/ProductMysqldb.php:579-586 | services/product/ProductMysqldb.php:1435-1442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) services/product/review/ReviewMongodb.php:288— services/product/review/ReviewMongodb.php:288-295 | services/product/review/ReviewMysqldb.php:303-310 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/product/review/ReviewMongodb.php:285` calls `ObjectId`, `getPrimaryKey` and `services/product/review/ReviewMysqldb.php:300` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) services/url/rewrite/RewriteMongodb.php:131— services/url/rewrite/RewriteMongodb.php:131-139 | services/url/rewrite/RewriteMongodb.php:144-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/url/rewrite/RewriteMongodb.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 (8 lines × 2) app/appadmin/modules/System/block/adminurlkey/Manager.php:26— app/appadmin/modules/System/block/adminurlkey/Manager.php:26-33 | app/appadmin/modules/System/block/extensiongii/Manager.php:26-33 — `app/appadmin/modules/System/block/adminurlkey/Manager.php` and `app/appadmin/modules/System/block/extensiongii/Manager.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 8 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.
Duplicated block (8 lines × 2) app/appfront/modules/Catalog/block/product/Index.php:439— app/appfront/modules/Catalog/block/product/Index.php:439-447 | app/apphtml5/modules/Catalog/block/product/Index.php:428-435 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 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 (8 lines × 2) app/appfront/modules/Customer/block/account/Index.php:22— app/appfront/modules/Customer/block/account/Index.php:22-32 | app/appfront/modules/Customer/block/editaccount/Index.php:22-29 — 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) lib/alipay/lotusphp_runtime/Cache/Adapter/CacheAdapterApc.php:26— lib/alipay/lotusphp_runtime/Cache/Adapter/CacheAdapterApc.php:26-33 | lib/alipay/lotusphp_runtime/Cache/Adapter/CacheAdapterEAccelerator.php:35-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) models/mysqldb/adminUser/AdminUserResetPassword.php:80— models/mysqldb/adminUser/AdminUserResetPassword.php:80-88 | models/mysqldb/customer/CustomerResetPassword.php:65-72 — 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) services/product/favorite/FavoriteMongodb.php:41— services/product/favorite/FavoriteMongodb.php:41-48 | services/product/favorite/FavoriteMysqldb.php:41-48 — before extracting anything, compare `services/product/favorite/FavoriteMongodb.php` and `services/product/favorite/FavoriteMysqldb.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) models/mysqldb/adminUser/AdminUserLogin.php:37— models/mysqldb/adminUser/AdminUserLogin.php:37-45 | models/mysqldb/customer/CustomerLogin.php:38-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) services/product/attr/AttrMysqldb.php:52— services/product/attr/AttrMysqldb.php:52-59 | services/product/attrgroup/AttrGroupMysqldb.php:53-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×21
Members sharing a duplicated core (4 members, 50+ identical tokens) app/appadmin/modules/Config/block/appserverstorelang/Manager.php:31— app/appadmin/modules/Config/block/appserverstorelang/Manager.php:31-38 | app/appadmin/modules/Config/block/categorysort/Manager.php:31-39 | app/appadmin/modules/Config/block/currency/Manager.php:31-38 | app/appadmin/modules/Config/block/mutillang/Manager.php:31-38 — 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/appadmin/modules/Customer/block/account/Manageredit.php:109— app/appadmin/modules/Customer/block/account/Manageredit.php:109-129 | app/appadmin/modules/Customer/block/contacts/Manageredit.php:99-119 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:47-67 | app/appadmin/modules/Fecadmin/block/resource/Manageredit.php:94-114 — 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/appapi/modules/V1/controllers/CategoryController.php:121— app/appapi/modules/V1/controllers/CategoryController.php:121-205 | REDACTED:141-175 | REDACTED:185-238 | services/product/ProductApi.php:368-413 — 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/appapi/modules/V1/controllers/ProductattrController.php:75— app/appapi/modules/V1/controllers/ProductattrController.php:75-113 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:75-112 | app/appapi/modules/V1/controllers/ProductbrandController.php:195-227 | app/appapi/modules/V1/controllers/ProductbrandcategoryController.php:182-214 — 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/appfront/modules/Catalog/block/category/Index.php:213— app/appfront/modules/Catalog/block/category/Index.php:213-267 | app/appfront/modules/Catalogsearch/block/index/Index.php:106-129 | app/apphtml5/modules/Catalog/block/category/Index.php:202-256 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:129-152 — 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/appfront/modules/Catalog/block/category/Index.php:287— app/appfront/modules/Catalog/block/category/Index.php:287-329 | app/appfront/modules/Catalogsearch/block/index/Index.php:148-183 | app/apphtml5/modules/Catalog/block/category/Index.php:275-316 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:171-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) app/appfront/modules/Catalog/block/category/Index.php:547— app/appfront/modules/Catalog/block/category/Index.php:547-562 | app/apphtml5/modules/Catalog/block/category/Index.php:534-549 | app/apphtml5/modules/Catalog/block/product/Index.php:542-556 | app/appserver/modules/Catalog/controllers/ProductController.php:786-800 — 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/appfront/modules/Catalogsearch/block/index/Index.php:239— app/appfront/modules/Catalogsearch/block/index/Index.php:239-251 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:262-274 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:272-284 | services/Category.php:456-468 — 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/appfront/modules/Catalogsearch/block/index/Index.php:332— app/appfront/modules/Catalogsearch/block/index/Index.php:332-345 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:355-368 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:330-381 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:393-428 — 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/appfront/modules/Checkout/block/onepage/Placeorder.php:41— app/appfront/modules/Checkout/block/onepage/Placeorder.php:41-105 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:40-92 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:39-126 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:39-110 — 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/appfront/modules/Checkout/block/onepage/Placeorder.php:168— app/appfront/modules/Checkout/block/onepage/Placeorder.php:168-205 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:155-192 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:190-225 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:174-209 — 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/appfront/modules/Customer/block/order/View.php:40— app/appfront/modules/Customer/block/order/View.php:40-51 | app/apphtml5/modules/Customer/block/order/View.php:30-41 | app/appserver/modules/Customer/controllers/OrderController.php:223-261 | app/appserver/modules/Customer/controllers/OrderController.php:267-314 — 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/appfront/modules/Payment/PaymentController.php:26— app/appfront/modules/Payment/PaymentController.php:26-38 | app/apphtml5/modules/Payment/PaymentController.php:26-38 | app/apphtml5/modules/Payment/controllers/Wxpayh5Controller.php:28-39 | app/apphtml5/modules/Payment/controllers/WxpayjsapiController.php:28-39 — 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/appfront/modules/Payment/block/paypal/express/Start.php:23— app/appfront/modules/Payment/block/paypal/express/Start.php:23-42 | app/appfront/modules/Payment/block/paypal/express/Start.php:48-71 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:22-40 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:45-68 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) app/appserver/modules/Checkout/block/onepage/Placeorder.php:39— app/appserver/modules/Checkout/block/onepage/Placeorder.php:39-126 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:39-110 | app/appserver/modules/Checkout/controllers/CartController.php:150-215 | app/appserver/modules/Payment/block/paypal/express/Placeorder.php:39-183 — 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) services/Order.php:466— services/Order.php:466-494 | services/cart/Coupon.php:219-247 | services/product/review/ReviewMongodb.php:305-337 | services/product/review/ReviewMysqldb.php:320-352 — 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) services/Product.php:207— services/Product.php:207-223 | services/Product.php:228-240 | services/Product.php:245-256 | services/Product.php:301-313 — 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) services/payment/Wxpay.php:130— services/payment/Wxpay.php:130-153 | services/payment/WxpayH5.php:123-146 | services/payment/WxpayJsApi.php:127-150 | services/payment/WxpayMicro.php:125-148 — 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) services/payment/Wxpay.php:248— services/payment/Wxpay.php:248-264 | services/payment/WxpayH5.php:256-271 | services/payment/WxpayJsApi.php:242-258 | services/payment/WxpayMicro.php:227-243 — 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) services/payment/Wxpay.php:370— services/payment/Wxpay.php:370-383 | services/payment/WxpayH5.php:381-394 | services/payment/WxpayJsApi.php:368-381 | services/payment/WxpayMicro.php:353-366 — 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) services/product/review/ReviewMongodb.php:346— services/product/review/ReviewMongodb.php:346-361 | services/product/review/ReviewMongodb.php:370-385 | services/product/review/ReviewMysqldb.php:361-376 | services/product/review/ReviewMysqldb.php:385-400 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (14 lines × 2) app/appfront/modules/Catalog/block/product/Index.php:569— app/appfront/modules/Catalog/block/product/Index.php:569-582 | app/apphtml5/modules/Catalog/block/product/Index.php:565-578 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:569` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) app/appfront/modules/Catalog/block/reviewproduct/Add.php:101— app/appfront/modules/Catalog/block/reviewproduct/Add.php:101-114 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:102-115 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 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 (14 lines × 2) app/appfront/modules/Cms/block/article/Index.php:41— app/appfront/modules/Cms/block/article/Index.php:41-54 | app/apphtml5/modules/Cms/block/article/Index.php:36-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Cms/block/article/Index.php:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) app/appfront/modules/Cms/block/home/Index.php:69— app/appfront/modules/Cms/block/home/Index.php:69-82 | app/apphtml5/modules/Cms/block/home/Index.php:67-80 — before extracting anything, compare `app/appfront/modules/Cms/block/home/Index.php` and `app/apphtml5/modules/Cms/block/home/Index.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 (14 lines × 2) app/appfront/modules/Customer/controllers/ProductfavoriteController.php:25— app/appfront/modules/Customer/controllers/ProductfavoriteController.php:25-38 | app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php:25-38 — before extracting anything, compare `app/appfront/modules/Customer/controllers/ProductfavoriteController.php` and `app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (14 lines × 2) app/appfront/modules/Payment/block/paypal/express/Start.php:28— app/appfront/modules/Payment/block/paypal/express/Start.php:28-41 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:27-40 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Start.php` and `app/apphtml5/modules/Payment/block/paypal/express/Start.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 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 (14 lines × 2) REDACTED:666— REDACTED:666-679 | REDACTED:751-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) lib/alipay/lotusphp_runtime/Cache/CacheConfigBuilder.php:26— lib/alipay/lotusphp_runtime/Cache/CacheConfigBuilder.php:26-39 | lib/alipay/lotusphp_runtime/DB/DbConfigBuilder.php:69-82 — 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 `lib/alipay/lotusphp_runtime/Cache/CacheConfigBuilder.php:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) services/category/CategoryMongodb.php:149— services/category/CategoryMongodb.php:149-162 | services/category/CategoryMysqldb.php:213-226 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:149` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/category/CategoryMongodb.php:163` calls `ObjectId`, `getPrimaryKey` and `services/category/CategoryMysqldb.php:227` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) services/category/CategoryMysqldb.php:581— services/category/CategoryMysqldb.php:581-594 | services/category/CategoryMysqldb.php:611-624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/category/CategoryMysqldb.php:581` it does not close everything it opens, so those exact lines 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) services/cms/article/ArticleMysqldb.php:251— services/cms/article/ArticleMysqldb.php:251-264 | services/url/rewrite/RewriteMysqldb.php:180-193 — before extracting anything, compare `services/cms/article/ArticleMysqldb.php` and `services/url/rewrite/RewriteMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `services/cms/article/ArticleMysqldb.php:251` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/cms/article/ArticleMysqldb.php:250` calls `removeRewriteUrlKey` and `services/url/rewrite/RewriteMysqldb.php:179` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) services/customer/Address.php:269— services/customer/Address.php:269-282 | services/customer/Address.php:287-300 — both copies are in the same file, so extract the 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 `services/customer/Address.php:269` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) services/product/ProductApi.php:59— services/product/ProductApi.php:59-72 | services/product/ProductApi.php:555-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 `services/product/ProductApi.php:59` it does not close everything it opens, so those exact lines 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) services/product/favorite/FavoriteMongodb.php:181— services/product/favorite/FavoriteMongodb.php:181-194 | services/product/favorite/FavoriteMongodb.php:203-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) services/product/review/ReviewMongodb.php:271— services/product/review/ReviewMongodb.php:271-284 | services/product/review/ReviewMysqldb.php:287-300 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 `services/product/review/ReviewMongodb.php:271` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/product/review/ReviewMongodb.php:285` calls `ObjectId`, `getPrimaryKey` and `services/product/review/ReviewMysqldb.php:301` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) services/url/rewrite/RewriteMongodb.php:100— services/url/rewrite/RewriteMongodb.php:100-113 | services/url/rewrite/RewriteMysqldb.php:124-137 — before extracting anything, compare `services/url/rewrite/RewriteMongodb.php` and `services/url/rewrite/RewriteMysqldb.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 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 `services/url/rewrite/RewriteMongodb.php:100` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) app/appfront/widgets/Menu.php:12— app/appfront/widgets/Menu.php:12-25 | app/apphtml5/widgets/Menu.php:12-25 — before extracting anything, compare `app/appfront/widgets/Menu.php` and `app/apphtml5/widgets/Menu.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 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 `app/appfront/widgets/Menu.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.
Duplicated block (14 lines × 2) app/appadmin/modules/System/block/extensioninstalled/Manageredit.php:136— app/appadmin/modules/System/block/extensioninstalled/Manageredit.php:136-149 | app/appadmin/modules/System/block/extensioninstalled/Managerview.php:179-192 — before extracting anything, compare `app/appadmin/modules/System/block/extensioninstalled/Manageredit.php` and `app/appadmin/modules/System/block/extensioninstalled/Managerview.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 (14 lines × 2) app/appadmin/modules/System/block/extensioninstalled/Manageredit.php:154— app/appadmin/modules/System/block/extensioninstalled/Manageredit.php:154-167 | app/appadmin/modules/System/block/extensioninstalled/Managerview.php:197-210 — before extracting anything, compare `app/appadmin/modules/System/block/extensioninstalled/Manageredit.php` and `app/appadmin/modules/System/block/extensioninstalled/Managerview.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 (14 lines × 2) services/product/favorite/FavoriteMongodb.php:58— services/product/favorite/FavoriteMongodb.php:58-71 | services/product/favorite/FavoriteMysqldb.php:58-71 — before extracting anything, compare `services/product/favorite/FavoriteMongodb.php` and `services/product/favorite/FavoriteMysqldb.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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.
Swiper::onTouchEnd (cognitive 125) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1096— Swiper::onTouchEnd has cognitive complexity 125 (threshold 15). Drivers by points: if/else 52 (114 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (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.
Swiper::onTouchMove (cognitive 82) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:946— Swiper::onTouchMove has cognitive complexity 82 (threshold 15). Drivers by points: if/else 38 (52 pts), boolean chains 15, ternaries 8 (15 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::updateSlidesSize (cognitive 79) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:312— Swiper::updateSlidesSize has cognitive complexity 79 (threshold 15). Drivers by points: if/else 37 (65 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::setTranslate (cognitive 68) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1754— Swiper::setTranslate has cognitive complexity 68 (threshold 15). Drivers by points: if/else 22 (44 pts), ternaries 9 (21 pts), boolean chains 2, loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::setTranslate (cognitive 58) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1861— Swiper::setTranslate has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 12 (32 pts), if/else 11 (25 pts), loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::updateClasses (cognitive 52) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:567— Swiper::updateClasses has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (46 pts), boolean chains 6 (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.
Swiper::init (cognitive 35) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2368— Swiper::init has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 7 (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.
Swiper::initEvents (cognitive 24) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:737— Swiper::initEvents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, ternaries 5 (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.
Swiper::updateSlidesProgress (cognitive 23) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:477— Swiper::updateSlidesProgress has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (7 pts), boolean chains 6, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::setTranslate (cognitive 23) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2094— Swiper::setTranslate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::getTranslate (cognitive 22) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1484— Swiper::getTranslate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Swiper::onTouchStart (cognitive 20) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:911— Swiper::onTouchStart has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::slideTo (cognitive 20) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1324— Swiper::slideTo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Swiper::setTranslate (cognitive 19) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2031— Swiper::setTranslate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Swiper::updateActiveIndex (cognitive 18) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:527— Swiper::updateActiveIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::setWrapperTranslate (cognitive 18) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1453— Swiper::setWrapperTranslate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Swiper::removeSlide (cognitive 18) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1674— Swiper::removeSlide has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::load (cognitive 17) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1953— Swiper::load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swiper::cleanupStyles (cognitive 16) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2414— Swiper::cleanupStyles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Duplicated block (7 lines × 2) app/appadmin/modules/Catalog/block/category/Product.php:366— app/appadmin/modules/Catalog/block/category/Product.php:366-372 | app/appadmin/modules/Catalog/block/productinfo/Index.php:294-301 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/category/Product.php:366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/appadmin/modules/System/block/extensionmarket/Manager.php:66— app/appadmin/modules/System/block/extensionmarket/Manager.php:66-72 | app/appadmin/modules/System/block/extensionmarket/Manager.php:98-104 — both copies are in the same file, so extract the 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/appadmin/modules/System/block/extensionmarket/Manager.php:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/appfront/modules/Cms/block/widgets/Head.php:19— app/appfront/modules/Cms/block/widgets/Head.php:19-25 | app/apphtml5/modules/Cms/block/widgets/Head.php:19-25 — before extracting anything, compare `app/appfront/modules/Cms/block/widgets/Head.php` and `app/apphtml5/modules/Cms/block/widgets/Head.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. 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) app/appserver/modules/Customer/controllers/ForgotController.php:122— app/appserver/modules/Customer/controllers/ForgotController.php:122-128 | app/appserver/modules/Customer/controllers/LoginController.php:79-85 — 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/appserver/modules/Customer/controllers/ForgotController.php:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) services/category/Image.php:101— services/category/Image.php:101-107 | services/product/Image.php:114-120 — `services/category/Image.php` and `services/product/Image.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 2 separate duplicated blocks between them, totalling at least 14 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. 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) services/cms/staticblock/StaticBlockMongodb.php:122— services/cms/staticblock/StaticBlockMongodb.php:122-128 | services/cms/staticblock/StaticBlockMysqldb.php:154-160 — before extracting anything, compare `services/cms/staticblock/StaticBlockMongodb.php` and `services/cms/staticblock/StaticBlockMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `services/cms/staticblock/StaticBlockMongodb.php:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) services/email/widgets/customer/account/forgotpassword/Body.php:26— services/email/widgets/customer/account/forgotpassword/Body.php:26-32 | services/email/widgets/customer/account/register/Body.php:28-34 — `services/email/widgets/customer/account/forgotpassword/Body.php` and `services/email/widgets/customer/account/register/Body.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 7 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.
Duplicated block (7 lines × 2) services/page/Asset.php:104— services/page/Asset.php:104-110 | services/page/Asset.php:123-129 — both copies are in the same file, so extract the 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 `services/page/Asset.php:104` it does not close everything it opens, so those exact lines 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/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:62— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:62-68 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:62-68 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) app/appfront/modules/Cms/controllers/ArticleController.php:18— app/appfront/modules/Cms/controllers/ArticleController.php:18-24 | app/apphtml5/modules/Cms/controllers/ArticleController.php:18-24 — before extracting anything, compare `app/appfront/modules/Cms/controllers/ArticleController.php` and `app/apphtml5/modules/Cms/controllers/ArticleController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 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) app/appinstall/modules/Database/controllers/ConfigController.php:636— app/appinstall/modules/Database/controllers/ConfigController.php:636-642 | services/Helper.php:276-284 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) services/Request.php:123— services/Request.php:123-129 | yii/web/Request.php:121-127 — before extracting anything, compare `services/Request.php` and `yii/web/Request.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 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) services/Request.php:138— services/Request.php:138-144 | services/url/rewrite/RewriteMongodb.php:43-49 — 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) services/category/CategoryMongodb.php:409— services/category/CategoryMongodb.php:409-415 | services/category/CategoryMysqldb.php:472-478 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) services/category/Image.php:85— services/category/Image.php:85-91 | services/product/Image.php:132-138 — `services/category/Image.php` and `services/product/Image.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 2 separate duplicated blocks between them, totalling at least 14 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. 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) services/customer/newsletter/NewsletterMongodb.php:68— services/customer/newsletter/NewsletterMongodb.php:68-74 | services/customer/newsletter/NewsletterMysqldb.php:68-74 — before extracting anything, compare `services/customer/newsletter/NewsletterMongodb.php` and `services/customer/newsletter/NewsletterMysqldb.php` as WHOLE FILES: 94% 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) services/product/ProductMongodb.php:991— services/product/ProductMongodb.php:991-997 | services/product/ProductMysqldb.php:1145-1151 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) services/product/favorite/FavoriteMongodb.php:161— services/product/favorite/FavoriteMongodb.php:161-167 | services/product/favorite/FavoriteMysqldb.php:161-167 — before extracting anything, compare `services/product/favorite/FavoriteMongodb.php` and `services/product/favorite/FavoriteMysqldb.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) services/Image.php:176— services/Image.php:176-182 | services/helper/ZipFile.php:133-139 — 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 (12 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:40— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:40-51 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:40-51 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:123— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:123-134 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:122-133 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:341— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:341-352 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:340-351 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:341` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/appadmin/modules/Catalog/block/productinfo/index/Attr.php:36— app/appadmin/modules/Catalog/block/productinfo/index/Attr.php:36-47 | app/appadmin/modules/Catalog/block/productinfo/index/BatchAttr.php:36-47 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/index/Attr.php` and `app/appadmin/modules/Catalog/block/productinfo/index/BatchAttr.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/appfront/modules/AppfrontController.php:38— app/appfront/modules/AppfrontController.php:38-49 | app/apphtml5/modules/AppfrontController.php:38-49 — before extracting anything, compare `app/appfront/modules/AppfrontController.php` and `app/apphtml5/modules/AppfrontController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/AppfrontController.php:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/appfront/modules/Catalogsearch/block/index/Index.php:205— app/appfront/modules/Catalogsearch/block/index/Index.php:205-216 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:228-239 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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 (12 lines × 2) app/appfront/modules/Checkout/block/onepage/Index.php:249— app/appfront/modules/Checkout/block/onepage/Index.php:249-260 | app/apphtml5/modules/Checkout/block/onepage/Index.php:239-250 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/appfront/modules/Customer/block/account/Registerenable.php:23— app/appfront/modules/Customer/block/account/Registerenable.php:23-35 | app/apphtml5/modules/Customer/block/account/Registerenable.php:20-31 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Registerenable.php` and `app/apphtml5/modules/Customer/block/account/Registerenable.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/appfront/modules/Payment/block/paypal/express/Review.php:191— app/appfront/modules/Payment/block/paypal/express/Review.php:191-202 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:191-202 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/appfront/modules/Payment/controllers/alipay/StandardController.php:57— app/appfront/modules/Payment/controllers/alipay/StandardController.php:57-68 | app/apphtml5/modules/Payment/controllers/alipay/StandardController.php:58-69 — before extracting anything, compare `app/appfront/modules/Payment/controllers/alipay/StandardController.php` and `app/apphtml5/modules/Payment/controllers/alipay/StandardController.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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) lib/alipay/lotusphp_runtime/Validator/Validator.php:53— lib/alipay/lotusphp_runtime/Validator/Validator.php:53-64 | lib/alipay/lotusphp_runtime/Validator/Validator.php:82-93 — both copies are in the same file, so extract the 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 `lib/alipay/lotusphp_runtime/Validator/Validator.php:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) migrations/mysqldb/m190809_154516_fecshop_tables.php:340— migrations/mysqldb/m190809_154516_fecshop_tables.php:340-352 | migrations/mysqldb/m200331_082139_fecshop_tables.php:71-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) services/Application.php:117— services/Application.php:117-128 | services/Service.php:75-86 — 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 `services/Application.php:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) services/category/CategoryMongodb.php:267— services/category/CategoryMongodb.php:267-278 | services/category/CategoryMysqldb.php:329-340 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/category/CategoryMysqldb.php:343` calls `serializeSaveData` and `services/category/CategoryMongodb.php:283` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) app/appfront/modules/Cms/block/widgets/Menu.php:12— app/appfront/modules/Cms/block/widgets/Menu.php:12-23 | app/apphtml5/modules/Cms/block/widgets/Menu.php:12-23 — before extracting anything, compare `app/appfront/modules/Cms/block/widgets/Menu.php` and `app/apphtml5/modules/Cms/block/widgets/Menu.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Cms/block/widgets/Menu.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.
Duplicated block (12 lines × 2) app/appfront/widgets/Footer.php:12— app/appfront/widgets/Footer.php:12-23 | app/apphtml5/widgets/Footer.php:12-23 — before extracting anything, compare `app/appfront/widgets/Footer.php` and `app/apphtml5/widgets/Footer.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/widgets/Footer.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.
Duplicated block (12 lines × 2) app/apphtml5/modules/Payment/controllers/Wxpayh5Controller.php:93— app/apphtml5/modules/Payment/controllers/Wxpayh5Controller.php:93-104 | app/apphtml5/modules/Payment/controllers/WxpayjsapiController.php:69-80 — before extracting anything, compare `app/apphtml5/modules/Payment/controllers/Wxpayh5Controller.php` and `app/apphtml5/modules/Payment/controllers/WxpayjsapiController.php` as WHOLE FILES: 89% 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) services/product/review/ReviewMongodb.php:53— services/product/review/ReviewMongodb.php:53-64 | services/product/review/ReviewMysqldb.php:54-66 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/appadmin/modules/Catalog/block/categoryupload/Manager.php:129— app/appadmin/modules/Catalog/block/categoryupload/Manager.php:129-139 | app/appadmin/modules/Catalog/block/productupload/Manager.php:166-176 — `app/appadmin/modules/Catalog/block/categoryupload/Manager.php` and `app/appadmin/modules/Catalog/block/productupload/Manager.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 3 separate duplicated blocks between them, totalling at least 32 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:377— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:377-387 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:376-386 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/appadmin/modules/Fecadmin/block/log/Index.php:198— app/appadmin/modules/Fecadmin/block/log/Index.php:198-208 | app/appadmin/modules/Fecadmin/block/logtj/Index.php:239-249 — `app/appadmin/modules/Fecadmin/block/log/Index.php` and `app/appadmin/modules/Fecadmin/block/logtj/Index.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 5 separate duplicated blocks between them, totalling at least 72 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.
Duplicated block (11 lines × 2) app/appadmin/modules/Fecadmin/controllers/LoginController.php:37— app/appadmin/modules/Fecadmin/controllers/LoginController.php:37-47 | app/appadmin/modules/Fecadmin/controllers/LogoutController.php:36-46 — before extracting anything, compare `app/appadmin/modules/Fecadmin/controllers/LoginController.php` and `app/appadmin/modules/Fecadmin/controllers/LogoutController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Fecadmin/controllers/LoginController.php:37` it begins part-way through the construct above it, so those exact lines 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) app/appfront/modules/Customer/block/order/View.php:41— app/appfront/modules/Customer/block/order/View.php:41-51 | app/apphtml5/modules/Customer/block/order/View.php:31-41 — before extracting anything, compare `app/appfront/modules/Customer/block/order/View.php` and `app/apphtml5/modules/Customer/block/order/View.php` as WHOLE FILES: 92% 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/order/View.php:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) app/appfront/modules/Customer/controllers/AccountController.php:143— app/appfront/modules/Customer/controllers/AccountController.php:143-153 | app/apphtml5/modules/Customer/controllers/AccountController.php:156-166 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AccountController.php` and `app/apphtml5/modules/Customer/controllers/AccountController.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) REDACTED:70— REDACTED:70-80 | REDACTED:96-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) REDACTED:120— REDACTED:120-130 | REDACTED:785-795 — both copies are in the same file, so extract the 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) services/Store.php:304— services/Store.php:304-314 | services/Store.php:369-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) services/category/CategoryMongodb.php:300— services/category/CategoryMongodb.php:300-310 | services/category/CategoryMysqldb.php:360-370 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:300` it does not close everything it opens, so those exact lines 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) services/category/CategoryMongodb.php:617— services/category/CategoryMongodb.php:617-627 | services/category/CategoryMysqldb.php:694-704 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:617` it does not close everything it opens, so those 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, `services/category/CategoryMongodb.php:616` calls `getPrimaryKey` and `services/category/CategoryMysqldb.php:693` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) services/helper/errorhandler/ErrorHandlerMongodb.php:62— services/helper/errorhandler/ErrorHandlerMongodb.php:62-72 | services/helper/errorhandler/ErrorHandlerMysqldb.php:62-72 — before extracting anything, compare `services/helper/errorhandler/ErrorHandlerMongodb.php` and `services/helper/errorhandler/ErrorHandlerMysqldb.php` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) services/product/ProductApi.php:301— services/product/ProductApi.php:301-311 | services/product/ProductApi.php:754-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/product/ProductApi.php:301` it does not close everything it opens, so those exact lines 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) services/product/ProductMongodb.php:1271— services/product/ProductMongodb.php:1271-1281 | services/product/ProductMysqldb.php:1471-1481 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:1271` it begins part-way through the construct above it, so those exact lines 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) app/appfront/modules/Checkout/block/cart/Index.php:173— app/appfront/modules/Checkout/block/cart/Index.php:173-183 | app/apphtml5/modules/Checkout/block/cart/Index.php:162-172 — before extracting anything, compare `app/appfront/modules/Checkout/block/cart/Index.php` and `app/apphtml5/modules/Checkout/block/cart/Index.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/appserver/modules/Customer/controllers/AddressController.php:26— app/appserver/modules/Customer/controllers/AddressController.php:26-36 | app/appserver/modules/Wx/controllers/AccountController.php:24-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) services/category/CategoryMongodb.php:692— services/category/CategoryMongodb.php:692-702 | services/category/CategoryMysqldb.php:769-779 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) services/product/Brand.php:68— services/product/Brand.php:68-78 | services/product/Brandcategory.php:102-112 — before extracting anything, compare `services/product/Brand.php` and `services/product/Brandcategory.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:317— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:317-329 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:316-328 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) app/appapi/modules/V1/controllers/ProductattrgroupController.php:120— app/appapi/modules/V1/controllers/ProductattrgroupController.php:120-132 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:225-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) app/appfront/modules/Customer/block/address/Edit.php:99— app/appfront/modules/Customer/block/address/Edit.php:99-111 | app/apphtml5/modules/Customer/block/address/Edit.php:89-101 — before extracting anything, compare `app/appfront/modules/Customer/block/address/Edit.php` and `app/apphtml5/modules/Customer/block/address/Edit.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) app/appserver/modules/Catalog/controllers/CategoryController.php:718— app/appserver/modules/Catalog/controllers/CategoryController.php:718-730 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:438-450 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/CategoryController.php` and `app/appserver/modules/Catalogsearch/controllers/IndexController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 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) REDACTED:300— REDACTED:300-312 | REDACTED:314-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) services/Order.php:763— services/Order.php:763-775 | services/Order.php:814-826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/Order.php:763` it does not close everything it opens, so those exact lines 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) services/Sitemap.php:48— services/Sitemap.php:48-63 | services/Sitemap.php:77-89 — both copies are in the same file, so extract the 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 `services/Sitemap.php:48` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) services/admin/Role.php:58— services/admin/Role.php:58-70 | services/admin/UserRole.php:47-59 — before extracting anything, compare `services/admin/Role.php` and `services/admin/UserRole.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) services/category/CategoryMongodb.php:514— services/category/CategoryMongodb.php:514-526 | services/category/CategoryMongodb.php:543-555 — both copies are in the same file, so extract the 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 `services/category/CategoryMongodb.php:514` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) REDACTED:569— REDACTED:569-581 | REDACTED:689-701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:569` it begins part-way through the construct above it, so those exact lines 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) services/product/ProductApi.php:88— services/product/ProductApi.php:88-100 | services/product/ProductApi.php:593-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) services/product/ProductMongodb.php:630— services/product/ProductMongodb.php:630-642 | services/product/ProductMysqldb.php:708-720 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) services/product/ProductMongodb.php:844— services/product/ProductMongodb.php:844-856 | services/product/ProductMongodb.php:865-877 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/product/ProductMongodb.php:844` it does not close everything it opens, so those exact lines 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) services/product/ProductMongodb.php:1169— services/product/ProductMongodb.php:1169-1181 | services/product/ProductMysqldb.php:1374-1386 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:1169` it does not close everything it opens, so those exact lines 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) services/product/ProductMongodb.php:1223— services/product/ProductMongodb.php:1223-1235 | services/product/ProductMysqldb.php:1427-1439 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:1223` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) services/product/review/ReviewMongodb.php:349— services/product/review/ReviewMongodb.php:349-361 | services/product/review/ReviewMysqldb.php:364-376 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 `services/product/review/ReviewMongodb.php:349` it begins part-way through the construct above it, so those exact lines 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) services/product/review/ReviewMongodb.php:373— services/product/review/ReviewMongodb.php:373-385 | services/product/review/ReviewMysqldb.php:388-400 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 `services/product/review/ReviewMongodb.php:373` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
MethodTooLong: m170228_072156_fecshop_tables.safeUp REDACTED:7— MethodTooLong — safeUp runs 407 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 307 over it, 4.07× 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: AppadminbaseBlockEdit.getEditBar app/appadmin/modules/AppadminbaseBlockEdit.php:57— MethodTooLong — getEditBar runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Manager.getEditArr app/appadmin/modules/Config/block/email/Manager.php:110— MethodTooLong — getEditArr runs 193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× 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: m190809_154516_fecshop_tables.safeUp migrations/mysqldb/m190809_154516_fecshop_tables.php:13— MethodTooLong — safeUp runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× 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: Appserver.getMessageArr services/helper/Appserver.php:297— MethodTooLong — getMessageArr runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× 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: Page.getLastData app/appfront/widgets/Page.php:26— MethodTooLong — getLastData runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: Page.getLastData app/apphtml5/widgets/Page.php:26— MethodTooLong — getLastData runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: Manager.getEditArr app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:90— MethodTooLong — getEditArr runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× 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: Managerbatchedit.initParamType app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:500— MethodTooLong — initParamType runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Manageredit.initParamType app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:457— MethodTooLong — initParamType runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Manager.getEditArr app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:90— MethodTooLong — getEditArr runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: m190730_130707_fecshop_tables.safeUp migrations/mysqldb/m190730_130707_fecshop_tables.php:13— MethodTooLong — safeUp runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Attr.getBaseInfo app/appadmin/modules/Catalog/block/productinfo/index/Attr.php:152— MethodTooLong — getBaseInfo runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× 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: Manageredit.getEditArr app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:49— MethodTooLong — getEditArr runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Manager.getEditArr app/appadmin/modules/Config/block/appservercatalog/Manager.php:90— MethodTooLong — getEditArr runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×15
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appadmin/modules/AppadminbaseBlock.php:451— app/appadmin/modules/AppadminbaseBlock.php:451-472 | app/appadmin/modules/Catalog/block/category/Product.php:436-457 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:234-255 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:215-235 | app/appadmin/modules/Customer/block/newsletter/Index.php:144-164 | app/appadmin/modules/System/block/error/Index.php:260-281 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:51— app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:51-226 | app/appadmin/modules/Config/block/apphtml5store/Manageredit.php:51-177 | app/appadmin/modules/Config/block/appserverstore/Manager.php:80-175 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:90-180 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:77-156 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:80-150 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Catalog/block/category/Index.php:362— app/appfront/modules/Catalog/block/category/Index.php:362-373 | app/appfront/modules/Catalogsearch/block/index/Index.php:223-234 | app/apphtml5/modules/Catalog/block/category/Index.php:349-360 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:246-257 | app/appserver/modules/Catalog/controllers/CategoryController.php:490-501 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:256-267 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Catalog/block/category/Index.php:418— app/appfront/modules/Catalog/block/category/Index.php:418-442 | app/appfront/modules/Catalogsearch/block/index/Index.php:295-316 | app/apphtml5/modules/Catalog/block/category/Index.php:405-429 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:318-339 | app/appserver/modules/Catalog/controllers/CategoryController.php:555-579 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:292-313 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Catalog/block/category/Index.php:485— app/appfront/modules/Catalog/block/category/Index.php:485-504 | app/appfront/modules/Catalogsearch/block/index/Index.php:352-378 | app/apphtml5/modules/Catalog/block/category/Index.php:472-491 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:375-401 | app/appserver/modules/Catalog/controllers/CategoryController.php:718-742 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:438-465 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Checkout/block/onepage/Index.php:248— app/appfront/modules/Checkout/block/onepage/Index.php:248-260 | app/appfront/modules/Customer/block/address/Edit.php:122-136 | app/appfront/modules/Payment/block/paypal/express/Review.php:190-202 | app/apphtml5/modules/Checkout/block/onepage/Index.php:238-250 | app/apphtml5/modules/Customer/block/address/Edit.php:112-129 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:190-202 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Checkout/block/onepage/Index.php:358— app/appfront/modules/Checkout/block/onepage/Index.php:358-375 | app/appfront/modules/Payment/block/paypal/express/Review.php:300-317 | app/apphtml5/modules/Checkout/block/onepage/Index.php:348-367 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:300-317 | app/appserver/modules/Checkout/block/onepage/Index.php:382-399 | app/appserver/modules/Payment/block/paypal/express/Review.php:321-338 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Checkout/block/onepage/Index.php:385— app/appfront/modules/Checkout/block/onepage/Index.php:385-422 | app/appfront/modules/Payment/block/paypal/express/Review.php:327-355 | app/apphtml5/modules/Checkout/block/onepage/Index.php:377-414 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:327-355 | app/appserver/modules/Checkout/block/onepage/Index.php:409-446 | app/appserver/modules/Payment/block/paypal/express/Review.php:348-376 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Checkout/block/onepage/Index.php:433— app/appfront/modules/Checkout/block/onepage/Index.php:433-463 | app/appfront/modules/Payment/block/paypal/express/Review.php:366-396 | app/apphtml5/modules/Checkout/block/onepage/Index.php:425-455 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:366-396 | app/appserver/modules/Checkout/block/onepage/Index.php:457-487 | app/appserver/modules/Payment/block/paypal/express/Review.php:387-417 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Payment/block/paypal/express/Placeorder.php:154— app/appfront/modules/Payment/block/paypal/express/Placeorder.php:154-173 | app/appfront/modules/Payment/block/paypal/standard/Placeorder.php:100-121 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:154-173 | app/apphtml5/modules/Payment/block/paypal/standard/Placeorder.php:100-121 | app/appserver/modules/Payment/block/paypal/express/Placeorder.php:191-210 | app/appserver/modules/Payment/block/paypal/standard/Placeorder.php:112-135 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appfront/modules/Payment/controllers/paypal/ExpressController.php:60— app/appfront/modules/Payment/controllers/paypal/ExpressController.php:60-73 | app/appfront/modules/Payment/controllers/paypal/StandardController.php:44-57 | app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php:60-72 | app/apphtml5/modules/Payment/controllers/paypal/StandardController.php:43-55 | app/appserver/modules/Payment/controllers/paypal/ExpressController.php:57-72 | app/appserver/modules/Payment/controllers/paypal/StandardController.php:55-70 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) app/appserver/modules/Catalog/controllers/ProductController.php:100— app/appserver/modules/Catalog/controllers/ProductController.php:100-125 | app/appserver/modules/Catalog/controllers/ProductController.php:130-180 | app/appserver/modules/Checkout/controllers/CartController.php:223-277 | app/appserver/modules/Checkout/controllers/CartController.php:284-352 | app/appserver/modules/Customer/controllers/AccountController.php:22-39 | app/appserver/modules/Customer/controllers/AccountController.php:66-82 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) services/Sitemap.php:42— services/Sitemap.php:42-63 | services/Sitemap.php:71-89 | services/Sitemap.php:97-118 | services/Sitemap.php:138-171 | services/Sitemap.php:191-224 | services/Sitemap.php:243-276 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) services/admin/Config.php:44— services/admin/Config.php:44-56 | services/admin/RoleUrlKey.php:48-60 | services/admin/SystemLog.php:54-66 | services/adminUser/AdminUser.php:81-93 | services/product/Brand.php:51-63 | services/product/Brandcategory.php:51-63 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) services/extension/Administer.php:45— services/extension/Administer.php:45-96 | services/extension/Administer.php:103-146 | services/extension/Administer.php:156-206 | services/extension/Administer.php:213-256 | services/extension/Administer.php:266-324 | services/extension/Administer.php:330-381 — 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.
Duplicated block (5 lines × 2) app/appadmin/modules/AppadminbaseBlock.php:336— app/appadmin/modules/AppadminbaseBlock.php:336-340 | app/appadmin/modules/Catalog/block/category/Product.php:232-236 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:336` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:135— app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:135-139 | app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:141-145 — both copies are in the same file, so extract the 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/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) app/appadmin/modules/Fecadmin/block/cache/Index.php:126— app/appadmin/modules/Fecadmin/block/cache/Index.php:126-130 | app/appadmin/modules/Fecadmin/block/cache/Index.php:182-186 — both copies are in the same file, so extract the 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/appadmin/modules/Fecadmin/block/cache/Index.php:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) app/appfront/modules/Catalog/block/category/Index.php:537— app/appfront/modules/Catalog/block/category/Index.php:537-541 | app/apphtml5/modules/Catalog/block/category/Index.php:524-528 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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) app/appfront/modules/Catalog/controllers/ReviewproductController.php:45— app/appfront/modules/Catalog/controllers/ReviewproductController.php:45-49 | app/apphtml5/modules/Catalog/controllers/ReviewproductController.php:45-49 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/ReviewproductController.php` and `app/apphtml5/modules/Catalog/controllers/ReviewproductController.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 3 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 `app/appfront/modules/Catalog/controllers/ReviewproductController.php:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appfront/modules/Catalog/controllers/ReviewproductController.php:50` calls `htmlEncode` and `app/apphtml5/modules/Catalog/controllers/ReviewproductController.php:50` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) app/appfront/widgets/Headers.php:32— app/appfront/widgets/Headers.php:32-36 | app/apphtml5/widgets/Headers.php:32-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) app/console/modules/Product/controllers/SearchController.php:72— app/console/modules/Product/controllers/SearchController.php:72-76 | app/console/modules/Product/controllers/SearchController.php:82-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) REDACTED:342— REDACTED:342-346 | REDACTED:464-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) REDACTED:1080— REDACTED:1080-1084 | REDACTED:1145-1149 — both copies are in the same file, so extract the 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 (5 lines × 2) app/appadmin/modules/Catalog/block/productinfo/index/Attr.php:52— app/appadmin/modules/Catalog/block/productinfo/index/Attr.php:52-56 | app/appadmin/modules/Catalog/block/productinfo/index/BatchAttr.php:52-56 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/index/Attr.php` and `app/appadmin/modules/Catalog/block/productinfo/index/BatchAttr.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:121— app/appfront/modules/Catalog/block/category/Index.php:121-125 | app/apphtml5/modules/Catalog/block/category/Index.php:142-146 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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) app/appfront/modules/Catalogsearch/block/index/Index.php:431— app/appfront/modules/Catalogsearch/block/index/Index.php:431-435 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:453-457 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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) services/product/ProductMongodb.php:327— services/product/ProductMongodb.php:327-331 | services/product/ProductMysqldb.php:397-401 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) services/product/review/ReviewMongodb.php:183— services/product/review/ReviewMongodb.php:183-187 | services/product/review/ReviewMysqldb.php:199-203 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:593— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:593-597 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:550-554 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 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 (17 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:614— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:614-630 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:571-587 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:614` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/appapi/modules/V1/controllers/ArticleController.php:47— app/appapi/modules/V1/controllers/ArticleController.php:47-63 | app/appapi/modules/V1/controllers/OrderController.php:81-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) app/appapi/modules/V1/controllers/ArticleController.php:138— app/appapi/modules/V1/controllers/ArticleController.php:138-154 | app/appapi/modules/V1/controllers/CategoryController.php:482-498 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (17 lines × 2) app/appfront/modules/Customer/block/contacts/Index.php:105— app/appfront/modules/Customer/block/contacts/Index.php:105-121 | app/apphtml5/modules/Customer/block/contacts/Index.php:105-121 — before extracting anything, compare `app/appfront/modules/Customer/block/contacts/Index.php` and `app/apphtml5/modules/Customer/block/contacts/Index.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/contacts/Index.php:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/appfront/modules/Payment/controllers/CheckmoneyController.php:28— app/appfront/modules/Payment/controllers/CheckmoneyController.php:28-44 | app/apphtml5/modules/Payment/controllers/CheckmoneyController.php:28-44 — before extracting anything, compare `app/appfront/modules/Payment/controllers/CheckmoneyController.php` and `app/apphtml5/modules/Payment/controllers/CheckmoneyController.php` as WHOLE FILES: 94% 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) services/category/CategoryMongodb.php:707— services/category/CategoryMongodb.php:707-723 | services/category/CategoryMysqldb.php:784-800 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 (17 lines × 2) services/cms/staticblock/StaticBlockMongodb.php:92— services/cms/staticblock/StaticBlockMongodb.php:92-108 | services/cms/staticblock/StaticBlockMysqldb.php:121-137 — before extracting anything, compare `services/cms/staticblock/StaticBlockMongodb.php` and `services/cms/staticblock/StaticBlockMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `services/cms/staticblock/StaticBlockMongodb.php:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) services/cms/staticblock/StaticBlockMongodb.php:146— services/cms/staticblock/StaticBlockMongodb.php:146-162 | services/cms/staticblock/StaticBlockMysqldb.php:174-190 — before extracting anything, compare `services/cms/staticblock/StaticBlockMongodb.php` and `services/cms/staticblock/StaticBlockMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) services/page/Widget.php:63— services/page/Widget.php:63-79 | services/page/Widget.php:113-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) services/product/Brand.php:242— services/product/Brand.php:242-258 | services/product/Brandcategory.php:229-245 — before extracting anything, compare `services/product/Brand.php` and `services/product/Brandcategory.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 144 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 `services/product/Brand.php:242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) services/product/ProductApi.php:313— services/product/ProductApi.php:313-329 | services/product/ProductApi.php:766-782 — both copies are in the same file, so extract the 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 `services/product/ProductApi.php:313` it begins part-way through the construct above it, so those 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, `services/product/ProductApi.php:783` calls `isset` and `services/product/ProductApi.php:331` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) services/search/MongoSearch.php:154— services/search/MongoSearch.php:154-170 | services/search/MysqlSearch.php:93-109 — before extracting anything, compare `services/search/MongoSearch.php` and `services/search/MysqlSearch.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `services/search/MongoSearch.php:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) app/appfront/modules/Cms/block/widgets/Headers.php:14— app/appfront/modules/Cms/block/widgets/Headers.php:14-30 | app/apphtml5/modules/Cms/block/widgets/Headers.php:14-30 — before extracting anything, compare `app/appfront/modules/Cms/block/widgets/Headers.php` and `app/apphtml5/modules/Cms/block/widgets/Headers.php` as WHOLE FILES: 90% 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 `app/appfront/modules/Cms/block/widgets/Headers.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.
Duplicated block (17 lines × 2) app/appfront/modules/Site/controllers/HelperController.php:21— app/appfront/modules/Site/controllers/HelperController.php:21-37 | app/apphtml5/modules/Site/controllers/HelperController.php:12-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Site/controllers/HelperController.php:21` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:423— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:423-438 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:422-437 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) app/appadmin/modules/Catalog/block/productinfo/index/Attr.php:71— app/appadmin/modules/Catalog/block/productinfo/index/Attr.php:71-86 | app/appadmin/modules/Catalog/block/productinfo/index/BatchAttr.php:71-86 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/index/Attr.php` and `app/appadmin/modules/Catalog/block/productinfo/index/BatchAttr.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) app/appapi/modules/AppapiController.php:47— app/appapi/modules/AppapiController.php:47-62 | app/console/modules/ConsoleController.php:29-44 — before extracting anything, compare `app/appapi/modules/AppapiController.php` and `app/console/modules/ConsoleController.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. 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 (16 lines × 2) app/appfront/modules/Checkout/block/cart/Index.php:68— app/appfront/modules/Checkout/block/cart/Index.php:68-83 | app/apphtml5/modules/Checkout/block/cart/Index.php:58-73 — before extracting anything, compare `app/appfront/modules/Checkout/block/cart/Index.php` and `app/apphtml5/modules/Checkout/block/cart/Index.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) app/appfront/modules/Customer/controllers/AccountController.php:120— app/appfront/modules/Customer/controllers/AccountController.php:120-135 | app/apphtml5/modules/Customer/controllers/AccountController.php:127-142 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AccountController.php` and `app/apphtml5/modules/Customer/controllers/AccountController.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 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) app/appfront/modules/Payment/block/success/Index.php:22— app/appfront/modules/Payment/block/success/Index.php:22-37 | app/apphtml5/modules/Payment/block/success/Index.php:22-37 — before extracting anything, compare `app/appfront/modules/Payment/block/success/Index.php` and `app/apphtml5/modules/Payment/block/success/Index.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) app/appserver/modules/Catalog/controllers/CategoryController.php:638— app/appserver/modules/Catalog/controllers/CategoryController.php:638-653 | app/appserver/modules/Cms/controllers/HomeController.php:136-151 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/CategoryController.php` and `app/appserver/modules/Cms/controllers/HomeController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:638` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) app/appserver/modules/Checkout/controllers/CartController.php:399— app/appserver/modules/Checkout/controllers/CartController.php:399-414 | app/appserver/modules/Checkout/controllers/CartController.php:424-439 — both copies are in the same file, so extract the 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/appserver/modules/Checkout/controllers/CartController.php:399` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16 lines × 2) services/Customer.php:860— services/Customer.php:860-875 | services/adminUser/UserLogin.php:121-136 — 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 `services/Customer.php:860` it does not close everything it opens, so those 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 (16 lines × 2) services/admin/Menu.php:172— services/admin/Menu.php:172-187 | services/admin/Menu.php:214-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) migrations/mysqldb/m181118_003931_fecshop_tables.php:15— migrations/mysqldb/m181118_003931_fecshop_tables.php:15-30 | migrations/mysqldb/m210225_095812_fecshop_tables.php:16-32 — 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 `migrations/mysqldb/m181118_003931_fecshop_tables.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.
Duplicated block (16 lines × 2) app/appfront/modules/Catalog/helpers/Price.php:22— app/appfront/modules/Catalog/helpers/Price.php:22-37 | app/apphtml5/modules/Catalog/helpers/Price.php:22-37 — before extracting anything, compare `app/appfront/modules/Catalog/helpers/Price.php` and `app/apphtml5/modules/Catalog/helpers/Price.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) app/appfront/widgets/Headers.php:12— app/appfront/widgets/Headers.php:12-27 | app/apphtml5/widgets/Headers.php:12-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/widgets/Headers.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.
Duplicated block (15 lines × 2) app/appadmin/modules/System/controllers/AdminurlkeyController.php:26— app/appadmin/modules/System/controllers/AdminurlkeyController.php:26-40 | app/appadmin/modules/System/controllers/ExtensiongiiController.php:27-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:485— app/appfront/modules/Catalog/block/category/Index.php:485-499 | app/apphtml5/modules/Catalog/block/category/Index.php:472-486 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:485` it does not close everything it opens, so those exact lines 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) app/appfront/modules/Catalog/helpers/Review.php:82— app/appfront/modules/Catalog/helpers/Review.php:82-96 | app/apphtml5/modules/Catalog/helpers/Review.php:81-95 — before extracting anything, compare `app/appfront/modules/Catalog/helpers/Review.php` and `app/apphtml5/modules/Catalog/helpers/Review.php` as WHOLE FILES: 94% 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 (15 lines × 2) app/appfront/modules/Checkout/controllers/CartController.php:115— app/appfront/modules/Checkout/controllers/CartController.php:115-129 | app/appserver/modules/Checkout/controllers/CartController.php:239-253 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/appserver/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/controllers/CartController.php:115` it begins part-way through the construct above it, so those exact lines 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) app/appfront/modules/Customer/block/order/Reorder.php:22— app/appfront/modules/Customer/block/order/Reorder.php:22-36 | app/apphtml5/modules/Customer/block/order/Reorder.php:22-36 — before extracting anything, compare `app/appfront/modules/Customer/block/order/Reorder.php` and `app/apphtml5/modules/Customer/block/order/Reorder.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 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.
Duplicated block (15 lines × 2) app/appfront/modules/Customer/controllers/AccountController.php:184— app/appfront/modules/Customer/controllers/AccountController.php:184-198 | app/apphtml5/modules/Customer/controllers/AccountController.php:197-211 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AccountController.php` and `app/apphtml5/modules/Customer/controllers/AccountController.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 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 after the matched lines, `app/appfront/modules/Customer/controllers/AccountController.php:199` calls `breadcrumbs`, `__` and `app/apphtml5/modules/Customer/controllers/AccountController.php:213` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) app/appfront/modules/Payment/controllers/paypal/ExpressController.php:40— app/appfront/modules/Payment/controllers/paypal/ExpressController.php:40-54 | app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php:40-54 — before extracting anything, compare `app/appfront/modules/Payment/controllers/paypal/ExpressController.php` and `app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php` as WHOLE FILES: 94% 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 (15 lines × 2) app/appserver/modules/Catalog/controllers/CategoryController.php:694— app/appserver/modules/Catalog/controllers/CategoryController.php:694-709 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:414-428 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/CategoryController.php` and `app/appserver/modules/Catalogsearch/controllers/IndexController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:694` it begins part-way through the construct above it, so those exact lines 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) services/Image.php:255— services/Image.php:255-269 | services/Image.php:274-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) services/category/CategoryMongodb.php:492— services/category/CategoryMongodb.php:492-506 | services/category/CategoryMysqldb.php:559-573 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 (15 lines × 2) services/category/CategoryMongodb.php:535— services/category/CategoryMongodb.php:535-549 | services/category/CategoryMysqldb.php:603-617 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:535` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) services/product/ProductMongodb.php:445— services/product/ProductMongodb.php:445-459 | services/product/ProductMongodb.php:1341-1355 — both copies are in the same file, so extract the 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 `services/product/ProductMongodb.php:445` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 2) services/product/favorite/FavoriteMysqldb.php:181— services/product/favorite/FavoriteMysqldb.php:181-195 | services/product/favorite/FavoriteMysqldb.php:204-218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Swiper::onTouchMove (cyclomatic 62) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:946— Swiper::onTouchMove has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Swiper::onTouchEnd (cyclomatic 57) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1096— Swiper::onTouchEnd has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Swiper::updateSlidesSize (cyclomatic 40) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:312— Swiper::updateSlidesSize has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Swiper::setTranslate (cyclomatic 33) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1754— Swiper::setTranslate 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.
Swiper::init (cyclomatic 26) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2368— Swiper::init has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Swiper::setTranslate (cyclomatic 25) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1861— Swiper::setTranslate has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Swiper::updateClasses (cyclomatic 22) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:567— Swiper::updateClasses 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.
Swiper::initEvents (cyclomatic 21) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:737— Swiper::initEvents has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Swiper::getTranslate (cyclomatic 20) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1484— Swiper::getTranslate has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Swiper::updateSlidesProgress (cyclomatic 18) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:477— Swiper::updateSlidesProgress 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.
Swiper::onTouchStart (cyclomatic 17) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:911— Swiper::onTouchStart 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.
Swiper::slideTo (cyclomatic 16) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1324— Swiper::slideTo 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.
Duplicated block (18 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:102— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:102-119 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:101-118 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:243— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:243-260 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:259-276 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) app/appadmin/modules/Config/block/appfrontstore/Manager.php:166— app/appadmin/modules/Config/block/appfrontstore/Manager.php:166-183 | app/appadmin/modules/Config/block/apphtml5store/Manager.php:166-183 — `app/appadmin/modules/Config/block/appfrontstore/Manager.php` and `app/appadmin/modules/Config/block/apphtml5store/Manager.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 3 separate duplicated blocks between them, totalling at least 48 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.
Duplicated block (18 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:133— app/appfront/modules/Catalog/block/category/Index.php:133-150 | app/apphtml5/modules/Catalog/block/category/Index.php:154-171 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:133` it does not close everything it opens, so those 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 (18 lines × 2) app/appfront/modules/Checkout/block/onepage/Index.php:215— app/appfront/modules/Checkout/block/onepage/Index.php:215-232 | app/apphtml5/modules/Checkout/block/onepage/Index.php:205-222 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:215` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) services/cms/article/ArticleMongodb.php:54— services/cms/article/ArticleMongodb.php:54-71 | services/cms/article/ArticleMysqldb.php:70-87 — before extracting anything, compare `services/cms/article/ArticleMongodb.php` and `services/cms/article/ArticleMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 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 (18 lines × 2) services/extension/Administer.php:307— services/extension/Administer.php:307-324 | services/extension/Administer.php:364-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/extension/Administer.php:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) services/product/ProductMongodb.php:104— services/product/ProductMongodb.php:104-121 | services/product/ProductMysqldb.php:106-123 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) services/product/ProductMongodb.php:737— services/product/ProductMongodb.php:737-754 | services/product/ProductMysqldb.php:886-903 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 (18 lines × 2) services/product/review/ReviewMongodb.php:156— services/product/review/ReviewMongodb.php:156-173 | services/product/review/ReviewMysqldb.php:172-189 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) app/appfront/modules/Catalog/block/product/Review.php:52— app/appfront/modules/Catalog/block/product/Review.php:52-70 | app/apphtml5/modules/Catalog/block/product/Review.php:51-68 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Review.php` and `app/apphtml5/modules/Catalog/block/product/Review.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 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/appapi/modules/V1/controllers/CategoryController.php:532— app/appapi/modules/V1/controllers/CategoryController.php:532-549 | REDACTED:331-348 — 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.
FileTooLong: REDACTED REDACTED— FileTooLong — 4632 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 3132 over it, 3.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: js/sm-extend.js app/apphtml5/theme/base/html5/assets/js/sm-extend.js— FileTooLong — 2167 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 667 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: fancybox/jquery.fancybox.js app/appfront/theme/base/front/assets/fancybox/jquery.fancybox.js— FileTooLong — 1159 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 659 over it, 2.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: js/owl.carousel.js app/appfront/theme/base/front/assets/js/owl.carousel.js— FileTooLong — 1023 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 523 over it, 2.05× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: elevatezoom/jquery.elevatezoom.js app/appfront/theme/base/front/assets/elevatezoom/jquery.elevatezoom.js— FileTooLong — 972 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 472 over it, 1.94× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: product/ProductMysqldb.php services/product/ProductMysqldb.php— FileTooLong — 881 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ProductMysqldb (22-1621). The bar is 500 significant lines; this is 381 over it, 1.76× 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: product/ProductMongodb.php services/product/ProductMongodb.php— FileTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ProductMongodb (22-1414). The bar is 500 significant lines; this is 233 over it, 1.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: lib/WxPay.Data.php lib/wxpay/lib/WxPay.Data.php— FileTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 200 over it, 1.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/Order.php services/Order.php— FileTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: Order (23-1273). The bar is 500 significant lines; this is 138 over it, 1.28× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 98 over it, 1.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED app/appserver/modules/Catalog/controllers/ProductController.php— FileTooLong — 533 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ProductController (20-885). The bar is 500 significant lines; this is 33 over it, 1.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.
ClassTooLong: ProductMysqldb services/product/ProductMysqldb.php:22— ClassTooLong — 876 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 476 over it, 2.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ProductMongodb services/product/ProductMongodb.php:22— ClassTooLong — 728 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 328 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Order services/Order.php:23— ClassTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 235 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ProductController app/appserver/modules/Catalog/controllers/ProductController.php:20— ClassTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 128 over it, 1.32× 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: CategoryMysqldb services/category/CategoryMysqldb.php:21— ClassTooLong — 462 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 62 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: Managerbatchedit app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:24— ClassTooLong — 447 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 47 over it, 1.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CategoryController app/appserver/modules/Catalog/controllers/CategoryController.php:19— ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 25 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Manageredit app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:24— ClassTooLong — 422 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 22 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CategoryMongodb services/category/CategoryMongodb.php:20— ClassTooLong — 416 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 16 over it, 1.04× 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: m170228_072156_fecshop_tables REDACTED:5— ClassTooLong — 411 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 11 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.
ClassTooLong: Customer services/Customer.php:39— ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 2 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (21 lines × 2) app/appadmin/modules/AppadminbaseBlockEdit.php:327— app/appadmin/modules/AppadminbaseBlockEdit.php:327-349 | app/appadmin/modules/AppadminbaseBlockEdit.php:368-388 — both copies are in the same file, so extract the 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/appadmin/modules/AppadminbaseBlockEdit.php:327` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/appapi/modules/V1/controllers/CurrencyController.php:51— app/appapi/modules/V1/controllers/CurrencyController.php:51-71 | app/appapi/modules/V1/controllers/LanguagesController.php:51-71 — 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/appapi/modules/V1/controllers/CurrencyController.php:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/appapi/modules/V1/controllers/ProductattrgroupController.php:159— app/appapi/modules/V1/controllers/ProductattrgroupController.php:159-179 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:245-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.
Duplicated block (21 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:458— app/appfront/modules/Catalog/block/category/Index.php:458-478 | app/apphtml5/modules/Catalog/block/category/Index.php:445-465 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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) app/appfront/modules/Catalog/block/product/Index.php:177— app/appfront/modules/Catalog/block/product/Index.php:177-197 | app/apphtml5/modules/Catalog/block/product/Index.php:167-187 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 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) app/appfront/modules/Checkout/controllers/CartController.php:268— app/appfront/modules/Checkout/controllers/CartController.php:268-288 | app/apphtml5/modules/Checkout/controllers/CartController.php:265-285 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) app/appfront/modules/Customer/block/order/Index.php:37— app/appfront/modules/Customer/block/order/Index.php:37-57 | app/apphtml5/modules/Customer/block/order/Index.php:37-57 — before extracting anything, compare `app/appfront/modules/Customer/block/order/Index.php` and `app/apphtml5/modules/Customer/block/order/Index.php` as WHOLE FILES: 94% 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appfront/modules/Customer/block/order/Index.php:58` calls `breadcrumbs`, `__` and `app/apphtml5/modules/Customer/block/order/Index.php:59` 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 (21 lines × 2) app/appserver/modules/Catalog/controllers/CategoryController.php:605— app/appserver/modules/Catalog/controllers/CategoryController.php:605-625 | app/appserver/modules/Catalog/controllers/CategoryController.php:672-692 — both copies are in the same file, so extract the 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/appserver/modules/Catalog/controllers/CategoryController.php:605` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) lib/alipay/lotusphp_runtime/DB/Adapter/SqlAdapter/DbSqlAdapterMysql.php:68— lib/alipay/lotusphp_runtime/DB/Adapter/SqlAdapter/DbSqlAdapterMysql.php:68-88 | lib/alipay/lotusphp_runtime/DB/Adapter/SqlAdapter/DbSqlAdapterSqlite.php:98-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (21 lines × 2) lib/alipay/lotusphp_runtime/MVC/Action.php:204— lib/alipay/lotusphp_runtime/MVC/Action.php:204-224 | lib/alipay/lotusphp_runtime/MVC/Component.php:102-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) services/category/CategoryMongodb.php:314— services/category/CategoryMongodb.php:314-334 | services/category/CategoryMysqldb.php:376-396 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:314` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×10
Members sharing a duplicated core (5 members, 50+ identical tokens) app/appadmin/modules/AppadminController.php:33— app/appadmin/modules/AppadminController.php:33-56 | app/appadmin/modules/Fecadmin/controllers/LoginController.php:32-48 | app/appadmin/modules/Fecadmin/controllers/LogoutController.php:31-46 | app/appfront/modules/AppfrontController.php:33-49 | app/apphtml5/modules/AppfrontController.php:33-49 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/appadmin/modules/AppadminController.php:105— app/appadmin/modules/AppadminController.php:105-117 | app/appadmin/modules/Fecadmin/controllers/LoginController.php:124-136 | app/appadmin/modules/Fecadmin/controllers/LogoutController.php:91-103 | app/appfront/modules/AppfrontController.php:110-128 | app/apphtml5/modules/AppfrontController.php:109-122 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/appadmin/modules/AppadminController.php:151— app/appadmin/modules/AppadminController.php:151-167 | app/appfront/modules/AppfrontController.php:66-82 | app/apphtml5/modules/AppfrontController.php:66-82 | app/appserver/modules/AppserverController.php:49-65 | app/appserver/modules/AppserverTokenController.php:85-101 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/appapi/modules/V1/controllers/CategoryController.php:28— app/appapi/modules/V1/controllers/CategoryController.php:28-66 | app/appapi/modules/V1/controllers/ProductattrController.php:28-68 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:28-68 | app/appapi/modules/V1/controllers/ProductbrandController.php:28-60 | app/appapi/modules/V1/controllers/ProductbrandcategoryController.php:28-60 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) app/appfront/modules/Catalog/block/reviewproduct/Add.php:55— app/appfront/modules/Catalog/block/reviewproduct/Add.php:55-93 | app/appfront/modules/Catalog/block/reviewproduct/Lists.php:81-126 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:56-94 | app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php:82-125 | app/appserver/modules/Catalog/block/reviewproduct/Add.php:56-103 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) migrations/mysqldb/m181126_143605_fecshop_tables.php:16— migrations/mysqldb/m181126_143605_fecshop_tables.php:16-33 | migrations/mysqldb/m190730_130707_fecshop_tables.php:16-279 | migrations/mysqldb/m190809_154516_fecshop_tables.php:16-379 | migrations/mysqldb/m190904_025251_fecshop_tables.php:16-135 | migrations/mysqldb/m200331_082139_fecshop_tables.php:16-121 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) services/category/CategoryMongodb.php:147— services/category/CategoryMongodb.php:147-205 | services/category/CategoryMongodb.php:217-259 | services/category/CategoryMongodb.php:615-686 | services/category/CategoryMysqldb.php:694-764 | services/cms/article/ArticleMongodb.php:125-153 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) services/payment/Alipay.php:164— services/payment/Alipay.php:164-195 | services/payment/Wxpay.php:330-357 | services/payment/WxpayH5.php:336-368 | services/payment/WxpayJsApi.php:323-355 | services/payment/WxpayMicro.php:308-340 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) services/payment/Alipay.php:294— services/payment/Alipay.php:294-316 | services/payment/Wxpay.php:393-413 | services/payment/WxpayH5.php:404-424 | services/payment/WxpayJsApi.php:391-411 | services/payment/WxpayMicro.php:376-396 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) services/payment/Alipay.php:363— services/payment/Alipay.php:363-384 | services/payment/Wxpay.php:286-321 | services/payment/WxpayH5.php:293-327 | services/payment/WxpayJsApi.php:280-314 | services/payment/WxpayMicro.php:265-299 — 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.
Duplicated block (24 lines × 2) app/appapi/modules/V1/controllers/CategoryController.php:90— app/appapi/modules/V1/controllers/CategoryController.php:90-113 | app/appapi/modules/V1/controllers/OrderController.php:114-137 — 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/appapi/modules/V1/controllers/CategoryController.php:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:512— app/appfront/modules/Catalog/block/category/Index.php:512-535 | app/apphtml5/modules/Catalog/block/category/Index.php:499-522 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:512` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/appfront/modules/Catalog/controllers/ProductController.php:70— app/appfront/modules/Catalog/controllers/ProductController.php:70-94 | app/apphtml5/modules/Catalog/controllers/ProductController.php:61-84 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/ProductController.php` and `app/apphtml5/modules/Catalog/controllers/ProductController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/controllers/ProductController.php:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/appfront/modules/Catalogsearch/block/index/Index.php:106— app/appfront/modules/Catalogsearch/block/index/Index.php:106-129 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:129-152 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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 lines × 2) app/appfront/modules/Checkout/controllers/CartController.php:183— app/appfront/modules/Checkout/controllers/CartController.php:183-206 | app/apphtml5/modules/Checkout/controllers/CartController.php:178-201 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/controllers/CartController.php:183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/appfront/modules/Payment/block/paypal/express/Review.php:39— app/appfront/modules/Payment/block/paypal/express/Review.php:39-62 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:39-62 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Review.php:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) app/appfront/modules/Payment/block/paypal/express/Start.php:48— app/appfront/modules/Payment/block/paypal/express/Start.php:48-71 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:45-68 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Start.php` and `app/apphtml5/modules/Payment/block/paypal/express/Start.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 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 lines × 2) app/appserver/modules/Catalog/controllers/CategoryController.php:152— app/appserver/modules/Catalog/controllers/CategoryController.php:152-175 | app/appserver/modules/Catalog/controllers/CategoryController.php:199-222 — both copies are in the same file, so extract the 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/appserver/modules/Catalog/controllers/CategoryController.php:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) services/category/CategoryMongodb.php:551— services/category/CategoryMongodb.php:551-574 | services/category/CategoryMysqldb.php:620-643 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:551` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:393— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:393-411 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:392-410 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:393` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:337— app/appfront/modules/Catalog/block/category/Index.php:337-355 | app/apphtml5/modules/Catalog/block/category/Index.php:324-342 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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 (19 lines × 2) app/appfront/modules/Customer/controllers/AjaxController.php:26— app/appfront/modules/Customer/controllers/AjaxController.php:26-44 | app/apphtml5/modules/Customer/controllers/AjaxController.php:26-44 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AjaxController.php` and `app/apphtml5/modules/Customer/controllers/AjaxController.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `app/appfront/modules/Customer/controllers/AjaxController.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.
Duplicated block (19 lines × 2) app/appfront/widgets/Page.php:266— app/appfront/widgets/Page.php:266-284 | app/apphtml5/widgets/Page.php:212-230 — before extracting anything, compare `app/appfront/widgets/Page.php` and `app/apphtml5/widgets/Page.php` as WHOLE FILES: 99% 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 (19 lines × 2) app/appserver/modules/Checkout/block/onepage/Index.php:261— app/appserver/modules/Checkout/block/onepage/Index.php:261-279 | app/appserver/modules/Payment/block/paypal/express/Review.php:206-224 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Index.php` and `app/appserver/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 254 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) services/product/Brand.php:124— services/product/Brand.php:124-142 | services/product/Brandcategory.php:124-142 — before extracting anything, compare `services/product/Brand.php` and `services/product/Brandcategory.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 144 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 `services/product/Brand.php:124` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) services/product/viewLog/Db.php:50— services/product/viewLog/Db.php:50-68 | services/product/viewLog/Mongodb.php:51-69 — 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 (19 lines × 2) services/search/MongoSearch.php:278— services/search/MongoSearch.php:278-296 | services/search/MysqlSearch.php:214-232 — before extracting anything, compare `services/search/MongoSearch.php` and `services/search/MysqlSearch.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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.
Calendar::monthHTML (cognitive 62) REDACTED:2261— Calendar::monthHTML has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 6 (20 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Calendar::setYearMonth (cognitive 36) REDACTED:2595— Calendar::setYearMonth has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 9 (14 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Calendar::initCalendarEvents::handleTouchEnd (cognitive 28) REDACTED:1911— Calendar::initCalendarEvents::handleTouchEnd has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (27 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.
Calendar::initCalendarEvents::handleYearTouchEnd (cognitive 28) REDACTED:2032— Calendar::initCalendarEvents::handleYearTouchEnd has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (27 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.
Calendar::nextMonth (cognitive 19) REDACTED:2513— Calendar::nextMonth has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 5 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Calendar::prevMonth (cognitive 19) REDACTED:2552— Calendar::prevMonth has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 5 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Calendar::layout (cognitive 18) REDACTED:2664— Calendar::layout has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 2, if/else 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (22 lines × 2) app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:234— app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:234-255 | app/appadmin/modules/Config/block/apphtml5store/Manageredit.php:185-206 — `app/appadmin/modules/Config/block/appfrontstore/Manageredit.php` and `app/appadmin/modules/Config/block/apphtml5store/Manageredit.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 3 separate duplicated blocks between them, totalling at least 56 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.
Duplicated block (22 lines × 2) app/appapi/modules/V1/controllers/ProductattrController.php:84— app/appapi/modules/V1/controllers/ProductattrController.php:84-105 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:83-104 — before extracting anything, compare `app/appapi/modules/V1/controllers/ProductattrController.php` and `app/appapi/modules/V1/controllers/ProductattrgroupController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/ProductattrController.php:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) app/appfront/modules/Catalog/block/product/CustomOption.php:77— app/appfront/modules/Catalog/block/product/CustomOption.php:77-98 | app/apphtml5/modules/Catalog/block/product/CustomOption.php:77-98 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/CustomOption.php` and `app/apphtml5/modules/Catalog/block/product/CustomOption.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 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/CustomOption.php:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) app/appfront/modules/Checkout/controllers/CartController.php:242— app/appfront/modules/Checkout/controllers/CartController.php:242-263 | app/apphtml5/modules/Checkout/controllers/CartController.php:239-260 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (22 lines × 2) app/appfront/modules/Customer/block/contacts/Index.php:41— app/appfront/modules/Customer/block/contacts/Index.php:41-62 | app/apphtml5/modules/Customer/block/contacts/Index.php:42-63 — before extracting anything, compare `app/appfront/modules/Customer/block/contacts/Index.php` and `app/apphtml5/modules/Customer/block/contacts/Index.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/contacts/Index.php:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) app/appfront/modules/Customer/block/productfavorite/Index.php:32— app/appfront/modules/Customer/block/productfavorite/Index.php:32-53 | app/apphtml5/modules/Customer/block/productfavorite/Index.php:32-53 — before extracting anything, compare `app/appfront/modules/Customer/block/productfavorite/Index.php` and `app/apphtml5/modules/Customer/block/productfavorite/Index.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 72 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 after the matched lines, `app/appfront/modules/Customer/block/productfavorite/Index.php:54` calls `breadcrumbs`, `__` and `app/apphtml5/modules/Customer/block/productfavorite/Index.php:56` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) app/appfront/modules/Payment/block/paypal/express/Review.php:432— app/appfront/modules/Payment/block/paypal/express/Review.php:432-453 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:432-453 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Review.php:432` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:131— app/appfront/modules/Catalog/block/product/Index.php:131-142 | app/apphtml5/modules/Catalog/block/product/Index.php:120-131 | app/appserver/modules/Catalog/controllers/ProductController.php:361-372 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/appfront/modules/Checkout/controllers/CartController.php:211— app/appfront/modules/Checkout/controllers/CartController.php:211-222 | app/apphtml5/modules/Checkout/controllers/CartController.php:206-217 | app/appserver/modules/Checkout/controllers/CartController.php:360-371 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/controllers/CartController.php:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appserver/modules/Checkout/controllers/CartController.php:357` calls `getMethod` and `app/appfront/modules/Checkout/controllers/CartController.php:210` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) app/appfront/modules/Customer/controllers/GoogleController.php:36— app/appfront/modules/Customer/controllers/GoogleController.php:36-47 | app/apphtml5/modules/Customer/controllers/GoogleController.php:36-47 | app/appserver/modules/Customer/controllers/GoogleController.php:36-47 — before extracting anything, compare `app/appfront/modules/Customer/controllers/GoogleController.php` and `app/apphtml5/modules/Customer/controllers/GoogleController.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/GoogleController.php:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) app/appfront/modules/Payment/block/paypal/express/Review.php:163— app/appfront/modules/Payment/block/paypal/express/Review.php:163-174 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:163-174 | app/appserver/modules/Payment/block/paypal/express/Review.php:178-189 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Review.php:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) services/category/CategoryMongodb.php:176— services/category/CategoryMongodb.php:176-187 | services/category/CategoryMongodb.php:658-669 | services/category/CategoryMysqldb.php:236-247 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) services/payment/Wxpay.php:179— services/payment/Wxpay.php:179-190 | services/payment/WxpayJsApi.php:189-200 | services/payment/WxpayMicro.php:180-191 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayJsApi.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) services/search/MongoSearch.php:166— services/search/MongoSearch.php:166-177 | services/search/MysqlSearch.php:105-116 | services/search/XunSearch.php:104-115 — before extracting anything, compare `services/search/MongoSearch.php` and `services/search/MysqlSearch.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `services/search/MongoSearch.php:166` it does not close everything it opens, so those 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, `services/search/MongoSearch.php:178` calls `unset` and `services/search/XunSearch.php:116` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) app/appadmin/modules/AppadminController.php:38— app/appadmin/modules/AppadminController.php:38-47 | app/appadmin/modules/Fecadmin/controllers/LoginController.php:34-43 | app/appadmin/modules/Fecadmin/controllers/LogoutController.php:33-42 — before extracting anything, compare `app/appadmin/modules/AppadminController.php` and `app/appadmin/modules/Fecadmin/controllers/LoginController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminController.php:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:407— app/appfront/modules/Catalog/block/product/Index.php:407-416 | app/apphtml5/modules/Catalog/block/product/Index.php:396-405 | app/appserver/modules/Catalog/controllers/ProductController.php:639-648 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:407` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) app/appfront/modules/Payment/controllers/alipay/StandardController.php:53— app/appfront/modules/Payment/controllers/alipay/StandardController.php:53-62 | app/apphtml5/modules/Payment/controllers/alipay/StandardController.php:54-63 | app/appserver/modules/Payment/controllers/alipay/StandardController.php:74-83 — before extracting anything, compare `app/appfront/modules/Payment/controllers/alipay/StandardController.php` and `app/apphtml5/modules/Payment/controllers/alipay/StandardController.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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/controllers/alipay/StandardController.php:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:82— app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:82-95 | app/appserver/modules/Checkout/controllers/CartController.php:188-197 | app/appserver/modules/Payment/block/paypal/express/Placeorder.php:123-132 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) services/extension/Administer.php:103— services/extension/Administer.php:103-112 | services/extension/Administer.php:213-222 | services/extension/Administer.php:330-339 — 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 `services/extension/Administer.php:103` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 3) services/product/ProductApi.php:73— services/product/ProductApi.php:73-82 | services/product/ProductApi.php:84-93 | services/product/ProductApi.php:569-578 — 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 `services/product/ProductApi.php:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) app/appfront/modules/Payment/controllers/CheckmoneyController.php:52— app/appfront/modules/Payment/controllers/CheckmoneyController.php:52-62 | app/apphtml5/modules/Payment/controllers/CheckmoneyController.php:52-62 | app/appserver/modules/Payment/controllers/Wxpayh5Controller.php:102-111 — before extracting anything, compare `app/appfront/modules/Payment/controllers/CheckmoneyController.php` and `app/apphtml5/modules/Payment/controllers/CheckmoneyController.php` as WHOLE FILES: 94% 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 × 3) app/appadmin/modules/Config/block/appfrontpayment/Manager.php:177— app/appadmin/modules/Config/block/appfrontpayment/Manager.php:177-182 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:165-171 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:166-171 — `app/appadmin/modules/Config/block/appfrontpayment/Manager.php` and `app/appadmin/modules/Config/block/apphtml5payment/Manager.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 6 separate duplicated blocks between them, totalling at least 66 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/appadmin/modules/Config/block/appfrontpayment/Manager.php:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) app/appfront/modules/Catalog/block/category/Index.php:343— app/appfront/modules/Catalog/block/category/Index.php:343-348 | app/apphtml5/modules/Catalog/block/category/Index.php:330-335 | app/appserver/modules/Catalog/controllers/CategoryController.php:458-463 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:343` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appserver/modules/Catalog/controllers/CategoryController.php:455` calls `getCurrentSymbol`, `get` and `app/appfront/modules/Catalog/block/category/Index.php:341` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) app/appfront/modules/Catalog/block/reviewproduct/Add.php:76— app/appfront/modules/Catalog/block/reviewproduct/Add.php:76-81 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:77-82 | app/appserver/modules/Catalog/block/reviewproduct/Add.php:81-86 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/reviewproduct/Add.php:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) app/appfront/modules/Checkout/block/onepage/Index.php:535— app/appfront/modules/Checkout/block/onepage/Index.php:535-540 | app/apphtml5/modules/Checkout/block/onepage/Index.php:527-532 | app/appserver/modules/Checkout/block/onepage/Index.php:540-545 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 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 (6 lines × 3) app/appfront/modules/Customer/block/order/View.php:40— app/appfront/modules/Customer/block/order/View.php:40-45 | app/apphtml5/modules/Customer/block/order/View.php:30-35 | app/appserver/modules/Customer/controllers/OrderController.php:227-232 — before extracting anything, compare `app/appfront/modules/Customer/block/order/View.php` and `app/apphtml5/modules/Customer/block/order/View.php` as WHOLE FILES: 92% 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/order/View.php:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) services/product/ProductMongodb.php:444— services/product/ProductMongodb.php:444-449 | services/product/ProductMongodb.php:554-559 | services/product/ProductMongodb.php:1340-1345 — 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 (6 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:490— app/appfront/modules/Catalog/block/product/Index.php:490-495 | app/apphtml5/modules/Catalog/block/product/Index.php:478-483 | app/appserver/modules/Catalog/controllers/ProductController.php:722-727 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 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 × 3) app/appadmin/modules/AppadminbaseBlockEdit.php:89— app/appadmin/modules/AppadminbaseBlockEdit.php:89-93 | app/appadmin/modules/Fecadmin/block/account/Manageredit.php:211-215 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:144-148 — `app/appadmin/modules/Fecadmin/block/account/Manageredit.php` and `app/appadmin/modules/Fecadmin/block/config/Manageredit.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 4 separate duplicated blocks between them, totalling at least 80 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.
Duplicated block (5 lines × 3) app/appapi/modules/V1/controllers/CategoryController.php:280— app/appapi/modules/V1/controllers/CategoryController.php:280-284 | app/appapi/modules/V1/controllers/CategoryController.php:381-385 | app/appapi/modules/V1/controllers/CategoryController.php:500-504 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) app/appapi/modules/V1/controllers/CategoryController.php:290— app/appapi/modules/V1/controllers/CategoryController.php:290-294 | app/appapi/modules/V1/controllers/CategoryController.php:391-395 | app/appapi/modules/V1/controllers/CategoryController.php:510-514 — 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/appapi/modules/V1/controllers/CategoryController.php:295` calls `getPrimaryKey` and `app/appapi/modules/V1/controllers/CategoryController.php:517` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:152— app/appfront/modules/Catalog/block/product/Index.php:152-156 | app/apphtml5/modules/Catalog/block/product/Index.php:141-145 | app/appserver/modules/Catalog/controllers/ProductController.php:382-386 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) app/appserver/modules/Catalog/controllers/CategoryController.php:623— app/appserver/modules/Catalog/controllers/CategoryController.php:623-627 | app/appserver/modules/Catalog/controllers/ProductController.php:821-825 | app/appserver/modules/Cms/controllers/HomeController.php:121-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:623` it does not close everything it opens, so those 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 (5 lines × 3) services/url/rewrite/RewriteMongodb.php:129— services/url/rewrite/RewriteMongodb.php:129-133 | services/url/rewrite/RewriteMongodb.php:142-146 | services/url/rewrite/RewriteMysqldb.php:155-159 — before extracting anything, compare `services/url/rewrite/RewriteMongodb.php` and `services/url/rewrite/RewriteMysqldb.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 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 `services/url/rewrite/RewriteMongodb.php:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) app/appfront/modules/Cms/block/home/Index.php:32— app/appfront/modules/Cms/block/home/Index.php:32-36 | app/apphtml5/modules/Cms/block/home/Index.php:31-35 | app/appserver/modules/Cms/controllers/HomeController.php:97-101 — before extracting anything, compare `app/appfront/modules/Cms/block/home/Index.php` and `app/apphtml5/modules/Cms/block/home/Index.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 (20 lines × 2) app/appadmin/modules/Config/block/currency/Manager.php:64— app/appadmin/modules/Config/block/currency/Manager.php:64-83 | app/appadmin/modules/Config/block/mutillang/Manager.php:80-99 — `app/appadmin/modules/Config/block/currency/Manager.php` and `app/appadmin/modules/Config/block/mutillang/Manager.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 3 separate duplicated blocks between them, totalling at least 78 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.
Duplicated block (20 lines × 2) app/appfront/modules/Checkout/controllers/OnepageController.php:35— app/appfront/modules/Checkout/controllers/OnepageController.php:35-54 | app/apphtml5/modules/Checkout/controllers/OnepageController.php:31-50 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/OnepageController.php` and `app/apphtml5/modules/Checkout/controllers/OnepageController.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 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) app/appfront/modules/Payment/block/paypal/express/Review.php:401— app/appfront/modules/Payment/block/paypal/express/Review.php:401-420 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:401-420 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 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 (20 lines × 2) app/appserver/modules/Catalog/controllers/CategoryController.php:464— app/appserver/modules/Catalog/controllers/CategoryController.php:464-483 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:230-249 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/CategoryController.php` and `app/appserver/modules/Catalogsearch/controllers/IndexController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) app/appfront/modules/Customer/block/mailer/account/forgotpassword/EmailBody.php:25— app/appfront/modules/Customer/block/mailer/account/forgotpassword/EmailBody.php:25-44 | app/apphtml5/modules/Customer/block/mailer/account/forgotpassword/EmailBody.php:25-44 — before extracting anything, compare `app/appfront/modules/Customer/block/mailer/account/forgotpassword/EmailBody.php` and `app/apphtml5/modules/Customer/block/mailer/account/forgotpassword/EmailBody.php` as WHOLE FILES: 88% 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 `app/appfront/modules/Customer/block/mailer/account/forgotpassword/EmailBody.php:25` 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 first that the copies are not typed on the same thing: `Email` names `fecshop\app\appfront\helper\mailer\Email` in one and `fecshop\app\apphtml5\helper\mailer\Email` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 2) services/helper/Appapi.php:68— services/helper/Appapi.php:68-87 | services/helper/Appserver.php:259-279 — before extracting anything, compare `services/helper/Appapi.php` and `services/helper/Appserver.php` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) app/appfront/modules/Catalog/block/category/Index.php:58— app/appfront/modules/Catalog/block/category/Index.php:58-73 | app/apphtml5/modules/Catalog/block/category/Index.php:59-74 | app/appserver/modules/Catalog/controllers/CategoryController.php:113-128 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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 × 3) services/Customer.php:760— services/Customer.php:760-775 | services/Customer.php:806-821 | services/adminUser/UserLogin.php:59-74 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (16 lines × 3) services/Sitemap.php:156— services/Sitemap.php:156-171 | services/Sitemap.php:209-224 | services/Sitemap.php:261-276 — 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 `services/Sitemap.php:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) services/product/ProductMysqldb.php:479— services/product/ProductMysqldb.php:479-494 | services/product/ProductMysqldb.php:610-625 | services/product/ProductMysqldb.php:1458-1473 — 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 (16 lines × 3) services/product/ProductMysqldb.php:526— services/product/ProductMysqldb.php:526-541 | services/product/ProductMysqldb.php:630-645 | services/product/ProductMysqldb.php:1528-1543 — 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 `services/product/ProductMysqldb.php:526` it does not close everything it opens, so those exact lines 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 × 3) services/search/MongoSearch.php:365— services/search/MongoSearch.php:365-380 | services/search/MysqlSearch.php:307-322 | services/search/XunSearch.php:258-273 — before extracting anything, compare `services/search/MongoSearch.php` and `services/search/MysqlSearch.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `services/search/MongoSearch.php:365` it does not close everything it opens, so those 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, `services/search/MongoSearch.php:364` calls `array_slice` and `services/search/MysqlSearch.php:305` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 4) app/appfront/modules/Catalog/block/category/Index.php:554— app/appfront/modules/Catalog/block/category/Index.php:554-562 | app/apphtml5/modules/Catalog/block/category/Index.php:541-549 | app/apphtml5/modules/Catalog/block/product/Index.php:548-556 | app/appserver/modules/Catalog/controllers/ProductController.php:792-800 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:554` it begins part-way through the construct above it, so those exact lines 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) app/appfront/modules/Catalog/controllers/ProductController.php:67— app/appfront/modules/Catalog/controllers/ProductController.php:67-75 | app/apphtml5/modules/Catalog/controllers/ProductController.php:58-66 | app/appserver/modules/Catalog/controllers/ProductController.php:68-76 | app/appserver/modules/General/controllers/BaseController.php:39-47 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/ProductController.php` and `app/apphtml5/modules/Catalog/controllers/ProductController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 108 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 after the matched lines, `app/appfront/modules/Catalog/controllers/ProductController.php:77` calls `getCurrentCurrency` and `app/appserver/modules/General/controllers/BaseController.php:49` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 4) services/Order.php:486— services/Order.php:486-494 | services/cart/Coupon.php:239-247 | services/product/review/ReviewMongodb.php:329-337 | services/product/review/ReviewMysqldb.php:344-352 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 `services/Order.php:486` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 4) services/payment/Wxpay.php:130— services/payment/Wxpay.php:130-138 | services/payment/WxpayH5.php:123-131 | services/payment/WxpayJsApi.php:127-135 | services/payment/WxpayMicro.php:125-133 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 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 `services/payment/Wxpay.php:130` it does not close everything it opens, so those exact lines 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) services/product/ProductMongodb.php:407— services/product/ProductMongodb.php:407-415 | services/product/ProductMongodb.php:1306-1314 | services/product/ProductMysqldb.php:504-514 | services/product/ProductMysqldb.php:1507-1516 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:407` it does not close everything it opens, so those exact lines 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) services/product/review/ReviewMongodb.php:346— services/product/review/ReviewMongodb.php:346-354 | services/product/review/ReviewMongodb.php:370-378 | services/product/review/ReviewMysqldb.php:361-369 | services/product/review/ReviewMysqldb.php:385-393 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 `services/product/review/ReviewMongodb.php:346` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) app/appadmin/modules/System/controllers/AdminurlkeyController.php:67— app/appadmin/modules/System/controllers/AdminurlkeyController.php:67-74 | app/appadmin/modules/System/controllers/ExtensiongiiController.php:81-88 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:70-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) app/appfront/modules/Catalog/block/reviewproduct/Add.php:43— app/appfront/modules/Catalog/block/reviewproduct/Add.php:43-50 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:44-51 | app/appserver/modules/Catalog/block/reviewproduct/Add.php:43-50 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 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 (8 lines × 3) app/appfront/modules/Checkout/block/cart/Index.php:126— app/appfront/modules/Checkout/block/cart/Index.php:126-133 | app/apphtml5/modules/Checkout/block/cart/Index.php:115-122 | app/appserver/modules/Checkout/controllers/CartController.php:89-96 — before extracting anything, compare `app/appfront/modules/Checkout/block/cart/Index.php` and `app/apphtml5/modules/Checkout/block/cart/Index.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/cart/Index.php:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) app/appfront/modules/Checkout/block/onepage/Index.php:126— app/appfront/modules/Checkout/block/onepage/Index.php:126-133 | app/apphtml5/modules/Checkout/block/onepage/Index.php:116-123 | app/appserver/modules/Checkout/block/onepage/Index.php:135-142 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appserver/modules/Checkout/block/onepage/Index.php:143` calls `empty` and `app/appfront/modules/Checkout/block/onepage/Index.php:137` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) app/appfront/modules/Payment/block/paypal/express/Start.php:80— app/appfront/modules/Payment/block/paypal/express/Start.php:80-87 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:77-84 | app/appserver/modules/Payment/block/paypal/express/Start.php:84-91 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Start.php` and `app/apphtml5/modules/Payment/block/paypal/express/Start.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Start.php:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) services/extension/Administer.php:55— services/extension/Administer.php:55-62 | services/extension/Administer.php:166-173 | services/extension/Administer.php:276-283 — 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 `services/extension/Administer.php:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) app/appfront/helper/Country.php:57— app/appfront/helper/Country.php:57-79 | app/apphtml5/helper/Country.php:57-79 — before extracting anything, compare `app/appfront/helper/Country.php` and `app/apphtml5/helper/Country.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) app/appfront/modules/Checkout/controllers/CartController.php:159— app/appfront/modules/Checkout/controllers/CartController.php:159-181 | app/apphtml5/modules/Checkout/controllers/CartController.php:150-172 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/controllers/CartController.php:159` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) app/appfront/modules/Payment/block/paypal/express/Start.php:76— app/appfront/modules/Payment/block/paypal/express/Start.php:76-98 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:73-95 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Start.php` and `app/apphtml5/modules/Payment/block/paypal/express/Start.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 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/console/modules/Category/controllers/MongodatatomysqlController.php:37— app/console/modules/Category/controllers/MongodatatomysqlController.php:37-59 | app/console/modules/Category/controllers/MysqldatatomongoController.php:37-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/console/modules/Category/controllers/MongodatatomysqlController.php:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) services/extension/Administer.php:157— services/extension/Administer.php:157-179 | services/extension/Administer.php:267-289 — both copies are in the same file, so extract the 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 `services/extension/Administer.php:157` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:419— app/appfront/modules/Catalog/block/product/Index.php:419-432 | app/apphtml5/modules/Catalog/block/product/Index.php:408-421 | app/appserver/modules/Catalog/controllers/ProductController.php:651-664 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:419` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appserver/modules/Catalog/controllers/ProductController.php:665` calls `getPrimaryKey` and `app/appfront/modules/Catalog/block/product/Index.php:434` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:535— app/appfront/modules/Catalog/block/product/Index.php:535-548 | app/apphtml5/modules/Catalog/block/product/Index.php:523-536 | app/appserver/modules/Catalog/controllers/ProductController.php:767-780 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appfront/modules/Catalog/block/product/Index.php:534` calls `breadcrumbs` and `app/apphtml5/modules/Catalog/block/product/Index.php:521` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 3) app/appfront/modules/Catalog/block/reviewproduct/Add.php:178— app/appfront/modules/Catalog/block/reviewproduct/Add.php:178-191 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:179-192 | app/appserver/modules/Catalog/block/reviewproduct/Add.php:141-154 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 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 (14 lines × 3) app/appfront/modules/Checkout/block/onepage/Index.php:169— app/appfront/modules/Checkout/block/onepage/Index.php:169-182 | app/apphtml5/modules/Checkout/block/onepage/Index.php:159-172 | app/appserver/modules/Checkout/block/onepage/Index.php:181-194 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) app/appfront/modules/Customer/controllers/FacebookController.php:30— app/appfront/modules/Customer/controllers/FacebookController.php:30-43 | app/apphtml5/modules/Customer/controllers/FacebookController.php:29-42 | app/appserver/modules/Customer/controllers/FacebookController.php:29-42 — before extracting anything, compare `app/appfront/modules/Customer/controllers/FacebookController.php` and `app/apphtml5/modules/Customer/controllers/FacebookController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/FacebookController.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 (13 lines × 3) app/appapi/modules/V1/controllers/ArticleController.php:44— app/appapi/modules/V1/controllers/ArticleController.php:44-56 | app/appapi/modules/V1/controllers/OrderController.php:78-90 | REDACTED:61-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/ArticleController.php:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) app/appfront/modules/Catalog/block/category/Index.php:514— app/appfront/modules/Catalog/block/category/Index.php:514-526 | app/apphtml5/modules/Catalog/block/category/Index.php:501-513 | app/appserver/modules/Catalog/controllers/CategoryController.php:752-764 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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 × 3) app/appfront/modules/Checkout/controllers/CartController.php:110— app/appfront/modules/Checkout/controllers/CartController.php:110-122 | app/apphtml5/modules/Checkout/controllers/CartController.php:105-117 | app/appserver/modules/Checkout/controllers/CartController.php:234-246 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/controllers/CartController.php:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) app/appserver/modules/Catalog/controllers/CategoryController.php:694— app/appserver/modules/Catalog/controllers/CategoryController.php:694-707 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:414-426 | app/appserver/modules/Wx/controllers/HomeController.php:139-152 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/CategoryController.php` and `app/appserver/modules/Catalogsearch/controllers/IndexController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:694` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) app/appfront/modules/Catalog/block/category/Index.php:168— app/appfront/modules/Catalog/block/category/Index.php:168-181 | app/appfront/modules/Catalog/block/category/Index.php:190-202 | app/appfront/modules/Catalogsearch/block/index/Index.php:86-99 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:158— app/appfront/modules/Catalog/block/product/Index.php:158-168 | app/apphtml5/modules/Catalog/block/product/Index.php:147-157 | app/appserver/modules/Catalog/controllers/ProductController.php:388-398 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 3) app/appfront/modules/Customer/block/address/Edit.php:123— app/appfront/modules/Customer/block/address/Edit.php:123-133 | app/appfront/modules/Payment/block/paypal/express/Review.php:191-201 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:191-201 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) app/appserver/modules/Catalog/controllers/CategoryController.php:636— app/appserver/modules/Catalog/controllers/CategoryController.php:636-646 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:361-371 | app/appserver/modules/Cms/controllers/HomeController.php:134-144 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/CategoryController.php` and `app/appserver/modules/Catalogsearch/controllers/IndexController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:636` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) app/appserver/modules/Checkout/controllers/OnepageController.php:30— app/appserver/modules/Checkout/controllers/OnepageController.php:30-40 | app/appserver/modules/Checkout/controllers/OnepageController.php:46-56 | app/appserver/modules/Checkout/controllers/OnepageController.php:63-73 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) REDACTED:564— REDACTED:564-574 | REDACTED:631-641 | REDACTED:684-694 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:564` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) app/appfront/modules/Catalog/block/category/Index.php:496— app/appfront/modules/Catalog/block/category/Index.php:496-504 | app/apphtml5/modules/Catalog/block/category/Index.php:483-491 | app/appserver/modules/Catalog/controllers/CategoryController.php:734-742 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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 × 3) services/Url.php:495— services/Url.php:495-503 | services/url/Category.php:80-88 | services/url/Category.php:163-171 — 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 `services/Url.php:495` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) services/extension/Administer.php:45— services/extension/Administer.php:45-53 | services/extension/Administer.php:156-164 | services/extension/Administer.php:266-274 — 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 `services/extension/Administer.php:45` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) services/search/MongoSearch.php:155— services/search/MongoSearch.php:155-163 | services/search/MysqlSearch.php:94-102 | services/search/XunSearch.php:93-101 — before extracting anything, compare `services/search/MongoSearch.php` and `services/search/MysqlSearch.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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 `services/search/MongoSearch.php:155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) services/Customer.php:360— services/Customer.php:360-368 | services/Order.php:258-266 | services/customer/Address.php:52-60 — 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. 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 × 4) app/appapi/modules/V1/controllers/CategoryController.php:183— app/appapi/modules/V1/controllers/CategoryController.php:183-190 | REDACTED:151-159 | REDACTED:214-222 | services/product/ProductApi.php:389-397 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/CategoryController.php:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 4) app/appfront/modules/Catalog/block/category/Index.php:486— app/appfront/modules/Catalog/block/category/Index.php:486-493 | app/appfront/modules/Catalogsearch/block/index/Index.php:354-361 | app/apphtml5/modules/Catalog/block/category/Index.php:473-480 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:377-384 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 (8 lines × 4) app/appadmin/modules/Fecadmin/controllers/AccountController.php:23— app/appadmin/modules/Fecadmin/controllers/AccountController.php:23-60 | app/appadmin/modules/Fecadmin/controllers/ResourceController.php:23-60 | app/appfront/modules/Customer/controllers/NewsletterController.php:24-31 | app/apphtml5/modules/Customer/controllers/NewsletterController.php:24-31 — before extracting anything, compare `app/appadmin/modules/Fecadmin/controllers/AccountController.php` and `app/appadmin/modules/Fecadmin/controllers/ResourceController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Fecadmin/controllers/AccountController.php:23` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 4) services/Extension.php:77— services/Extension.php:77-84 | services/StoreBaseConfig.php:55-62 | services/StoreDomain.php:55-62 | services/helper/ScriptDate.php:86-93 — before extracting anything, compare `services/Extension.php` and `services/StoreBaseConfig.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 4) services/Extension.php:112— services/Extension.php:112-120 | services/StoreBaseConfig.php:96-103 | services/StoreDomain.php:93-100 | services/helper/ScriptDate.php:112-119 — before extracting anything, compare `services/Extension.php` and `services/StoreBaseConfig.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Low cohesion: ProductController (LCOM4 10) REDACTED:18— ProductController's methods fall into 10 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 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Url (LCOM4 9) services/Url.php:25— Url's methods fall into 9 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 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Extension (LCOM4 8) services/Extension.php:21— Extension's methods fall into 8 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 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Order (LCOM4 5) services/Order.php:23— Order's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Category (LCOM4 4) services/Category.php:25— Category's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplicated block (14 lines × 2 locations) app/appfront/theme/base/front/assets/js/js.js:79— app/appfront/theme/base/front/assets/js/js.js:79 · app/apphtml5/theme/base/html5/assets/js/fec.js:7 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (14 lines × 2 locations) REDACTED:2464— REDACTED:2464 · REDACTED:2544 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) REDACTED:2766— REDACTED:2766 · REDACTED:3398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2 locations) REDACTED:4637— REDACTED:4637 · REDACTED:4654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2 locations) REDACTED:7625— REDACTED:7625 · REDACTED:7652 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (10 lines × 2 locations) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1641— app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1641 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1662 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (10 lines × 2 locations) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1817— app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1817 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1895 — both copies are in the same file, so extract the 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 locations) REDACTED:521— REDACTED:521 · REDACTED:1140 — both copies are in the same file, so extract the 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 locations) REDACTED:4815— REDACTED:4815 · REDACTED:4967 — both copies are in the same file, so extract the 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 locations) REDACTED:5567— REDACTED:5567 · REDACTED:5578 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) app/appfront/theme/base/front/assets/js/owl.carousel.js:125— app/appfront/theme/base/front/assets/js/owl.carousel.js:125 · app/appfront/theme/base/front/assets/js/owl.carousel.js:157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2 locations) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1383— app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1383 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2 locations) REDACTED:1494— REDACTED:1494 · REDACTED:1522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2 locations) REDACTED:2450— REDACTED:2450 · REDACTED:2511 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) REDACTED:5942— REDACTED:5942 · REDACTED:6195 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Index.getTableTbodyHtml (cyclomatic 32) app/appadmin/modules/Catalog/block/urlrewrite/Index.php:131— Index.getTableTbodyHtml has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 32) app/appadmin/modules/Cms/block/article/Index.php:162— Index.getTableTbodyHtml has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 32) app/appadmin/modules/Cms/block/staticblock/Index.php:177— Index.getTableTbodyHtml has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 32) app/appadmin/modules/System/block/error/Index.php:156— Index.getTableTbodyHtml 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.
TodoComment lib/alipay/aop/AlipayMobilePublicMultiMediaClient.php:26— //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 lib/alipay/aop/AlipayMobilePublicMultiMediaClient.php:27— //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 lib/wxpay/example/download.php:14— //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 lib/wxpay/lib/WxPay.Notify.php:44— //TODO 用户基础该类之后需要重写该方法,成功的时候返回true,失败返回false — 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.
Index.getTableTbodyHtml (cognitive 97) app/appadmin/modules/Catalog/block/urlrewrite/Index.php:131— Index.getTableTbodyHtml has cognitive complexity 97 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getTableTbodyHtml (cognitive 97) app/appadmin/modules/Cms/block/article/Index.php:162— Index.getTableTbodyHtml has cognitive complexity 97 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getTableTbodyHtml (cognitive 97) app/appadmin/modules/Cms/block/staticblock/Index.php:177— Index.getTableTbodyHtml has cognitive complexity 97 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getTableTbodyHtml (cognitive 97) app/appadmin/modules/System/block/error/Index.php:156— Index.getTableTbodyHtml has cognitive complexity 97 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getOrderBy (cognitive 21) app/appfront/modules/Catalog/block/category/Index.php:379— Index.getOrderBy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), loops 1 (3 pts), boolean chains 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.
Index.getOrderBy (cognitive 21) app/appfront/modules/Catalogsearch/block/index/Index.php:256— Index.getOrderBy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (4 pts), boolean chains 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.
Index.getOrderBy (cognitive 21) app/apphtml5/modules/Catalog/block/category/Index.php:366— Index.getOrderBy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), loops 1 (3 pts), boolean chains 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.
Index.getOrderBy (cognitive 21) app/apphtml5/modules/Catalogsearch/block/index/Index.php:279— Index.getOrderBy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (4 pts), boolean chains 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.
Index.getNumPerPage (cognitive 19) app/appfront/modules/Catalog/block/category/Index.php:416— Index.getNumPerPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
Index.getNumPerPage (cognitive 19) app/appfront/modules/Catalogsearch/block/index/Index.php:293— Index.getNumPerPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
Index.getNumPerPage (cognitive 19) app/apphtml5/modules/Catalog/block/category/Index.php:403— Index.getNumPerPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
Index.getNumPerPage (cognitive 19) app/apphtml5/modules/Catalogsearch/block/index/Index.php:316— Index.getNumPerPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
Duplicated block (33 lines × 2) app/appfront/modules/Catalog/block/product/CustomOption.php:42— app/appfront/modules/Catalog/block/product/CustomOption.php:42-74 | app/apphtml5/modules/Catalog/block/product/CustomOption.php:42-74 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/CustomOption.php` and `app/apphtml5/modules/Catalog/block/product/CustomOption.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 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/CustomOption.php:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 2) app/appserver/modules/Checkout/block/onepage/Placeorder.php:193— app/appserver/modules/Checkout/block/onepage/Placeorder.php:193-225 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:177-209 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Placeorder.php` and `app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 250 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Checkout/block/onepage/Placeorder.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.
Duplicated block (33 lines × 2) services/product/ProductMongodb.php:400— services/product/ProductMongodb.php:400-432 | services/product/ProductMongodb.php:1299-1331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/product/ProductMongodb.php:400` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 2) services/product/favorite/FavoriteMongodb.php:81— services/product/favorite/FavoriteMongodb.php:81-113 | services/product/favorite/FavoriteMysqldb.php:81-113 — before extracting anything, compare `services/product/favorite/FavoriteMongodb.php` and `services/product/favorite/FavoriteMysqldb.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 2) app/appadmin/modules/Fecadmin/block/log/Index.php:155— app/appadmin/modules/Fecadmin/block/log/Index.php:155-183 | app/appadmin/modules/Fecadmin/block/logtj/Index.php:196-224 — `app/appadmin/modules/Fecadmin/block/log/Index.php` and `app/appadmin/modules/Fecadmin/block/logtj/Index.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 5 separate duplicated blocks between them, totalling at least 72 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/appadmin/modules/Fecadmin/block/log/Index.php:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) app/appfront/modules/Customer/block/LeftMenu.php:22— app/appfront/modules/Customer/block/LeftMenu.php:22-50 | app/apphtml5/modules/Customer/block/LeftMenu.php:22-50 — before extracting anything, compare `app/appfront/modules/Customer/block/LeftMenu.php` and `app/apphtml5/modules/Customer/block/LeftMenu.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.
Duplicated block (29 lines × 2) app/appfront/modules/Customer/controllers/AddressController.php:26— app/appfront/modules/Customer/controllers/AddressController.php:26-54 | app/apphtml5/modules/Customer/controllers/AddressController.php:25-53 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AddressController.php` and `app/apphtml5/modules/Customer/controllers/AddressController.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/AddressController.php:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (29 lines × 2) app/appfront/modules/Customer/controllers/OrderController.php:25— app/appfront/modules/Customer/controllers/OrderController.php:25-53 | app/apphtml5/modules/Customer/controllers/OrderController.php:25-53 — before extracting anything, compare `app/appfront/modules/Customer/controllers/OrderController.php` and `app/apphtml5/modules/Customer/controllers/OrderController.php` as WHOLE FILES: 94% 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/OrderController.php:25` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (25 lines × 2) app/appfront/helper/Country.php:25— app/appfront/helper/Country.php:25-49 | app/apphtml5/helper/Country.php:25-49 — before extracting anything, compare `app/appfront/helper/Country.php` and `app/apphtml5/helper/Country.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) app/appfront/modules/Customer/block/account/Forgotpassword.php:54— app/appfront/modules/Customer/block/account/Forgotpassword.php:54-78 | app/apphtml5/modules/Customer/block/account/Forgotpassword.php:43-67 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Forgotpassword.php` and `app/apphtml5/modules/Customer/block/account/Forgotpassword.php` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/account/Forgotpassword.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. 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) app/appfront/modules/Customer/block/productreview/Index.php:28— app/appfront/modules/Customer/block/productreview/Index.php:28-52 | app/apphtml5/modules/Customer/block/productreview/Index.php:28-52 — before extracting anything, compare `app/appfront/modules/Customer/block/productreview/Index.php` and `app/apphtml5/modules/Customer/block/productreview/Index.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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 after the matched lines, `app/appfront/modules/Customer/block/productreview/Index.php:53` calls `breadcrumbs`, `__` and `app/apphtml5/modules/Customer/block/productreview/Index.php:54` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25 lines × 2) app/appfront/modules/Payment/block/paypal/express/Placeorder.php:40— app/appfront/modules/Payment/block/paypal/express/Placeorder.php:40-64 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:40-64 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Placeorder.php` and `app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 188 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Placeorder.php:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) app/appadmin/modules/AppadminbaseBlock.php:520— app/appadmin/modules/AppadminbaseBlock.php:520-534 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:175-189 | app/appadmin/modules/Customer/block/contacts/Index.php:165-179 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/productbrand/Manager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:520` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:111— app/appfront/modules/Catalog/block/product/Index.php:111-125 | app/apphtml5/modules/Catalog/block/product/Index.php:100-114 | app/appserver/modules/Catalog/controllers/ProductController.php:341-355 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) app/appfront/modules/Customer/block/productreview/Index.php:26— app/appfront/modules/Customer/block/productreview/Index.php:26-40 | app/apphtml5/modules/Customer/block/productreview/Index.php:26-40 | app/appserver/modules/Customer/controllers/ProductreviewController.php:31-45 — before extracting anything, compare `app/appfront/modules/Customer/block/productreview/Index.php` and `app/apphtml5/modules/Customer/block/productreview/Index.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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 after the matched lines, `app/appfront/modules/Customer/block/productreview/Index.php:42` calls `getProductPage` and `app/appserver/modules/Customer/controllers/ProductreviewController.php:46` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 3) app/appfront/modules/Payment/block/paypal/express/Placeorder.php:59— app/appfront/modules/Payment/block/paypal/express/Placeorder.php:59-73 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:59-73 | app/appserver/modules/Payment/block/paypal/express/Placeorder.php:65-79 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Placeorder.php` and `app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 188 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) app/appadmin/modules/Catalog/block/categoryupload/Manager.php:88— app/appadmin/modules/Catalog/block/categoryupload/Manager.php:88-98 | app/appadmin/modules/Catalog/block/productupload/Manager.php:85-94 — `app/appadmin/modules/Catalog/block/categoryupload/Manager.php` and `app/appadmin/modules/Catalog/block/productupload/Manager.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 3 separate duplicated blocks between them, totalling at least 32 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.
Duplicated block (10–11 lines × 2) app/appadmin/modules/Fecadmin/block/account/Manageredit.php:200— app/appadmin/modules/Fecadmin/block/account/Manageredit.php:200-210 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:134-143 — `app/appadmin/modules/Fecadmin/block/account/Manageredit.php` and `app/appadmin/modules/Fecadmin/block/config/Manageredit.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 4 separate duplicated blocks between them, totalling at least 80 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/appadmin/modules/Fecadmin/block/account/Manageredit.php:200` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 2) services/cms/article/ArticleMongodb.php:125— services/cms/article/ArticleMongodb.php:125-134 | services/cms/article/ArticleMysqldb.php:154-164 — before extracting anything, compare `services/cms/article/ArticleMongodb.php` and `services/cms/article/ArticleMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 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 `services/cms/article/ArticleMongodb.php:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) services/product/ProductMongodb.php:492— services/product/ProductMongodb.php:492-502 | services/product/ProductMysqldb.php:587-596 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:492` it does not close everything it opens, so those exact lines 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 × 6) app/appadmin/modules/Catalog/block/urlrewrite/Index.php:133— app/appadmin/modules/Catalog/block/urlrewrite/Index.php:133-141 | app/appadmin/modules/Cms/block/article/Index.php:164-172 | app/appadmin/modules/Cms/block/staticblock/Index.php:179-187 | app/appadmin/modules/Sales/block/coupon/Manager.php:196-204 | app/appadmin/modules/System/block/error/Index.php:158-166 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:202-210 — before extracting anything, compare `app/appadmin/modules/Catalog/block/urlrewrite/Index.php` and `app/appadmin/modules/Cms/block/article/Index.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/urlrewrite/Index.php:133` it does not close everything it opens, so those exact lines 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 × 6) app/appapi/modules/V1/controllers/ArticleController.php:135— app/appapi/modules/V1/controllers/ArticleController.php:135-143 | app/appapi/modules/V1/controllers/ArticleController.php:197-205 | app/appapi/modules/V1/controllers/CategoryController.php:253-261 | app/appapi/modules/V1/controllers/CategoryController.php:354-362 | app/appapi/modules/V1/controllers/CategoryController.php:473-481 | REDACTED:275-283 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/ArticleController.php:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 6) app/appfront/modules/Payment/controllers/paypal/ExpressController.php:65— app/appfront/modules/Payment/controllers/paypal/ExpressController.php:65-73 | app/appfront/modules/Payment/controllers/paypal/StandardController.php:49-57 | app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php:64-72 | app/apphtml5/modules/Payment/controllers/paypal/StandardController.php:47-55 | app/appserver/modules/Payment/controllers/paypal/ExpressController.php:64-72 | app/appserver/modules/Payment/controllers/paypal/StandardController.php:62-70 — before extracting anything, compare `app/appfront/modules/Payment/controllers/paypal/ExpressController.php` and `app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php` as WHOLE FILES: 94% 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 (9 lines × 6) lib/wxpay/lib/WxPay.Api.php:83— lib/wxpay/lib/WxPay.Api.php:83-92 | lib/wxpay/lib/WxPay.Api.php:114-123 | lib/wxpay/lib/WxPay.Api.php:154-162 | lib/wxpay/lib/WxPay.Api.php:190-199 | lib/wxpay/lib/WxPay.Api.php:288-298 | lib/wxpay/lib/WxPay.Api.php:386-395 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/wxpay/lib/WxPay.Api.php:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) services/product/ProductMongodb.php:426— services/product/ProductMongodb.php:426-432 | services/product/ProductMongodb.php:1325-1331 | services/product/ProductMysqldb.php:519-525 | services/product/ProductMysqldb.php:1521-1527 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:426` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) services/product/ProductMongodb.php:750— services/product/ProductMongodb.php:750-756 | services/product/ProductMongodb.php:761-767 | services/product/ProductMysqldb.php:899-905 | services/product/ProductMysqldb.php:910-916 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:750` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) app/appfront/modules/Checkout/block/onepage/Index.php:268— app/appfront/modules/Checkout/block/onepage/Index.php:268-274 | app/appfront/modules/Payment/block/paypal/express/Review.php:210-216 | app/apphtml5/modules/Checkout/block/onepage/Index.php:258-264 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:210-216 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 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 × 4) services/product/review/ReviewMongodb.php:207— services/product/review/ReviewMongodb.php:207-213 | services/product/review/ReviewMongodb.php:468-474 | services/product/review/ReviewMysqldb.php:223-229 | services/product/review/ReviewMysqldb.php:481-487 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:334— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:334-339 | app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:360-364 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:333-338 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:359-363 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) services/category/CategoryMongodb.php:309— services/category/CategoryMongodb.php:309-313 | services/category/CategoryMongodb.php:325-329 | services/category/CategoryMysqldb.php:369-373 | services/category/CategoryMysqldb.php:387-391 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/category/CategoryMysqldb.php:375` calls `removeCategoryProductRelationByCategoryId` and `services/category/CategoryMongodb.php:314` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) services/product/ProductMongodb.php:793— services/product/ProductMongodb.php:793-797 | services/product/ProductMongodb.php:814-818 | services/product/ProductMysqldb.php:942-946 | services/product/ProductMysqldb.php:962-966 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:793` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) services/payment/Wxpay.php:96— services/payment/Wxpay.php:96-100 | services/payment/WxpayH5.php:89-93 | services/payment/WxpayJsApi.php:93-97 | services/payment/WxpayMicro.php:91-95 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2 locations) REDACTED:227— REDACTED:227 · REDACTED:234 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) REDACTED:2157— REDACTED:2157 · REDACTED:2219 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) REDACTED:2512— REDACTED:2512 · REDACTED:2551 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) REDACTED:2795— REDACTED:2795 · REDACTED:3413 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X19 · Unrestored process-global state· Process-global state is restored only on the happy path · ×4
Process-global state is restored only on the happy path services/payment/WxpayMicro.php:215— `getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 218, put back at line 220) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
Process-global state is restored only on the happy path services/payment/WxpayJsApi.php:230— `getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 233, put back at line 235) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
Process-global state is restored only on the happy path services/payment/WxpayH5.php:244— `getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 247, put back at line 249) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
Process-global state is restored only on the happy path services/payment/Wxpay.php:236— `getShangHaiExpireTime` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the default timezone (changed at line 239, put back at line 241) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
sm.$.initSwipePanels::handleTouchMove (cyclomatic 40) REDACTED:6723— sm.$.initSwipePanels::handleTouchMove has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (sm.$.initSwipePanels::handleTouchStart, sm.$.initSwipePanels::handleTouchEnd) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
sm.$.initSwipePanels::handleTouchEnd (cyclomatic 26) REDACTED:6825— sm.$.initSwipePanels::handleTouchEnd has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (sm.$.initSwipePanels::handleTouchStart, sm.$.initSwipePanels::handleTouchMove) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
sm.$.initSwipePanels::handleTouchStart (cyclomatic 25) REDACTED:6687— sm.$.initSwipePanels::handleTouchStart has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (sm.$.initSwipePanels::handleTouchMove, sm.$.initSwipePanels::handleTouchEnd) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Review.initAddress (cyclomatic 37) app/appfront/modules/Payment/block/paypal/express/Review.php:70— Review.initAddress has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Review.initAddress (cyclomatic 37) app/apphtml5/modules/Payment/block/paypal/express/Review.php:70— Review.initAddress has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Review.initAddress (cyclomatic 37) app/appserver/modules/Payment/block/paypal/express/Review.php:85— Review.initAddress has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Placeorder.checkOrderInfoAndInit (cyclomatic 22) app/appfront/modules/Checkout/block/onepage/Placeorder.php:226— Placeorder.checkOrderInfoAndInit 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.
Placeorder.checkOrderInfoAndInit (cyclomatic 22) app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:213— Placeorder.checkOrderInfoAndInit 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.
Placeorder.checkOrderInfoAndInit (cyclomatic 22) app/appserver/modules/Checkout/block/onepage/Placeorder.php:247— Placeorder.checkOrderInfoAndInit 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.
Review.initAddress (cognitive 81) app/appfront/modules/Payment/block/paypal/express/Review.php:70— Review.initAddress has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (68 pts), boolean chains 11, loops 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Review.initAddress (cognitive 81) app/apphtml5/modules/Payment/block/paypal/express/Review.php:70— Review.initAddress has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (68 pts), boolean chains 11, loops 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Review.initAddress (cognitive 81) app/appserver/modules/Payment/block/paypal/express/Review.php:85— Review.initAddress has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (68 pts), boolean chains 11, loops 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Placeorder.checkOrderInfoAndInit (cognitive 43) app/appfront/modules/Checkout/block/onepage/Placeorder.php:226— Placeorder.checkOrderInfoAndInit has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 1 (5 pts), ternaries 5, boolean chains 2 (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.
Placeorder.checkOrderInfoAndInit (cognitive 43) app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:213— Placeorder.checkOrderInfoAndInit has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 1 (5 pts), ternaries 5, boolean chains 2 (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.
Placeorder.checkOrderInfoAndInit (cognitive 43) app/appserver/modules/Checkout/block/onepage/Placeorder.php:247— Placeorder.checkOrderInfoAndInit has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 1 (5 pts), ternaries 5, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getPayment (cognitive 28) app/appfront/modules/Checkout/block/onepage/Index.php:383— Index.getPayment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getPayment (cognitive 28) app/apphtml5/modules/Checkout/block/onepage/Index.php:375— Index.getPayment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getPayment (cognitive 28) app/appserver/modules/Checkout/block/onepage/Index.php:407— Index.getPayment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Review.getCartInfo (cognitive 23) app/appfront/modules/Payment/block/paypal/express/Review.php:224— Review.getCartInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), loops 1 (3 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.
Review.getCartInfo (cognitive 23) app/apphtml5/modules/Payment/block/paypal/express/Review.php:224— Review.getCartInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), loops 1 (3 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.
Review.getCartInfo (cognitive 23) app/appserver/modules/Payment/block/paypal/express/Review.php:244— Review.getCartInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), loops 1 (3 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.
Review.getPayment (cognitive 21) app/appfront/modules/Payment/block/paypal/express/Review.php:325— Review.getPayment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Review.getPayment (cognitive 21) app/apphtml5/modules/Payment/block/paypal/express/Review.php:325— Review.getPayment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Review.getPayment (cognitive 21) app/appserver/modules/Payment/block/paypal/express/Review.php:346— Review.getPayment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Start.checkStockQty (cognitive 17) app/appfront/modules/Payment/block/paypal/express/Start.php:75— Start.checkStockQty has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Start.checkStockQty (cognitive 17) app/apphtml5/modules/Payment/block/paypal/express/Start.php:72— Start.checkStockQty has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Start.checkStockQty (cognitive 17) app/appserver/modules/Payment/block/paypal/express/Start.php:77— Start.checkStockQty has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (9 members, 50+ identical tokens) app/appfront/modules/Checkout/block/cart/Index.php:113— app/appfront/modules/Checkout/block/cart/Index.php:113-139 | app/appfront/modules/Checkout/block/onepage/Index.php:284-311 | app/appfront/modules/Payment/block/paypal/express/Review.php:226-253 | app/apphtml5/modules/Checkout/block/cart/Index.php:102-128 | app/apphtml5/modules/Checkout/block/onepage/Index.php:274-301 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:226-253 | app/appserver/modules/Checkout/block/onepage/Index.php:305-335 | app/appserver/modules/Checkout/controllers/CartController.php:73-111 | app/appserver/modules/Payment/block/paypal/express/Review.php:246-274 — 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.
Members sharing a duplicated core (9 members, 50+ identical tokens) app/appfront/modules/Checkout/block/onepage/Index.php:82— app/appfront/modules/Checkout/block/onepage/Index.php:82-232 | app/appfront/modules/Payment/block/paypal/express/Review.php:72-174 | app/appfront/modules/Payment/block/paypal/express/Review.php:428-461 | app/apphtml5/modules/Checkout/block/onepage/Index.php:72-222 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:72-174 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:428-461 | app/appserver/modules/Checkout/block/onepage/Index.php:91-244 | app/appserver/modules/Payment/block/paypal/express/Review.php:87-189 | app/appserver/modules/Payment/block/paypal/express/Review.php:463-489 — 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.
Members sharing a duplicated core (9 members, 50+ identical tokens) app/appfront/modules/Customer/block/account/Forgotpassword.php:46— app/appfront/modules/Customer/block/account/Forgotpassword.php:46-78 | app/appfront/modules/Customer/block/account/Login.php:50-86 | app/appfront/modules/Customer/block/account/Register.php:52-76 | app/appfront/modules/Customer/block/contacts/Index.php:70-121 | app/apphtml5/modules/Customer/block/account/Forgotpassword.php:35-67 | app/apphtml5/modules/Customer/block/account/Login.php:40-76 | app/apphtml5/modules/Customer/block/account/Register.php:45-67 | app/apphtml5/modules/Customer/block/contacts/Index.php:71-121 | app/appserver/modules/Customer/block/account/Login.php:40-61 — 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.
Duplicated block (34 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:651— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:651-684 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:608-641 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:651` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34 lines × 2) app/appfront/modules/Catalog/block/reviewproduct/Add.php:127— app/appfront/modules/Catalog/block/reviewproduct/Add.php:127-160 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:128-161 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 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 (34 lines × 2) app/appfront/modules/Catalog/helpers/Review.php:45— app/appfront/modules/Catalog/helpers/Review.php:45-78 | app/apphtml5/modules/Catalog/helpers/Review.php:44-77 — before extracting anything, compare `app/appfront/modules/Catalog/helpers/Review.php` and `app/apphtml5/modules/Catalog/helpers/Review.php` as WHOLE FILES: 94% 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.
Duplicated block (31 lines × 2) app/appfront/modules/Catalogsearch/block/index/Index.php:153— app/appfront/modules/Catalogsearch/block/index/Index.php:153-183 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:176-206 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalogsearch/block/index/Index.php:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) app/appfront/modules/Catalogsearch/block/index/Index.php:258— app/appfront/modules/Catalogsearch/block/index/Index.php:258-288 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:281-311 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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 (31 lines × 2) models/mysqldb/adminUser/AdminUserAccessToken.php:30— models/mysqldb/adminUser/AdminUserAccessToken.php:30-60 | models/mysqldb/customer/CustomerAccessToken.php:45-75 — before extracting anything, compare `models/mysqldb/adminUser/AdminUserAccessToken.php` and `models/mysqldb/customer/CustomerAccessToken.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 `models/mysqldb/adminUser/AdminUserAccessToken.php:30` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (26 lines × 2) REDACTED:351— REDACTED:351-376 | REDACTED:474-499 — both copies are in the same file, so extract the 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 (26 lines × 2) services/customer/newsletter/NewsletterMongodb.php:101— services/customer/newsletter/NewsletterMongodb.php:101-126 | services/customer/newsletter/NewsletterMysqldb.php:102-127 — before extracting anything, compare `services/customer/newsletter/NewsletterMongodb.php` and `services/customer/newsletter/NewsletterMysqldb.php` as WHOLE FILES: 94% 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) services/product/review/ReviewMongodb.php:305— services/product/review/ReviewMongodb.php:305-330 | services/product/review/ReviewMysqldb.php:320-345 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 `services/product/review/ReviewMongodb.php:305` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22–23 lines × 2) services/Request.php:43— services/Request.php:43-65 | yii/web/Request.php:31-52 — before extracting anything, compare `services/Request.php` and `yii/web/Request.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 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 (22–23 lines × 2) services/category/CategoryMongodb.php:363— services/category/CategoryMongodb.php:363-385 | services/category/CategoryMysqldb.php:428-449 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 2) services/product/Brand.php:159— services/product/Brand.php:159-181 | services/product/Brandcategory.php:159-180 — before extracting anything, compare `services/product/Brand.php` and `services/product/Brandcategory.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 144 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 × 4) app/appadmin/modules/Customer/block/account/Manageredit.php:109— app/appadmin/modules/Customer/block/account/Manageredit.php:109-129 | app/appadmin/modules/Customer/block/contacts/Manageredit.php:99-119 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:47-67 | app/appadmin/modules/Fecadmin/block/resource/Manageredit.php:94-114 — `app/appadmin/modules/Customer/block/account/Manageredit.php` and `app/appadmin/modules/Customer/block/contacts/Manageredit.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 2 separate duplicated blocks between them, totalling at least 42 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.
Duplicated block (21 lines × 4) app/appadmin/modules/System/controllers/ExtensionmarketController.php:203— app/appadmin/modules/System/controllers/ExtensionmarketController.php:203-223 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:308-328 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:393-413 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:486-506 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/System/controllers/ExtensionmarketController.php:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 4) app/appapi/modules/V1/controllers/ProductattrController.php:93— app/appapi/modules/V1/controllers/ProductattrController.php:93-113 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:92-112 | app/appapi/modules/V1/controllers/ProductbrandController.php:207-227 | app/appapi/modules/V1/controllers/ProductbrandcategoryController.php:194-214 — before extracting anything, compare `app/appapi/modules/V1/controllers/ProductattrController.php` and `app/appapi/modules/V1/controllers/ProductattrgroupController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appapi/modules/V1/controllers/ProductbrandController.php:206` calls `getByPrimaryKey` and `app/appapi/modules/V1/controllers/ProductattrController.php:91` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:385— app/appfront/modules/Catalog/block/product/Index.php:385-404 | app/apphtml5/modules/Catalog/block/product/Index.php:374-393 | app/appserver/modules/Catalog/controllers/ProductController.php:617-636 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 3) app/appfront/modules/Payment/block/paypal/standard/Placeorder.php:163— app/appfront/modules/Payment/block/paypal/standard/Placeorder.php:163-182 | app/apphtml5/modules/Payment/block/paypal/standard/Placeorder.php:163-182 | app/appserver/modules/Payment/block/paypal/standard/Placeorder.php:177-196 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/standard/Placeorder.php` and `app/apphtml5/modules/Payment/block/paypal/standard/Placeorder.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 110 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 (20 lines × 3) services/product/ProductMongodb.php:378— services/product/ProductMongodb.php:378-397 | services/product/ProductMongodb.php:517-536 | services/product/ProductMongodb.php:1252-1271 — 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 `services/product/ProductMongodb.php:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 6) app/appfront/modules/Catalog/block/category/Index.php:424— app/appfront/modules/Catalog/block/category/Index.php:424-442 | app/appfront/modules/Catalogsearch/block/index/Index.php:298-316 | app/apphtml5/modules/Catalog/block/category/Index.php:411-429 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:321-339 | app/appserver/modules/Catalog/controllers/CategoryController.php:561-579 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:295-313 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:424` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (19 lines × 6) app/appfront/modules/Catalog/controllers/CategoryController.php:60— app/appfront/modules/Catalog/controllers/CategoryController.php:60-78 | app/appfront/modules/Cms/controllers/ArticleController.php:59-77 | app/apphtml5/modules/Catalog/controllers/CategoryController.php:50-68 | app/apphtml5/modules/Cms/controllers/ArticleController.php:47-65 | app/appserver/modules/Catalog/controllers/CategoryController.php:68-86 | app/appserver/modules/Cms/controllers/ArticleController.php:63-81 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/CategoryController.php` and `app/appfront/modules/Cms/controllers/ArticleController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/controllers/CategoryController.php:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 6) services/email/Customer.php:76— services/email/Customer.php:76-94 | services/email/Customer.php:113-131 | services/email/Customer.php:150-168 | services/email/Customer.php:212-230 | services/email/Customer.php:251-269 | services/email/Order.php:54-72 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `services/email/Customer.php:76` it does not close everything it opens, so those 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, `services/email/Customer.php:232` calls `addCustomerContacts` and `services/email/Customer.php:95` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 3) app/appapi/modules/V1/controllers/ArticleController.php:200— app/appapi/modules/V1/controllers/ArticleController.php:200-216 | app/appapi/modules/V1/controllers/CategoryController.php:262-278 | app/appapi/modules/V1/controllers/CategoryController.php:363-379 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (17 lines × 3) services/product/ProductMongodb.php:366— services/product/ProductMongodb.php:366-382 | services/product/ProductMongodb.php:1240-1256 | services/product/ProductMysqldb.php:467-483 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 3) services/Order.php:1117— services/Order.php:1117-1133 | services/helper/ScriptDate.php:227-243 | services/helper/ScriptDate.php:252-269 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (16–17 lines × 2) app/appserver/modules/Catalog/controllers/ProductController.php:146— app/appserver/modules/Catalog/controllers/ProductController.php:146-161 | app/appserver/modules/Catalog/controllers/ProductController.php:164-180 — both copies are in the same file, so extract the 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/appserver/modules/Catalog/controllers/ProductController.php:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) app/appserver/modules/Checkout/block/onepage/Placeorder.php:74— app/appserver/modules/Checkout/block/onepage/Placeorder.php:74-89 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:55-71 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Placeorder.php` and `app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 250 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Checkout/block/onepage/Placeorder.php:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) app/appserver/modules/Customer/controllers/LoginController.php:172— app/appserver/modules/Customer/controllers/LoginController.php:172-188 | app/appserver/modules/Customer/controllers/LoginController.php:270-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.
Duplicated block (14 lines × 4) app/appfront/modules/Checkout/block/onepage/Placeorder.php:270— app/appfront/modules/Checkout/block/onepage/Placeorder.php:270-283 | app/appfront/modules/Payment/block/paypal/express/Placeorder.php:215-228 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:257-270 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:215-228 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 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 (14 lines × 4) services/payment/Wxpay.php:370— services/payment/Wxpay.php:370-383 | services/payment/WxpayH5.php:381-394 | services/payment/WxpayJsApi.php:368-381 | services/payment/WxpayMicro.php:353-366 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 4) app/appfront/modules/Customer/controllers/FacebookController.php:82— app/appfront/modules/Customer/controllers/FacebookController.php:82-95 | app/appfront/modules/Customer/controllers/GoogleController.php:58-71 | app/apphtml5/modules/Customer/controllers/FacebookController.php:83-96 | app/apphtml5/modules/Customer/controllers/GoogleController.php:58-71 — before extracting anything, compare `app/appfront/modules/Customer/controllers/FacebookController.php` and `app/apphtml5/modules/Customer/controllers/FacebookController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 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–14 lines × 2) app/appfront/modules/Checkout/controllers/CartController.php:102— app/appfront/modules/Checkout/controllers/CartController.php:102-114 | app/apphtml5/modules/Checkout/controllers/CartController.php:96-109 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/controllers/CartController.php:102` it begins part-way through the construct above it, so those exact lines 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) app/appinstall/modules/Database/controllers/ConfigController.php:660— app/appinstall/modules/Database/controllers/ConfigController.php:660-672 | services/Helper.php:242-255 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/appinstall/modules/Database/controllers/ConfigController.php:660` it does not close everything it opens, so those 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, `services/Helper.php:256` calls `add` and `app/appinstall/modules/Database/controllers/ConfigController.php:674` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 2) services/product/ProductMongodb.php:808— services/product/ProductMongodb.php:808-821 | services/product/ProductMysqldb.php:957-969 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:808` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 4) app/appfront/modules/Catalogsearch/block/index/Index.php:239— app/appfront/modules/Catalogsearch/block/index/Index.php:239-251 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:262-274 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:272-284 | services/Category.php:456-468 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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 × 4) app/appfront/modules/Catalogsearch/block/index/Index.php:332— app/appfront/modules/Catalogsearch/block/index/Index.php:332-344 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:355-367 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:330-342 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:393-405 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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 × 4) app/appfront/modules/Checkout/controllers/ReorderController.php:45— app/appfront/modules/Checkout/controllers/ReorderController.php:45-57 | app/appfront/modules/Customer/block/order/Reorder.php:41-53 | app/apphtml5/modules/Customer/block/order/Reorder.php:41-53 | app/appserver/modules/Customer/controllers/OrderController.php:353-365 — before extracting anything, compare `app/appfront/modules/Customer/block/order/Reorder.php` and `app/apphtml5/modules/Customer/block/order/Reorder.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 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 (12 lines × 5) app/appfront/modules/Checkout/block/onepage/Index.php:300— app/appfront/modules/Checkout/block/onepage/Index.php:300-311 | app/appfront/modules/Payment/block/paypal/express/Review.php:242-253 | app/apphtml5/modules/Checkout/block/onepage/Index.php:290-301 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:242-253 | app/appserver/modules/Payment/block/paypal/express/Review.php:263-274 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 5) services/Extension.php:132— services/Extension.php:132-143 | services/StoreBaseConfig.php:126-137 | services/StoreDomain.php:128-139 | services/admin/RoleUrlKey.php:109-120 | services/helper/ScriptDate.php:130-141 — before extracting anything, compare `services/Extension.php` and `services/StoreBaseConfig.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `services/Extension.php:132` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/Extension.php:129` calls `getCurrentDateTime` and `services/helper/ScriptDate.php:127` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 5) app/appserver/modules/Catalog/Module.php:25— app/appserver/modules/Catalog/Module.php:25-36 | app/appserver/modules/Cms/Module.php:25-36 | app/appserver/modules/Customer/Module.php:25-36 | app/appserver/modules/Payment/Module.php:25-36 | app/appserver/modules/Wx/Module.php:25-36 — `app/appserver/modules/Catalog/Module.php` and `app/appserver/modules/Cms/Module.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 12 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.
Duplicated block (11–12 lines × 4) app/appfront/modules/Catalog/block/category/Index.php:287— app/appfront/modules/Catalog/block/category/Index.php:287-298 | app/appfront/modules/Catalogsearch/block/index/Index.php:148-159 | app/apphtml5/modules/Catalog/block/category/Index.php:275-285 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:171-182 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 4) app/appfront/modules/Checkout/controllers/CartController.php:100— app/appfront/modules/Checkout/controllers/CartController.php:100-110 | app/appfront/modules/Checkout/controllers/CartController.php:157-167 | app/apphtml5/modules/Checkout/controllers/CartController.php:94-105 | app/apphtml5/modules/Checkout/controllers/CartController.php:148-158 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 after the matched lines, `app/appfront/modules/Checkout/controllers/CartController.php:111` calls `htmlEncode` and `app/appfront/modules/Checkout/controllers/CartController.php:168` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 4) app/appfront/modules/Payment/block/paypal/express/Start.php:23— app/appfront/modules/Payment/block/paypal/express/Start.php:23-33 | app/appfront/modules/Payment/block/paypal/express/Start.php:52-63 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:22-32 | app/apphtml5/modules/Payment/block/paypal/express/Start.php:49-60 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Start.php` and `app/apphtml5/modules/Payment/block/paypal/express/Start.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Start.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) lib/wxpay/lib/WxPay.Api.php:80— lib/wxpay/lib/WxPay.Api.php:80-90 | lib/wxpay/lib/WxPay.Api.php:285-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) lib/wxpay/lib/WxPay.Api.php:157— lib/wxpay/lib/WxPay.Api.php:157-167 | lib/wxpay/lib/WxPay.Api.php:292-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–12 lines × 2) services/product/ProductMongodb.php:1004— services/product/ProductMongodb.php:1004-1015 | services/product/ProductMongodb.php:1058-1068 — both copies are in the same file, so extract the 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–11 lines × 4) app/appfront/modules/Catalog/block/reviewproduct/Add.php:65— app/appfront/modules/Catalog/block/reviewproduct/Add.php:65-75 | app/appfront/modules/Catalog/block/reviewproduct/Lists.php:87-96 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:66-76 | app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php:87-96 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 4) services/Product.php:207— services/Product.php:207-216 | services/Product.php:228-238 | services/Product.php:245-254 | services/Product.php:301-311 — 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 (10–11 lines × 4) services/product/Brand.php:144— services/product/Brand.php:144-154 | services/product/Brand.php:179-188 | services/product/Brandcategory.php:144-154 | services/product/Brandcategory.php:178-187 — before extracting anything, compare `services/product/Brand.php` and `services/product/Brandcategory.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 144 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 `services/product/Brand.php:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 6) app/appfront/modules/Catalog/block/category/Index.php:495— app/appfront/modules/Catalog/block/category/Index.php:495-501 | app/appfront/modules/Catalogsearch/block/index/Index.php:364-370 | app/apphtml5/modules/Catalog/block/category/Index.php:482-488 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:387-393 | app/appserver/modules/Catalog/controllers/CategoryController.php:733-739 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:453-459 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 × 6) app/appfront/modules/Checkout/block/onepage/Index.php:126— app/appfront/modules/Checkout/block/onepage/Index.php:126-132 | app/appfront/modules/Payment/block/paypal/express/Review.php:163-169 | app/apphtml5/modules/Checkout/block/onepage/Index.php:116-122 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:163-169 | app/appserver/modules/Checkout/block/onepage/Index.php:135-141 | app/appserver/modules/Payment/block/paypal/express/Review.php:178-184 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) app/appfront/modules/Catalog/block/product/Review.php:38— app/appfront/modules/Catalog/block/product/Review.php:38-45 | app/appfront/modules/Catalog/block/reviewproduct/Add.php:30-36 | app/appfront/modules/Catalog/block/reviewproduct/Lists.php:36-42 | app/apphtml5/modules/Catalog/block/product/Review.php:36-43 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:30-36 | app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php:36-43 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Review.php` and `app/apphtml5/modules/Catalog/block/product/Review.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 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 × 3) app/appapi/modules/V1/controllers/ArticleController.php:36— app/appapi/modules/V1/controllers/ArticleController.php:36-42 | app/appapi/modules/V1/controllers/ProductattrController.php:38-44 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:38-44 — before extracting anything, compare `app/appapi/modules/V1/controllers/ProductattrController.php` and `app/appapi/modules/V1/controllers/ProductattrgroupController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/ArticleController.php:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) app/appfront/modules/Checkout/controllers/CartController.php:48— app/appfront/modules/Checkout/controllers/CartController.php:48-54 | app/apphtml5/modules/Checkout/controllers/CartController.php:44-50 | app/appserver/modules/Checkout/controllers/CartController.php:155-161 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) app/appfront/modules/Payment/block/paypal/express/Review.php:72— app/appfront/modules/Payment/block/paypal/express/Review.php:72-78 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:72-78 | app/appserver/modules/Payment/block/paypal/express/Review.php:87-93 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Review.php:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) app/appapi/modules/V1/controllers/ArticleController.php:118— app/appapi/modules/V1/controllers/ArticleController.php:118-123 | app/appapi/modules/V1/controllers/ArticleController.php:183-188 | app/appapi/modules/V1/controllers/CategoryController.php:139-145 | app/appapi/modules/V1/controllers/CategoryController.php:236-242 | app/appapi/modules/V1/controllers/CategoryController.php:337-343 | app/appapi/modules/V1/controllers/CategoryController.php:440-446 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) app/appfront/modules/Checkout/block/onepage/Index.php:248— app/appfront/modules/Checkout/block/onepage/Index.php:248-253 | app/appfront/modules/Customer/block/address/Edit.php:122-127 | app/appfront/modules/Payment/block/paypal/express/Review.php:190-195 | app/apphtml5/modules/Checkout/block/onepage/Index.php:238-243 | app/apphtml5/modules/Customer/block/address/Edit.php:112-117 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:190-195 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:248` it does not close everything it opens, so those exact lines 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 × 6) app/appfront/modules/Catalog/block/reviewproduct/Add.php:168— app/appfront/modules/Catalog/block/reviewproduct/Add.php:168-173 | app/appfront/modules/Catalog/block/reviewproduct/Lists.php:161-166 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:169-174 | app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php:163-168 | app/appserver/modules/Catalog/block/reviewproduct/Add.php:131-136 | app/appserver/modules/Catalog/block/reviewproduct/Lists.php:168-173 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 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 (6 lines × 4) app/appfront/modules/Checkout/block/onepage/Placeorder.php:228— app/appfront/modules/Checkout/block/onepage/Placeorder.php:228-233 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:215-220 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:249-254 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:233-238 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.php:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) lib/alipay/lotusphp_runtime/MVC/Action.php:196— lib/alipay/lotusphp_runtime/MVC/Action.php:196-201 | lib/alipay/lotusphp_runtime/MVC/Action.php:220-225 | lib/alipay/lotusphp_runtime/MVC/Component.php:94-99 | lib/alipay/lotusphp_runtime/MVC/Component.php:118-123 — 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 (6 lines × 4) services/payment/Wxpay.php:238— services/payment/Wxpay.php:238-243 | services/payment/WxpayH5.php:246-251 | services/payment/WxpayJsApi.php:232-237 | services/payment/WxpayMicro.php:217-222 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (100 lines × 2) lib/alipay/aop/request/AlipayAssetAccountGetRequest.php:33— lib/alipay/aop/request/AlipayAssetAccountGetRequest.php:33-132 | lib/alipay/aop/request/AlipayAssetAccountUnbindRequest.php:32-131 — before extracting anything, compare `lib/alipay/aop/request/AlipayAssetAccountGetRequest.php` and `lib/alipay/aop/request/AlipayAssetAccountUnbindRequest.php` as WHOLE FILES: 83% 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 `lib/alipay/aop/request/AlipayAssetAccountGetRequest.php:33` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (100 lines × 2) lib/alipay/aop/request/AlipayOfflineMarketShopPublicBindRequest.php:32— lib/alipay/aop/request/AlipayOfflineMarketShopPublicBindRequest.php:32-131 | lib/alipay/aop/request/AlipayOfflineMarketShopPublicUnbindRequest.php:32-131 — 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 `lib/alipay/aop/request/AlipayOfflineMarketShopPublicBindRequest.php:32` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (100 lines × 2) lib/alipay/aop/request/AlipayOfflineMaterialImageUploadRequest.php:42— lib/alipay/aop/request/AlipayOfflineMaterialImageUploadRequest.php:42-163 | lib/alipay/aop/request/AntMerchantExpandImageUploadRequest.php:32-131 — 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 `lib/alipay/aop/request/AlipayOfflineMaterialImageUploadRequest.php:42` 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.
Outbound HTTP without resilience REDACTED:231— `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 lib/google/lib/io/Google_IO.php:557— `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 lib/google/lib/io/Google_IO.php:564— `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.
Duplicated block (13 lines × 2 locations) REDACTED:238— REDACTED:238 · REDACTED:252 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (13 lines × 2 locations) REDACTED:2894— REDACTED:2894 · REDACTED:3479 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (13 lines × 2 locations) REDACTED:7141— REDACTED:7141 · REDACTED:7325 — both copies are in the same file, so extract the 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 locations) REDACTED:2531— REDACTED:2531 · REDACTED:2570 — both copies are in the same file, so extract the 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 locations) REDACTED:5754— REDACTED:5754 · REDACTED:5765 — both copies are in the same file, so extract the 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 locations) REDACTED:5883— REDACTED:5883 · REDACTED:5895 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:607— app/apphtml5/theme/base/html5/assets/js/sm-extend.js:607 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:617 — both copies are in the same file, so extract the 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 locations) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2057— app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2057 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2066 — both copies are in the same file, so extract the 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 locations) REDACTED:2439— REDACTED:2439 · REDACTED:2497 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Index.initAddress (cyclomatic 50) app/appfront/modules/Checkout/block/onepage/Index.php:78— Index.initAddress has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.initAddress (cyclomatic 50) app/apphtml5/modules/Checkout/block/onepage/Index.php:68— Index.initAddress has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 34) app/appadmin/modules/Catalog/block/productfavorite/Index.php:140— Index.getTableTbodyHtml has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 34) app/appadmin/modules/Catalog/block/productreview/Index.php:219— Index.getTableTbodyHtml has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Manager.getTableTbodyHtml (cyclomatic 32) app/appadmin/modules/Sales/block/coupon/Manager.php:194— Manager.getTableTbodyHtml 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.
Manager.getTableTbodyHtml (cyclomatic 32) app/appadmin/modules/System/block/extensioninstalled/Manager.php:200— Manager.getTableTbodyHtml 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.
Calendar::monthHTML (cyclomatic 28) REDACTED:2261— Calendar::monthHTML 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. This is NOT this file's highest cyclomatic complexity: handleEvent (cyclomatic 29) 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.
Calendar::setYearMonth (cyclomatic 27) REDACTED:2595— Calendar::setYearMonth 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. This is NOT this file's highest cyclomatic complexity: handleEvent (cyclomatic 29) 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.
Page.getLastData (cyclomatic 27) app/appfront/widgets/Page.php:26— Page.getLastData has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Page.getLastData (cyclomatic 27) app/apphtml5/widgets/Page.php:26— Page.getLastData has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CustomOption.getAllItems (cyclomatic 26) app/appfront/modules/Catalog/block/product/CustomOption.php:40— CustomOption.getAllItems has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CustomOption.getAllItems (cyclomatic 26) app/apphtml5/modules/Catalog/block/product/CustomOption.php:40— CustomOption.getAllItems has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getSameSpuInfo (cyclomatic 26) app/appfront/modules/Catalog/block/product/Index.php:285— Index.getSameSpuInfo has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getSameSpuInfo (cyclomatic 26) app/apphtml5/modules/Catalog/block/product/Index.php:274— Index.getSameSpuInfo has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getGroupAttrArr (cyclomatic 25) app/appfront/modules/Catalog/block/product/Index.php:110— Index.getGroupAttrArr has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getGroupAttrArr (cyclomatic 25) app/apphtml5/modules/Catalog/block/product/Index.php:99— Index.getGroupAttrArr has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.saveAccount (cyclomatic 24) app/appfront/modules/Customer/block/editaccount/Index.php:46— Index.saveAccount has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.saveAccount (cyclomatic 24) app/apphtml5/modules/Customer/block/editaccount/Index.php:36— Index.saveAccount 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.
Manageredit.getEditBar (cyclomatic 20) app/appadmin/modules/Fecadmin/block/account/Manageredit.php:199— Manageredit.getEditBar 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.
Manageredit.getEditBar (cyclomatic 20) app/appadmin/modules/Fecadmin/block/config/Manageredit.php:133— Manageredit.getEditBar 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.
Add.saveReview (cyclomatic 19) app/appfront/modules/Catalog/block/reviewproduct/Add.php:99— Add.saveReview 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.
Add.saveReview (cyclomatic 19) app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:100— Add.saveReview has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Index.getSpuAttrInfo (cyclomatic 18) app/appfront/modules/Catalog/block/product/Index.php:383— Index.getSpuAttrInfo has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getSpuAttrInfo (cyclomatic 18) app/apphtml5/modules/Catalog/block/product/Index.php:372— Index.getSpuAttrInfo has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.saveContactsInfo (cyclomatic 18) app/appfront/modules/Customer/block/contacts/Index.php:68— Index.saveContactsInfo has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.saveContactsInfo (cyclomatic 18) app/apphtml5/modules/Customer/block/contacts/Index.php:69— Index.saveContactsInfo 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.
Edit.initAddress (cyclomatic 16) app/appfront/modules/Customer/block/address/Edit.php:25— Edit.initAddress 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.
Edit.initAddress (cyclomatic 16) app/apphtml5/modules/Customer/block/address/Edit.php:25— Edit.initAddress has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cognitive 104) app/appadmin/modules/Catalog/block/productfavorite/Index.php:140— Index.getTableTbodyHtml has cognitive complexity 104 (threshold 15). Drivers by points: if/else 12 (63 pts), ternaries 5 (29 pts), loops 4 (9 pts), boolean chains 3 (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.
Index.getTableTbodyHtml (cognitive 104) app/appadmin/modules/Catalog/block/productreview/Index.php:219— Index.getTableTbodyHtml has cognitive complexity 104 (threshold 15). Drivers by points: if/else 12 (63 pts), ternaries 5 (29 pts), loops 4 (9 pts), boolean chains 3 (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.
Manager.getTableTbodyHtml (cognitive 97) app/appadmin/modules/Sales/block/coupon/Manager.php:194— Manager.getTableTbodyHtml has cognitive complexity 97 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Manager.getTableTbodyHtml (cognitive 97) app/appadmin/modules/System/block/extensioninstalled/Manager.php:200— Manager.getTableTbodyHtml has cognitive complexity 97 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.initAddress (cognitive 92) app/appfront/modules/Checkout/block/onepage/Index.php:78— Index.initAddress has cognitive complexity 92 (threshold 15). Drivers by points: if/else 35 (77 pts), boolean chains 13, loops 1 (2 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.initAddress (cognitive 92) app/apphtml5/modules/Checkout/block/onepage/Index.php:68— Index.initAddress has cognitive complexity 92 (threshold 15). Drivers by points: if/else 35 (77 pts), boolean chains 13, loops 1 (2 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Manageredit.getEditBar (cognitive 75) app/appadmin/modules/Fecadmin/block/account/Manageredit.php:199— Manageredit.getEditBar has cognitive complexity 75 (threshold 15). Drivers by points: if/else 15 (45 pts), ternaries 7 (21 pts), loops 2 (9 pts) (nesting depth added 51). 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.
Manageredit.getEditBar (cognitive 75) app/appadmin/modules/Fecadmin/block/config/Manageredit.php:133— Manageredit.getEditBar has cognitive complexity 75 (threshold 15). Drivers by points: if/else 15 (45 pts), ternaries 7 (21 pts), loops 2 (9 pts) (nesting depth added 51). 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.
CustomOption.getAllItems (cognitive 71) app/appfront/modules/Catalog/block/product/CustomOption.php:40— CustomOption.getAllItems has cognitive complexity 71 (threshold 15). Drivers by points: if/else 11 (41 pts), loops 5 (15 pts), boolean chains 8, ternaries 1 (7 pts) (nesting depth added 46). 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.
CustomOption.getAllItems (cognitive 71) app/apphtml5/modules/Catalog/block/product/CustomOption.php:40— CustomOption.getAllItems has cognitive complexity 71 (threshold 15). Drivers by points: if/else 11 (41 pts), loops 5 (15 pts), boolean chains 8, ternaries 1 (7 pts) (nesting depth added 46). 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.
initSwipePanels::handleTouchMove (cognitive 67) REDACTED:6723— initSwipePanels::handleTouchMove has cognitive complexity 67 (threshold 15). Drivers by points: if/else 28 (52 pts), ternaries 6 (9 pts), boolean chains 6 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
initSwipePanels::handleTouchStart (cognitive 38) REDACTED:6687— initSwipePanels::handleTouchStart has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 7, ternaries 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getGroupAttrArr (cognitive 55) app/appfront/modules/Catalog/block/product/Index.php:110— Index.getGroupAttrArr has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 9, loops 1 (2 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.
Index.getGroupAttrArr (cognitive 55) app/apphtml5/modules/Catalog/block/product/Index.php:99— Index.getGroupAttrArr has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 9, loops 1 (2 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.
Index.saveAccount (cognitive 55) app/appfront/modules/Customer/block/editaccount/Index.php:46— Index.saveAccount has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (28 pts), ternaries 6 (12 pts), loops 2 (10 pts), boolean chains 5 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.saveAccount (cognitive 55) app/apphtml5/modules/Customer/block/editaccount/Index.php:36— Index.saveAccount has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (28 pts), ternaries 6 (12 pts), loops 2 (10 pts), boolean chains 5 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getSameSpuInfo (cognitive 53) app/appfront/modules/Catalog/block/product/Index.php:285— Index.getSameSpuInfo has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 8 (15 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getSameSpuInfo (cognitive 53) app/apphtml5/modules/Catalog/block/product/Index.php:274— Index.getSameSpuInfo has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 8 (15 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getSpuAttrInfo (cognitive 47) app/appfront/modules/Catalog/block/product/Index.php:383— Index.getSpuAttrInfo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (13 pts), boolean chains 3 (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.
Index.getSpuAttrInfo (cognitive 47) app/apphtml5/modules/Catalog/block/product/Index.php:372— Index.getSpuAttrInfo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (13 pts), boolean chains 3 (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.
Placeorder.getLastData (cognitive 46) app/appfront/modules/Payment/block/paypal/express/Placeorder.php:38— Placeorder.getLastData has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (35 pts), error handling 2 (10 pts), boolean chains 1 (nesting depth added 31). 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.
Placeorder.getLastData (cognitive 46) app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:38— Placeorder.getLastData has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (35 pts), error handling 2 (10 pts), boolean chains 1 (nesting depth added 31). 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.
Review.getReviewAndStarCount (cognitive 31) app/appfront/modules/Catalog/helpers/Review.php:41— Review.getReviewAndStarCount has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6 (13 pts) (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.
Review.getReviewAndStarCount (cognitive 31) app/apphtml5/modules/Catalog/helpers/Review.php:40— Review.getReviewAndStarCount has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6 (13 pts) (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.
PhotoBrowser::onSlideTouchMove (cognitive 27) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:3158— PhotoBrowser::onSlideTouchMove has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 9, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PhotoBrowser::onSliderTransitionStart (cognitive 16) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2942— PhotoBrowser::onSliderTransitionStart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Edit.initAddress (cognitive 26) app/appfront/modules/Customer/block/address/Edit.php:25— Edit.initAddress has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (5 pts), boolean chains 4, 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.
Edit.initAddress (cognitive 26) app/apphtml5/modules/Customer/block/address/Edit.php:25— Edit.initAddress has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (5 pts), boolean chains 4, 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.
Index.saveContactsInfo (cognitive 24) app/appfront/modules/Customer/block/contacts/Index.php:68— Index.saveContactsInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 5 (9 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.saveContactsInfo (cognitive 24) app/apphtml5/modules/Customer/block/contacts/Index.php:69— Index.saveContactsInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 5 (9 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getCartInfo (cognitive 23) app/appfront/modules/Checkout/block/onepage/Index.php:282— Index.getCartInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getCartInfo (cognitive 23) app/apphtml5/modules/Checkout/block/onepage/Index.php:272— Index.getCartInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), loops 1 (3 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.
Page.getLastData (cognitive 23) app/appfront/widgets/Page.php:26— Page.getLastData has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 4 (8 pts), boolean chains 3, ternaries 1 (nesting depth added 6). 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.
Page.getLastData (cognitive 23) app/apphtml5/widgets/Page.php:26— Page.getLastData has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 4 (8 pts), boolean chains 3, ternaries 1 (nesting depth added 6). 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.
CategoryController.behaviors (cognitive 20) app/apphtml5/modules/Catalog/controllers/CategoryController.php:36— CategoryController.behaviors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CategoryController.behaviors (cognitive 20) app/appserver/modules/Catalog/controllers/CategoryController.php:54— CategoryController.behaviors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProductController.behaviors (cognitive 20) app/apphtml5/modules/Catalog/controllers/ProductController.php:36— ProductController.behaviors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProductController.behaviors (cognitive 20) app/appserver/modules/Catalog/controllers/ProductController.php:47— ProductController.behaviors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArticleController.behaviors (cognitive 20) app/apphtml5/modules/Cms/controllers/ArticleController.php:33— ArticleController.behaviors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArticleController.behaviors (cognitive 20) app/appserver/modules/Cms/controllers/ArticleController.php:49— ArticleController.behaviors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getRefineByInfo (cognitive 18) app/appfront/modules/Catalog/block/category/Index.php:285— Index.getRefineByInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getRefineByInfo (cognitive 18) app/apphtml5/modules/Catalog/block/category/Index.php:273— Index.getRefineByInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.sortSpuAttr (cognitive 17) app/appfront/modules/Catalog/block/product/Index.php:456— Index.sortSpuAttr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.sortSpuAttr (cognitive 17) app/apphtml5/modules/Catalog/block/product/Index.php:444— Index.sortSpuAttr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Add.saveReview (cognitive 17) app/appfront/modules/Catalog/block/reviewproduct/Add.php:99— Add.saveReview has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 6, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Add.saveReview (cognitive 17) app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:100— Add.saveReview has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 6, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Login.login (cognitive 17) app/appfront/modules/Customer/block/account/Login.php:48— Login.login has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Login.login (cognitive 17) app/apphtml5/modules/Customer/block/account/Login.php:38— Login.login has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getCartInfo (cognitive 16) app/appfront/modules/Checkout/block/cart/Index.php:111— Index.getCartInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getCartInfo (cognitive 16) app/apphtml5/modules/Checkout/block/cart/Index.php:100— Index.getCartInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FunctionTooLong: sm-extend.Swiper app/apphtml5/theme/base/html5/assets/js/sm-extend.js:15— FunctionTooLong — Swiper runs 1572 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1472 over it, 15.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: sm-extend.PhotoBrowser app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2769— FunctionTooLong — PhotoBrowser runs 393 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 293 over it, 3.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) app/appserver/modules/Catalog/controllers/CategoryController.php:595— app/appserver/modules/Catalog/controllers/CategoryController.php:595-655 | app/appserver/modules/Cms/controllers/HomeController.php:106-153 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) services/product/ProductMysqldb.php:1158— services/product/ProductMysqldb.php:1158-1193 | services/product/ProductMysqldb.php:1231-1298 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (30 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (30 members, 50+ identical tokens) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:198— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:198-212 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:125-139 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:207-221 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:338-352 | app/appadmin/modules/Config/block/appfronthome/Manager.php:131-145 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:192-206 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:197-211 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:122-136 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:205-219 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:339-353 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:121-135 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:179-193 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:198-212 | app/appadmin/modules/Config/block/appserverbase/Manager.php:99-113 | app/appadmin/modules/Config/block/appservercache/Manager.php:206-220 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:313-327 | app/appadmin/modules/Config/block/appserverhome/Manager.php:91-105 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:181-195 | app/appadmin/modules/Config/block/appserverstore/Manager.php:179-193 | app/appadmin/modules/Config/block/base/Manager.php:199-213 | app/appadmin/modules/Config/block/cart/Manager.php:105-119 | app/appadmin/modules/Config/block/email/Manager.php:417-431 | app/appadmin/modules/Config/block/fa/Manager.php:136-150 | app/appadmin/modules/Config/block/order/Manager.php:148-162 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:185-199 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:160-174 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:155-169 | app/appadmin/modules/Config/block/product/Manager.php:146-160 | app/appadmin/modules/Config/block/search/Manager.php:121-135 | app/appadmin/modules/Config/block/service/Db.php:188-203 — These 30 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 30 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 30 times.
Members sharing a duplicated core (30 members, 50+ identical tokens) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:245— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:245-255 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:172-182 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:254-264 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:385-395 | app/appadmin/modules/Config/block/appfronthome/Manager.php:178-188 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:239-249 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:244-254 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:169-179 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:252-262 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:386-396 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:168-178 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:226-236 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:245-255 | app/appadmin/modules/Config/block/appserverbase/Manager.php:146-156 | app/appadmin/modules/Config/block/appservercache/Manager.php:253-263 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:360-370 | app/appadmin/modules/Config/block/appserverhome/Manager.php:138-148 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:228-238 | app/appadmin/modules/Config/block/appserverstore/Manager.php:226-236 | app/appadmin/modules/Config/block/base/Manager.php:246-256 | app/appadmin/modules/Config/block/cart/Manager.php:152-162 | app/appadmin/modules/Config/block/email/Manager.php:464-474 | app/appadmin/modules/Config/block/fa/Manager.php:183-193 | app/appadmin/modules/Config/block/order/Manager.php:195-205 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:232-242 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:207-217 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:202-212 | app/appadmin/modules/Config/block/product/Manager.php:193-203 | app/appadmin/modules/Config/block/search/Manager.php:168-178 | app/appadmin/modules/Config/block/service/Db.php:236-246 — These 30 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 30 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 30 times.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (10 members, 50+ identical tokens) app/appfront/modules/Catalog/controllers/CategoryController.php:42— app/appfront/modules/Catalog/controllers/CategoryController.php:42-95 | app/appfront/modules/Catalog/controllers/ProductController.php:41-94 | app/appfront/modules/Cms/controllers/ArticleController.php:35-93 | app/apphtml5/modules/Catalog/controllers/CategoryController.php:38-84 | app/apphtml5/modules/Catalog/controllers/ProductController.php:38-84 | app/apphtml5/modules/Cms/controllers/ArticleController.php:35-82 | app/appserver/modules/Catalog/controllers/CategoryController.php:56-103 | app/appserver/modules/Catalog/controllers/ProductController.php:49-95 | app/appserver/modules/Cms/controllers/ArticleController.php:51-98 | app/appserver/modules/General/controllers/BaseController.php:23-59 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) app/appfront/modules/Checkout/block/cart/Index.php:147— app/appfront/modules/Checkout/block/cart/Index.php:147-168 | app/appfront/modules/Checkout/block/onepage/Index.php:319-340 | app/appfront/modules/Payment/block/paypal/express/Review.php:261-282 | app/apphtml5/modules/Checkout/block/cart/Index.php:136-157 | app/apphtml5/modules/Checkout/block/onepage/Index.php:309-330 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:261-282 | app/appserver/modules/Checkout/block/onepage/Index.php:343-364 | app/appserver/modules/Checkout/controllers/CartController.php:119-140 | app/appserver/modules/Payment/block/paypal/express/Review.php:282-303 | services/order/Item.php:205-225 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) app/appfront/modules/Checkout/block/onepage/Placeorder.php:228— app/appfront/modules/Checkout/block/onepage/Placeorder.php:228-325 | app/appfront/modules/Payment/block/paypal/express/Placeorder.php:208-247 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:215-310 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:208-247 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:249-331 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:233-315 | app/appserver/modules/Payment/block/paypal/express/Placeorder.php:245-301 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) services/Extension.php:154— services/Extension.php:154-170 | services/StoreBaseConfig.php:169-187 | services/StoreDomain.php:150-166 | services/admin/RoleUrlKey.php:209-225 | services/helper/ScriptDate.php:151-167 | services/product/Brand.php:193-209 | services/product/Brandcategory.php:194-210 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (81 lines × 2) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:502— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:502-582 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:459-539 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:502` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (81 lines × 2) app/appfront/modules/Payment/block/paypal/express/Placeorder.php:66— app/appfront/modules/Payment/block/paypal/express/Placeorder.php:66-146 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:66-146 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Placeorder.php` and `app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 188 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Placeorder.php:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (45–49 lines × 2) app/appadmin/modules/Fecadmin/block/account/Manageredit.php:211— app/appadmin/modules/Fecadmin/block/account/Manageredit.php:211-259 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:144-188 — `app/appadmin/modules/Fecadmin/block/account/Manageredit.php` and `app/appadmin/modules/Fecadmin/block/config/Manageredit.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 4 separate duplicated blocks between them, totalling at least 80 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/appadmin/modules/Fecadmin/block/account/Manageredit.php:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (45–49 lines × 2) services/Extension.php:461— services/Extension.php:461-505 | services/Extension.php:510-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (43 lines × 2) app/appadmin/modules/AppadminbaseBlock.php:349— app/appadmin/modules/AppadminbaseBlock.php:349-391 | app/appadmin/modules/Catalog/block/category/Product.php:239-281 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:349` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (43 lines × 2) app/appapi/modules/V1/controllers/ProductattrController.php:127— app/appapi/modules/V1/controllers/ProductattrController.php:127-169 | app/appapi/modules/V1/controllers/ProductattrController.php:229-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (42 lines × 2) app/appfront/modules/Checkout/block/onepage/Placeorder.php:115— app/appfront/modules/Checkout/block/onepage/Placeorder.php:115-156 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:102-143 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.php:115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (42 lines × 2) app/appfront/modules/Customer/block/address/Edit.php:27— app/appfront/modules/Customer/block/address/Edit.php:27-68 | app/apphtml5/modules/Customer/block/address/Edit.php:27-68 — before extracting anything, compare `app/appfront/modules/Customer/block/address/Edit.php` and `app/apphtml5/modules/Customer/block/address/Edit.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (38 lines × 2) app/appserver/modules/Checkout/block/onepage/Placeorder.php:141— app/appserver/modules/Checkout/block/onepage/Placeorder.php:141-178 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:125-162 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Placeorder.php` and `app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 250 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 (38 lines × 2) app/appadmin/modules/Fecadmin/controllers/AccountController.php:23— app/appadmin/modules/Fecadmin/controllers/AccountController.php:23-60 | app/appadmin/modules/Fecadmin/controllers/ResourceController.php:23-60 — before extracting anything, compare `app/appadmin/modules/Fecadmin/controllers/AccountController.php` and `app/appadmin/modules/Fecadmin/controllers/ResourceController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Fecadmin/controllers/AccountController.php:23` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (37 lines × 2) services/search/MongoSearch.php:367— services/search/MongoSearch.php:367-403 | services/search/XunSearch.php:260-296 — before extracting anything, compare `services/search/MongoSearch.php` and `services/search/XunSearch.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 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 `services/search/MongoSearch.php:367` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37 lines × 2) models/mongodb/product/Favorite.php:25— models/mongodb/product/Favorite.php:25-61 | models/mongodb/product/Review.php:30-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `models/mongodb/product/Favorite.php:25` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (36 lines × 2) app/appfront/modules/Catalog/block/product/Index.php:399— app/appfront/modules/Catalog/block/product/Index.php:399-434 | app/apphtml5/modules/Catalog/block/product/Index.php:388-423 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:399` it begins part-way through the construct above it, so those exact lines 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) services/cart/QuoteItem.php:373— services/cart/QuoteItem.php:373-408 | services/order/Item.php:244-279 — 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 (34–35 lines × 2) app/appapi/modules/V1/controllers/CategoryimageController.php:29— app/appapi/modules/V1/controllers/CategoryimageController.php:29-63 | app/appapi/modules/V1/controllers/ProductimageController.php:29-62 — before extracting anything, compare `app/appapi/modules/V1/controllers/CategoryimageController.php` and `app/appapi/modules/V1/controllers/ProductimageController.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (34–35 lines × 2) services/product/ProductMongodb.php:1360— services/product/ProductMongodb.php:1360-1394 | services/product/ProductMysqldb.php:1567-1600 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 (35 lines × 2) app/appfront/modules/Checkout/block/onepage/Placeorder.php:171— app/appfront/modules/Checkout/block/onepage/Placeorder.php:171-205 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:158-192 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.php:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (35 lines × 2) components/AppfrontErrorHandler.php:67— components/AppfrontErrorHandler.php:67-101 | components/AppserverErrorHandler.php:60-94 — before extracting anything, compare `components/AppfrontErrorHandler.php` and `components/AppserverErrorHandler.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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. 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 (28 lines × 2) app/appfront/modules/Catalog/block/product/Review.php:78— app/appfront/modules/Catalog/block/product/Review.php:78-105 | app/apphtml5/modules/Catalog/block/product/Review.php:76-103 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Review.php` and `app/apphtml5/modules/Catalog/block/product/Review.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) app/appfront/modules/Catalog/block/reviewproduct/Lists.php:98— app/appfront/modules/Catalog/block/reviewproduct/Lists.php:98-125 | app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php:98-125 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Lists.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/reviewproduct/Lists.php:98` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (24–27 lines × 2) app/appadmin/modules/AppadminbaseBlock.php:272— app/appadmin/modules/AppadminbaseBlock.php:272-295 | app/appadmin/modules/Catalog/block/category/Product.php:487-513 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–27 lines × 2) app/appfront/modules/Cms/controllers/HomeController.php:44— app/appfront/modules/Cms/controllers/HomeController.php:44-67 | app/apphtml5/modules/Cms/controllers/HomeController.php:31-57 — before extracting anything, compare `app/appfront/modules/Cms/controllers/HomeController.php` and `app/apphtml5/modules/Cms/controllers/HomeController.php` as WHOLE FILES: 89% 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Cms/controllers/HomeController.php:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 3) REDACTED:151— REDACTED:151-175 | REDACTED:214-238 | services/product/ProductApi.php:389-413 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (25 lines × 3) app/appfront/modules/Catalog/controllers/ProductController.php:100— app/appfront/modules/Catalog/controllers/ProductController.php:100-124 | app/apphtml5/modules/Catalog/controllers/ProductController.php:90-114 | app/appserver/modules/Catalog/controllers/ProductController.php:859-883 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/ProductController.php` and `app/apphtml5/modules/Catalog/controllers/ProductController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 108 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, `app/appserver/modules/Catalog/controllers/ProductController.php:856` calls `getMethod` and `app/appfront/modules/Catalog/controllers/ProductController.php:99` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23–25 lines × 2) app/appfront/modules/Customer/block/account/Register.php:52— app/appfront/modules/Customer/block/account/Register.php:52-76 | app/apphtml5/modules/Customer/block/account/Register.php:45-67 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Register.php` and `app/apphtml5/modules/Customer/block/account/Register.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 (23–25 lines × 2) REDACTED:319— REDACTED:319-341 | REDACTED:438-462 — both copies are in the same file, so extract the 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 × 3) app/appfront/modules/Checkout/block/onepage/Index.php:491— app/appfront/modules/Checkout/block/onepage/Index.php:491-514 | app/apphtml5/modules/Checkout/block/onepage/Index.php:483-506 | app/appserver/modules/Checkout/block/onepage/Index.php:515-538 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:491` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 3) app/appserver/modules/Catalog/controllers/CategoryController.php:80— app/appserver/modules/Catalog/controllers/CategoryController.php:80-103 | app/appserver/modules/Catalog/controllers/ProductController.php:72-95 | app/appserver/modules/Cms/controllers/ArticleController.php:75-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:511— app/appfront/modules/Catalog/block/product/Index.php:511-532 | app/apphtml5/modules/Catalog/block/product/Index.php:499-520 | app/appserver/modules/Catalog/controllers/ProductController.php:743-764 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:511` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appfront/modules/Catalog/block/product/Index.php:534` calls `breadcrumbs` and `app/apphtml5/modules/Catalog/block/product/Index.php:523` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 3) app/appfront/modules/Payment/block/paypal/express/Review.php:334— app/appfront/modules/Payment/block/paypal/express/Review.php:334-355 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:334-355 | app/appserver/modules/Payment/block/paypal/express/Review.php:355-376 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Review.php:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 2) services/Request.php:73— services/Request.php:73-93 | yii/web/Request.php:60-81 — before extracting anything, compare `services/Request.php` and `yii/web/Request.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 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–22 lines × 2) services/product/ProductMongodb.php:785— services/product/ProductMongodb.php:785-806 | services/product/ProductMysqldb.php:934-954 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:785` it does not close everything it opens, so those 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, `services/product/ProductMysqldb.php:955` calls `removeCategoryProductRelationByProductId` and `services/product/ProductMongodb.php:807` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19–20 lines × 2) app/appadmin/modules/AppadminbaseBlock.php:251— app/appadmin/modules/AppadminbaseBlock.php:251-269 | app/appadmin/modules/Catalog/block/category/Product.php:465-484 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–20 lines × 2) services/Request.php:95— services/Request.php:95-114 | yii/web/Request.php:94-112 — before extracting anything, compare `services/Request.php` and `yii/web/Request.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 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 `services/Request.php:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/Request.php:94` calls `getOriginUrl` and `yii/web/Request.php:93` 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 (19 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:463— app/appfront/modules/Catalog/block/product/Index.php:463-481 | app/apphtml5/modules/Catalog/block/product/Index.php:451-469 | app/appserver/modules/Catalog/controllers/ProductController.php:695-713 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 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 (19 lines × 3) app/appfront/modules/Catalog/controllers/ProductController.php:59— app/appfront/modules/Catalog/controllers/ProductController.php:59-77 | app/apphtml5/modules/Catalog/controllers/ProductController.php:50-68 | app/appserver/modules/Catalog/controllers/ProductController.php:60-78 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/ProductController.php` and `app/apphtml5/modules/Catalog/controllers/ProductController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/controllers/ProductController.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.
Duplicated block (17–18 lines × 2) app/appapi/modules/V1/controllers/ArticleController.php:136— app/appapi/modules/V1/controllers/ArticleController.php:136-153 | app/appapi/modules/V1/controllers/ArticleController.php:198-214 — both copies are in the same file, so extract the 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/appapi/modules/V1/controllers/ArticleController.php:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) app/appserver/modules/Catalog/controllers/ProductController.php:809— app/appserver/modules/Catalog/controllers/ProductController.php:809-825 | app/appserver/modules/Cms/controllers/HomeController.php:108-125 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/ProductController.php` and `app/appserver/modules/Cms/controllers/HomeController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/ProductController.php:809` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) app/appfront/modules/Customer/controllers/AccountController.php:92— app/appfront/modules/Customer/controllers/AccountController.php:92-107 | app/apphtml5/modules/Customer/controllers/AccountController.php:100-114 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AccountController.php` and `app/apphtml5/modules/Customer/controllers/AccountController.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/AccountController.php:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/apphtml5/modules/Customer/controllers/AccountController.php:116` calls `loginSuccessRedirect` and `app/appfront/modules/Customer/controllers/AccountController.php:108` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–16 lines × 2) services/cms/article/ArticleMysqldb.php:227— services/cms/article/ArticleMysqldb.php:227-242 | services/url/rewrite/RewriteMysqldb.php:158-172 — before extracting anything, compare `services/cms/article/ArticleMysqldb.php` and `services/url/rewrite/RewriteMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `services/cms/article/ArticleMysqldb.php:227` it begins part-way through the construct above it, so those 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, `services/cms/article/ArticleMysqldb.php:226` calls `removeRewriteUrlKey` and `services/url/rewrite/RewriteMysqldb.php:157` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) services/Image.php:227— services/Image.php:227-241 | services/helper/ZipFile.php:112-125 — 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 (14–15 lines × 2) services/Url.php:92— services/Url.php:92-105 | services/Url.php:147-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) services/order/Item.php:122— services/order/Item.php:122-134 | services/order/Item.php:151-165 — both copies are in the same file, so extract the 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 `services/order/Item.php:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) services/product/ProductMysqldb.php:541— services/product/ProductMysqldb.php:541-553 | services/product/ProductMysqldb.php:1544-1558 — both copies are in the same file, so extract the 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 `services/product/ProductMysqldb.php:541` it begins part-way through the construct above it, so those 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, `services/product/ProductMysqldb.php:554` calls `foreach`, `unserialize` and `services/product/ProductMysqldb.php:1560` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 6) app/appadmin/modules/AppadminbaseBlock.php:453— app/appadmin/modules/AppadminbaseBlock.php:453-466 | app/appadmin/modules/Catalog/block/category/Product.php:438-451 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:236-249 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:217-230 | app/appadmin/modules/Customer/block/newsletter/Index.php:146-159 | app/appadmin/modules/System/block/error/Index.php:262-275 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:453` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appadmin/modules/AppadminbaseBlock.php:469` calls `__` and `app/appadmin/modules/Catalog/block/category/Product.php:455` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 6) services/Extension.php:157— services/Extension.php:157-170 | services/StoreDomain.php:153-166 | services/admin/RoleUrlKey.php:212-225 | services/helper/ScriptDate.php:154-167 | services/product/Brand.php:196-209 | services/product/Brandcategory.php:197-210 — before extracting anything, compare `services/Extension.php` and `services/StoreDomain.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 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 `services/Extension.php:157` it begins part-way through the construct above it, so those 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 × 6) app/appfront/modules/Checkout/block/onepage/Index.php:105— app/appfront/modules/Checkout/block/onepage/Index.php:105-117 | app/appfront/modules/Payment/block/paypal/express/Review.php:142-154 | app/apphtml5/modules/Checkout/block/onepage/Index.php:95-107 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:142-154 | app/appserver/modules/Checkout/block/onepage/Index.php:114-126 | app/appserver/modules/Payment/block/paypal/express/Review.php:157-169 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 6) services/admin/Config.php:44— services/admin/Config.php:44-56 | services/admin/RoleUrlKey.php:48-60 | services/admin/SystemLog.php:54-66 | services/adminUser/AdminUser.php:81-93 | services/product/Brand.php:51-63 | services/product/Brandcategory.php:51-63 — before extracting anything, compare `services/admin/RoleUrlKey.php` and `services/product/Brand.php` as WHOLE FILES: this scan already matched 5 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. 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 (12 lines × 4) app/appfront/modules/Payment/PaymentController.php:27— app/appfront/modules/Payment/PaymentController.php:27-38 | app/apphtml5/modules/Payment/PaymentController.php:27-38 | app/apphtml5/modules/Payment/controllers/Wxpayh5Controller.php:28-39 | app/apphtml5/modules/Payment/controllers/WxpayjsapiController.php:28-39 — before extracting anything, compare `app/appfront/modules/Payment/PaymentController.php` and `app/apphtml5/modules/Payment/PaymentController.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) app/appadmin/modules/Catalog/Module.php:22— app/appadmin/modules/Catalog/Module.php:22-33 | app/appadmin/modules/Cms/Module.php:22-33 | app/appadmin/modules/Config/Module.php:22-33 | app/appadmin/modules/Customer/Module.php:22-33 — `app/appadmin/modules/Catalog/Module.php` and `app/appadmin/modules/Cms/Module.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 12 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.
Duplicated block (11 lines × 8) REDACTED:138— REDACTED:138-148 | REDACTED:159-169 | REDACTED:369-379 | REDACTED:389-399 | REDACTED:533-543 | REDACTED:553-563 | REDACTED:574-584 | REDACTED:594-604 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 8) app/appfront/modules/Customer/controllers/AddressController.php:26— app/appfront/modules/Customer/controllers/AddressController.php:26-54 | app/appfront/modules/Customer/controllers/OrderController.php:25-53 | app/appfront/modules/Customer/controllers/PointController.php:25-35 | app/appfront/modules/Customer/controllers/ProductreviewController.php:25-35 | app/apphtml5/modules/Customer/controllers/AddressController.php:25-53 | app/apphtml5/modules/Customer/controllers/OrderController.php:25-53 | app/apphtml5/modules/Customer/controllers/PointController.php:25-35 | app/apphtml5/modules/Customer/controllers/ProductreviewController.php:25-35 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AddressController.php` and `app/appfront/modules/Customer/controllers/PointController.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/AddressController.php:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 6) app/appfront/modules/Checkout/block/onepage/Index.php:213— app/appfront/modules/Checkout/block/onepage/Index.php:213-223 | app/appfront/modules/Payment/block/paypal/express/Review.php:109-119 | app/apphtml5/modules/Checkout/block/onepage/Index.php:203-213 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:109-119 | app/appserver/modules/Checkout/block/onepage/Index.php:225-235 | app/appserver/modules/Payment/block/paypal/express/Review.php:124-134 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 6) app/appfront/modules/Checkout/block/onepage/Index.php:296— app/appfront/modules/Checkout/block/onepage/Index.php:296-306 | app/appfront/modules/Payment/block/paypal/express/Review.php:238-248 | app/apphtml5/modules/Checkout/block/onepage/Index.php:286-296 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:238-248 | app/appserver/modules/Checkout/block/onepage/Index.php:318-328 | app/appserver/modules/Payment/block/paypal/express/Review.php:259-269 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:296` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 6) app/appfront/modules/Checkout/block/onepage/Index.php:85— app/appfront/modules/Checkout/block/onepage/Index.php:85-94 | app/appfront/modules/Payment/block/paypal/express/Review.php:122-131 | app/apphtml5/modules/Checkout/block/onepage/Index.php:75-84 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:122-131 | app/appserver/modules/Checkout/block/onepage/Index.php:94-103 | app/appserver/modules/Payment/block/paypal/express/Review.php:137-146 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 6) services/category/CategoryMongodb.php:187— services/category/CategoryMongodb.php:187-196 | services/category/CategoryMongodb.php:241-250 | services/category/CategoryMongodb.php:668-677 | services/category/CategoryMysqldb.php:246-255 | services/category/CategoryMysqldb.php:300-309 | services/category/CategoryMysqldb.php:744-753 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/category/CategoryMongodb.php:185` calls `unset` and `services/category/CategoryMongodb.php:239` 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 × 5) app/appfront/modules/Catalog/block/category/Index.php:527— app/appfront/modules/Catalog/block/category/Index.php:527-536 | app/appfront/modules/Catalog/block/product/Index.php:524-533 | app/apphtml5/modules/Catalog/block/category/Index.php:514-523 | app/apphtml5/modules/Catalog/block/product/Index.php:512-521 | app/appserver/modules/Catalog/controllers/ProductController.php:756-765 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:527` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appfront/modules/Catalog/block/category/Index.php:537` calls `breadcrumbs` and `app/apphtml5/modules/Catalog/block/product/Index.php:523` 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 × 5) services/payment/Alipay.php:164— services/payment/Alipay.php:164-173 | services/payment/Wxpay.php:340-349 | services/payment/WxpayH5.php:351-360 | services/payment/WxpayJsApi.php:338-347 | services/payment/WxpayMicro.php:323-332 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `services/payment/Alipay.php:164` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 4) app/appadmin/modules/AppadminbaseBlock.php:528— app/appadmin/modules/AppadminbaseBlock.php:528-537 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:183-192 | app/appadmin/modules/Customer/block/contacts/Index.php:173-182 | app/appadmin/modules/Customer/block/newsletter/Index.php:177-186 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/productbrand/Manager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:528` it does not close everything it opens, so those exact lines 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 × 4) services/Sitemap.php:98— services/Sitemap.php:98-107 | services/Sitemap.php:139-148 | services/Sitemap.php:192-201 | services/Sitemap.php:244-253 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/Sitemap.php:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) app/appfront/modules/Customer/controllers/AccountController.php:83— app/appfront/modules/Customer/controllers/AccountController.php:83-91 | app/apphtml5/modules/Customer/controllers/AccountController.php:90-99 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AccountController.php` and `app/apphtml5/modules/Customer/controllers/AccountController.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/AccountController.php:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) app/appserver/modules/Catalog/controllers/ReviewproductController.php:35— app/appserver/modules/Catalog/controllers/ReviewproductController.php:35-44 | app/appserver/modules/Catalog/controllers/ReviewproductController.php:82-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/ReviewproductController.php:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 4) app/appadmin/modules/Config/block/appserverstorelang/Manager.php:31— app/appadmin/modules/Config/block/appserverstorelang/Manager.php:31-38 | app/appadmin/modules/Config/block/categorysort/Manager.php:31-39 | app/appadmin/modules/Config/block/currency/Manager.php:31-38 | app/appadmin/modules/Config/block/mutillang/Manager.php:31-38 — `app/appadmin/modules/Config/block/currency/Manager.php` and `app/appadmin/modules/Config/block/mutillang/Manager.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 3 separate duplicated blocks between them, totalling at least 78 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.
Duplicated block (8–9 lines × 4) services/category/CategoryMongodb.php:635— services/category/CategoryMongodb.php:635-643 | services/category/CategoryMysqldb.php:711-719 | services/product/ProductMongodb.php:1276-1283 | services/product/ProductMysqldb.php:1476-1483 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/category/CategoryMysqldb.php:710` calls `unserializeData` and `services/category/CategoryMongodb.php:634` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 10) app/appadmin/modules/Catalog/block/category/Product.php:373— app/appadmin/modules/Catalog/block/category/Product.php:373-380 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:169-176 | app/appadmin/modules/Catalog/block/productreview/Index.php:250-257 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:150-157 | app/appadmin/modules/Cms/block/article/Index.php:181-188 | app/appadmin/modules/Cms/block/staticblock/Index.php:196-203 | app/appadmin/modules/Sales/block/coupon/Manager.php:213-220 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:237-244 | app/appadmin/modules/System/block/error/Index.php:175-182 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:219-226 — before extracting anything, compare `app/appadmin/modules/Catalog/block/category/Product.php` and `app/appadmin/modules/Catalog/block/productfavorite/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/category/Product.php:373` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 10) services/product/ProductMongodb.php:377— services/product/ProductMongodb.php:377-385 | services/product/ProductMongodb.php:409-416 | services/product/ProductMongodb.php:516-524 | services/product/ProductMongodb.php:1251-1259 | services/product/ProductMongodb.php:1308-1315 | services/product/ProductMysqldb.php:478-486 | services/product/ProductMysqldb.php:506-515 | services/product/ProductMysqldb.php:609-617 | services/product/ProductMysqldb.php:1457-1465 | services/product/ProductMysqldb.php:1509-1517 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:377` it begins part-way through the construct above it, so those 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, `services/product/ProductMongodb.php:386` calls `getPrimaryKey`, `ObjectId`, `andWhere` and `services/product/ProductMongodb.php:417` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) services/Sitemap.php:42— services/Sitemap.php:42-46 | services/Sitemap.php:71-75 | services/Sitemap.php:97-101 | services/Sitemap.php:138-142 | services/Sitemap.php:191-195 | services/Sitemap.php:243-247 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/Sitemap.php:42` it does not close everything it opens, so those exact lines 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 × 6) services/Sitemap.php:47— services/Sitemap.php:47-51 | services/Sitemap.php:76-80 | services/Sitemap.php:104-108 | services/Sitemap.php:145-149 | services/Sitemap.php:198-202 | services/Sitemap.php:250-254 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/Sitemap.php:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (133 lines × 2) lib/alipay/aop/request/AlipayEcapiprodCreditGetRequest.php:47— lib/alipay/aop/request/AlipayEcapiprodCreditGetRequest.php:47-179 | lib/alipay/aop/request/AlipayEcapiprodDrawndnDrawndnlistQueryRequest.php:47-179 — before extracting anything, compare `lib/alipay/aop/request/AlipayEcapiprodCreditGetRequest.php` and `lib/alipay/aop/request/AlipayEcapiprodDrawndnDrawndnlistQueryRequest.php` as WHOLE FILES: 89% 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 `lib/alipay/aop/request/AlipayEcapiprodCreditGetRequest.php:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (133 lines × 2) lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47— lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47-179 | lib/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php:47-179 — before extracting anything, compare `lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php` and `lib/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 443 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 `lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (89 lines × 3) lib/alipay/aop/request/AlipayExscUserCurrentsignGetRequest.php:27— lib/alipay/aop/request/AlipayExscUserCurrentsignGetRequest.php:27-115 | lib/alipay/aop/request/AlipayExscUserFirstfundinpourGetRequest.php:27-115 | lib/alipay/aop/request/AlipayExscUserFirstsignGetRequest.php:27-115 — before extracting anything, compare `lib/alipay/aop/request/AlipayExscUserCurrentsignGetRequest.php` and `lib/alipay/aop/request/AlipayExscUserFirstfundinpourGetRequest.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 `lib/alipay/aop/request/AlipayExscUserCurrentsignGetRequest.php:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (89 lines × 3) lib/alipay/aop/request/AlipayMobilePublicTemplateMessageDeleteRequest.php:27— lib/alipay/aop/request/AlipayMobilePublicTemplateMessageDeleteRequest.php:27-115 | lib/alipay/aop/request/AlipayMobilePublicTemplateMessageGetRequest.php:27-115 | lib/alipay/aop/request/AlipayMobilePublicTemplateMessageModifyRequest.php:32-131 — before extracting anything, compare `lib/alipay/aop/request/AlipayMobilePublicTemplateMessageDeleteRequest.php` and `lib/alipay/aop/request/AlipayMobilePublicTemplateMessageModifyRequest.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/alipay/aop/request/AlipayMobilePublicTemplateMessageDeleteRequest.php:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (25 lines × 2 locations) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1493— app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1493 · REDACTED:96 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (25 lines × 2 locations) REDACTED:1352— REDACTED:1352 · REDACTED:1379 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Swallowed exception (empty catch) app/appfront/theme/base/front/assets/fancybox/jquery.fancybox.js:1004— 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/appfront/theme/base/front/assets/fancybox/jquery.fancybox.js:1239— 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.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
sm-extend.Swiper (cyclomatic 688) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:15— sm-extend.Swiper has cyclomatic complexity 688 (threshold 15). Of this number, 166 points are the body's own statements and 522 belong to 81 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sm.Calendar (cyclomatic 291) REDACTED:1710— sm.Calendar has cyclomatic complexity 291 (threshold 15). Of this number, 47 points are the body's own statements and 244 belong to 39 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sm-extend.PhotoBrowser (cyclomatic 150) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2769— sm-extend.PhotoBrowser has cyclomatic complexity 150 (threshold 15). Of this number, 58 points are the body's own statements and 92 belong to 27 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sm.Picker (cyclomatic 119) REDACTED:2948— sm.Picker has cyclomatic complexity 119 (threshold 15). Of this number, 30 points are the body's own statements and 89 belong to 23 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MobileDetect.mobileGrade (cyclomatic 77) services/helper/MobileDetect.php:1242— MobileDetect.mobileGrade has cyclomatic complexity 77 (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.
ProductApi.checkShopfwPostDataRequireAndInt (cyclomatic 76) services/product/ProductApi.php:553— ProductApi.checkShopfwPostDataRequireAndInt has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProductApi.checkPostDataRequireAndInt (cyclomatic 75) services/product/ProductApi.php:57— ProductApi.checkPostDataRequireAndInt has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Managerbatchedit.initParamType (cyclomatic 69) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:500— Managerbatchedit.initParamType has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Manageredit.initParamType (cyclomatic 69) app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:457— Manageredit.initParamType has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppadminbaseBlockEdit.getEditBar (cyclomatic 66) app/appadmin/modules/AppadminbaseBlockEdit.php:57— AppadminbaseBlockEdit.getEditBar has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.initAddress (cyclomatic 51) app/appserver/modules/Checkout/block/onepage/Index.php:87— Index.initAddress has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 40) app/appadmin/modules/Catalog/block/productinfo/Index.php:246— Index.getTableTbodyHtml has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gestures (cyclomatic 40) app/appfront/theme/base/front/assets/js/owl.carousel.js:863— gestures has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to 8 function items inside it that branch (dragMove, dragStart, dragEnd, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProductMongodb.excelSave (cyclomatic 38) services/product/ProductMongodb.php:1216— ProductMongodb.excelSave has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProductMysqldb.excelSave (cyclomatic 36) services/product/ProductMysqldb.php:1420— ProductMysqldb.excelSave 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.
_move (cyclomatic 36) REDACTED:4110— _move has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Product.getTableTbodyHtml (cyclomatic 35) app/appadmin/modules/Catalog/block/category/Product.php:342— Product.getTableTbodyHtml has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 35) REDACTED:296— (anonymous) has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_key (cyclomatic 35) REDACTED:5125— _key has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Manager.getTableTbodyHtml (cyclomatic 33) app/appadmin/modules/Sales/block/orderinfo/Manager.php:213— Manager.getTableTbodyHtml 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.
(anonymous) (cyclomatic 31) REDACTED:3656— (anonymous) has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 21 function items inside it that branch (momentum, fn, a function literal at line 3660, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
refresh (cyclomatic 31) REDACTED:5556— refresh 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.
AppadminbaseBlock.getTableTbodyHtml (cyclomatic 30) app/appadmin/modules/AppadminbaseBlock.php:518— AppadminbaseBlock.getTableTbodyHtml has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 30) app/appadmin/modules/Customer/block/contacts/Index.php:163— Index.getTableTbodyHtml 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.
XunSearch.fullTearchText (cyclomatic 30) services/search/XunSearch.php:181— XunSearch.fullTearchText has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 29) app/appadmin/modules/Customer/block/newsletter/Index.php:168— Index.getTableTbodyHtml 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.
CategoryController.actionUpsertone2 (cyclomatic 29) app/appapi/modules/V1/controllers/CategoryController.php:413— CategoryController.actionUpsertone2 has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Manager.getTableTbodyHtml (cyclomatic 28) app/appadmin/modules/Catalog/block/productbrand/Manager.php:173— Manager.getTableTbodyHtml 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.
LtXml.getArray (cyclomatic 28) lib/alipay/lotusphp_runtime/XML/Xml.php:69— LtXml.getArray 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.
sm.$.initPullToRefresh::handleTouchMove (cyclomatic 28) REDACTED:6345— sm.$.initPullToRefresh::handleTouchMove 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.
ProductController.actionUpdateqty (cyclomatic 27) REDACTED:355— ProductController.actionUpdateqty 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.
Asset.register (cyclomatic 27) services/page/Asset.php:72— Asset.register 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.
_end (cyclomatic 27) REDACTED:4213— _end 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. This is NOT this file's highest cyclomatic complexity: handleEvent (cyclomatic 29) 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.
PhotoBrowser::onSlideTouchMove (cyclomatic 27) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:3158— PhotoBrowser::onSlideTouchMove has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProductController.getSameSpuInfo (cyclomatic 26) app/appserver/modules/Catalog/controllers/ProductController.php:518— ProductController.getSameSpuInfo has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
jquery.lazyload.$.fn.lazyload (cyclomatic 26) app/appfront/theme/base/front/assets/js/jquery.lazyload.js:18— jquery.lazyload.$.fn.lazyload has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 37, 84, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Product.initDataWhere (cyclomatic 25) app/appadmin/modules/Catalog/block/category/Product.php:222— Product.initDataWhere has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CategoryController.actionUpdateone (cyclomatic 25) app/appapi/modules/V1/controllers/CategoryController.php:211— CategoryController.actionUpdateone has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (CategoryController.actionUpsertone) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
CategoryController.actionUpsertone (cyclomatic 25) app/appapi/modules/V1/controllers/CategoryController.php:312— CategoryController.actionUpsertone has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (CategoryController.actionUpdateone) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ProductController.getGroupAttrArr (cyclomatic 25) app/appserver/modules/Catalog/controllers/ProductController.php:340— ProductController.getGroupAttrArr has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CategoryMongodb.excelSave (cyclomatic 25) services/category/CategoryMongodb.php:613— CategoryMongodb.excelSave has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CategoryMysqldb.excelSave (cyclomatic 25) services/category/CategoryMysqldb.php:692— CategoryMysqldb.excelSave has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sm.showTab (cyclomatic 25) REDACTED:6037— sm.showTab has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppadminbaseBlock.initDataWhere (cyclomatic 24) app/appadmin/modules/AppadminbaseBlock.php:325— AppadminbaseBlock.initDataWhere 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.
sm.FastClick.notNeeded (cyclomatic 24) REDACTED:1159— sm.FastClick.notNeeded 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.
ProductMysqldb.save (cyclomatic 23) services/product/ProductMysqldb.php:437— ProductMysqldb.save 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.
Wxplaceorder.checkOrderInfoAndInit (cyclomatic 22) app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:231— Wxplaceorder.checkOrderInfoAndInit 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.
Category.getFilterInfo (cyclomatic 22) services/Category.php:367— Category.getFilterInfo 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.
Store.bootstrap (cyclomatic 22) services/Store.php:226— Store.bootstrap 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.
ProductMongodb.save (cyclomatic 22) services/product/ProductMongodb.php:340— ProductMongodb.save 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.
sm.FastClick.onTouchEnd (cyclomatic 22) REDACTED:939— sm.FastClick.onTouchEnd 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.
Store.html5DeviceCheckAndRedirect (cyclomatic 21) services/Store.php:302— Store.html5DeviceCheckAndRedirect has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sm.$.openModal (cyclomatic 21) REDACTED:1538— sm.$.openModal has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sm.IScroll (cyclomatic 21) REDACTED:3918— sm.IScroll has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Order.generateOrderByCart (cyclomatic 20) services/Order.php:591— Order.generateOrderByCart has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_wheel (cyclomatic 20) REDACTED:4741— _wheel has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: handleEvent (cyclomatic 29) 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.
_initSnap (cyclomatic 20) REDACTED:4834— _initSnap has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4841, 4932). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: handleEvent (cyclomatic 29) 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.
updateItems (cyclomatic 20) app/appfront/theme/base/front/assets/js/owl.carousel.js:212— updateItems has cyclomatic complexity 20 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Index.getTableTbodyHtml (cyclomatic 19) app/appadmin/modules/Fecadmin/block/log/Index.php:132— Index.getTableTbodyHtml 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.
AopClient.execute (cyclomatic 19) REDACTED:436— AopClient.execute 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.
LtRouter.init (cyclomatic 19) lib/alipay/lotusphp_runtime/Router/Router.php:27— LtRouter.init has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Store.isAppServerMobile (cyclomatic 19) services/Store.php:366— Store.isAppServerMobile 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.
Paypal.updateOrderStatusByIpn (cyclomatic 19) REDACTED:304— Paypal.updateOrderStatusByIpn 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.
ProductMongodb.initSave (cyclomatic 19) services/product/ProductMongodb.php:735— ProductMongodb.initSave has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProductMongodb.addAndDeleteProductCategory (cyclomatic 19) services/product/ProductMongodb.php:840— ProductMongodb.addAndDeleteProductCategory 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.
ProductMysqldb.initSave (cyclomatic 19) services/product/ProductMysqldb.php:884— ProductMysqldb.initSave has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sm.$.closeModal (cyclomatic 19) REDACTED:1598— sm.$.closeModal has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
updatePosition (cyclomatic 19) REDACTED:5641— updatePosition has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: handleEvent (cyclomatic 29) 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.
ProductinfoController.actionManagerdelete (cyclomatic 18) app/appadmin/modules/Catalog/controllers/ProductinfoController.php:116— ProductinfoController.actionManagerdelete has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getRedisCacheConfig (cyclomatic 18) app/appadmin/modules/Fecadmin/block/cache/Index.php:115— Index.getRedisCacheConfig has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.getTableTbodyHtml (cyclomatic 18) app/appadmin/modules/Fecadmin/block/logtj/Index.php:178— Index.getTableTbodyHtml 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.
ProductController.getSpuAttrInfo (cyclomatic 18) app/appserver/modules/Catalog/controllers/ProductController.php:615— ProductController.getSpuAttrInfo 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.
LtValidator.validate (cyclomatic 18) lib/alipay/lotusphp_runtime/Validator/Validator.php:34— LtValidator.validate 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.
jquery.fancybox.$.fn.fancybox (cyclomatic 18) app/appfront/theme/base/front/assets/fancybox/jquery.fancybox.js:1926— jquery.fancybox.$.fn.fancybox has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (run). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_nearestSnap (cyclomatic 18) REDACTED:4947— _nearestSnap has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: handleEvent (cyclomatic 29) 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.
ArticleController.actionUpdateone (cyclomatic 17) app/appapi/modules/V1/controllers/ArticleController.php:175— ArticleController.actionUpdateone 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.
Email.mailer (cyclomatic 17) REDACTED:151— Email.mailer 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.
AR.getCollByFilter (cyclomatic 17) services/helper/AR.php:45— AR.getCollByFilter 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.
ProductApi.insertByShopfwItem (cyclomatic 17) services/product/ProductApi.php:491— ProductApi.insertByShopfwItem 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.
Stock.checkItemsQty (cyclomatic 17) services/product/Stock.php:549— Stock.checkItemsQty 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.
MysqlSearch.fullTearchText (cyclomatic 17) services/search/MysqlSearch.php:250— MysqlSearch.fullTearchText 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.
sm.$.actions (cyclomatic 17) REDACTED:1429— sm.$.actions has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Managerbatchedit.getCustomOptionAdd (cyclomatic 16) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:100— Managerbatchedit.getCustomOptionAdd 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.
Manageredit.getCustomOptionAdd (cyclomatic 16) app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:99— Manageredit.getCustomOptionAdd 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.
ProductController.actionUpdateone (cyclomatic 16) REDACTED:244— ProductController.actionUpdateone 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.
EditaccountController.validateParams (cyclomatic 16) app/appserver/modules/Customer/controllers/EditaccountController.php:92— EditaccountController.validateParams 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.
RegisterController.validateParam (cyclomatic 16) app/appserver/modules/Customer/controllers/RegisterController.php:63— RegisterController.validateParam 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.
Store.initCurrentStoreConfig (cyclomatic 16) services/Store.php:109— Store.initCurrentStoreConfig 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.
Generate.createAddonsFiles (cyclomatic 16) services/extension/Generate.php:28— Generate.createAddonsFiles 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.
sm.FastClick.needsClick (cyclomatic 16) REDACTED:632— sm.FastClick.needsClick 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.
sm.$.modal (cyclomatic 16) REDACTED:1271— sm.$.modal has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sm-extend.Swiper (cognitive 210) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:15— sm-extend.Swiper has cognitive complexity 210 (threshold 15). Drivers by points: boolean chains 137, if/else 46 (63 pts), loops 3 (5 pts), ternaries 4 (5 pts) (nesting depth added 20). Of this number, 176 points are the body's own statements and 34 belong to 81 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Managerbatchedit.initParamType (cognitive 163) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:500— Managerbatchedit.initParamType has cognitive complexity 163 (threshold 15). Drivers by points: if/else 33 (98 pts), loops 9 (33 pts), boolean chains 16, ternaries 16 (nesting depth added 89). 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.
Manageredit.initParamType (cognitive 163) app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:457— Manageredit.initParamType has cognitive complexity 163 (threshold 15). Drivers by points: if/else 33 (98 pts), loops 9 (33 pts), boolean chains 16, ternaries 16 (nesting depth added 89). 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.
Picker (cognitive 161) REDACTED:2948— Picker has cognitive complexity 161 (threshold 15). Drivers by points: if/else 80 (112 pts), boolean chains 23, ternaries 13 (19 pts), loops 6 (7 pts) (nesting depth added 39). Of this number, 18 points are the body's own statements and 143 belong to 34 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppadminbaseBlockEdit.getEditBar (cognitive 159) app/appadmin/modules/AppadminbaseBlockEdit.php:57— AppadminbaseBlockEdit.getEditBar has cognitive complexity 159 (threshold 15). Drivers by points: if/else 28 (76 pts), ternaries 19 (54 pts), loops 6 (21 pts), boolean chains 8 (nesting depth added 98). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getTableTbodyHtml (cognitive 134) app/appadmin/modules/Catalog/block/productinfo/Index.php:246— Index.getTableTbodyHtml has cognitive complexity 134 (threshold 15). Drivers by points: if/else 20 (88 pts), ternaries 6 (34 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 101). 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.
ProductApi.checkPostDataRequireAndInt (cognitive 124) services/product/ProductApi.php:57— ProductApi.checkPostDataRequireAndInt has cognitive complexity 124 (threshold 15). Drivers by points: if/else 61 (94 pts), boolean chains 21, loops 3 (9 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductApi.checkShopfwPostDataRequireAndInt (cognitive 116) services/product/ProductApi.php:553— ProductApi.checkShopfwPostDataRequireAndInt has cognitive complexity 116 (threshold 15). Drivers by points: if/else 59 (84 pts), boolean chains 23, loops 3 (9 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Product.getTableTbodyHtml (cognitive 106) app/appadmin/modules/Catalog/block/category/Product.php:342— Product.getTableTbodyHtml has cognitive complexity 106 (threshold 15). Drivers by points: if/else 14 (69 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 81). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getTableTbodyHtml (cognitive 102) app/appadmin/modules/Fecadmin/block/log/Index.php:132— Index.getTableTbodyHtml has cognitive complexity 102 (threshold 15). Drivers by points: if/else 18 (86 pts), loops 3 (8 pts), ternaries 1 (6 pts), boolean chains 2 (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.
Manager.getTableTbodyHtml (cognitive 100) app/appadmin/modules/Sales/block/orderinfo/Manager.php:213— Manager.getTableTbodyHtml has cognitive complexity 100 (threshold 15). Drivers by points: if/else 12 (63 pts), ternaries 4 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 77). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getTableTbodyHtml (cognitive 95) app/appadmin/modules/Fecadmin/block/logtj/Index.php:178— Index.getTableTbodyHtml has cognitive complexity 95 (threshold 15). Drivers by points: if/else 16 (80 pts), loops 3 (8 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 73). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.initAddress (cognitive 93) app/appserver/modules/Checkout/block/onepage/Index.php:87— Index.initAddress has cognitive complexity 93 (threshold 15). Drivers by points: if/else 36 (78 pts), boolean chains 13, loops 1 (2 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppadminbaseBlock.getTableTbodyHtml (cognitive 92) app/appadmin/modules/AppadminbaseBlock.php:518— AppadminbaseBlock.getTableTbodyHtml has cognitive complexity 92 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 3 (21 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 72). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getTableTbodyHtml (cognitive 92) app/appadmin/modules/Customer/block/contacts/Index.php:163— Index.getTableTbodyHtml has cognitive complexity 92 (threshold 15). Drivers by points: if/else 11 (60 pts), ternaries 3 (21 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 72). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.getTableTbodyHtml (cognitive 89) app/appadmin/modules/Customer/block/newsletter/Index.php:168— Index.getTableTbodyHtml has cognitive complexity 89 (threshold 15). Drivers by points: if/else 10 (57 pts), ternaries 3 (21 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 70). 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.
Category.getFilterInfo (cognitive 85) services/Category.php:367— Category.getFilterInfo has cognitive complexity 85 (threshold 15). Drivers by points: if/else 16 (66 pts), loops 2 (7 pts), ternaries 1 (7 pts), boolean chains 5 (nesting depth added 61). 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.
Asset.register (cognitive 83) services/page/Asset.php:72— Asset.register has cognitive complexity 83 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 7 (29 pts), ternaries 2 (16 pts), boolean chains 7 (nesting depth added 57). 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.
XunSearch.fullTearchText (cognitive 83) services/search/XunSearch.php:181— XunSearch.fullTearchText has cognitive complexity 83 (threshold 15). Drivers by points: if/else 19 (44 pts), ternaries 4 (20 pts), loops 6 (14 pts), boolean chains 5 (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.
sm.Calendar (cognitive 80) REDACTED:1710— sm.Calendar has cognitive complexity 80 (threshold 15). Drivers by points: boolean chains 39, if/else 20 (35 pts), ternaries 4 (5 pts), loops 1 (nesting depth added 16). Of this number, 52 points are the body's own statements and 28 belong to 39 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Manager.getTableTbodyHtml (cognitive 76) app/appadmin/modules/Catalog/block/productbrand/Manager.php:173— Manager.getTableTbodyHtml has cognitive complexity 76 (threshold 15). Drivers by points: if/else 11 (60 pts), loops 3 (8 pts), ternaries 1 (5 pts), boolean chains 3 (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MobileDetect.mobileGrade (cognitive 76) services/helper/MobileDetect.php:1242— MobileDetect.mobileGrade has cognitive complexity 76 (threshold 15). Drivers by points: boolean chains 73, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProductMongodb.excelSave (cognitive 71) services/product/ProductMongodb.php:1216— ProductMongodb.excelSave has cognitive complexity 71 (threshold 15). Drivers by points: if/else 19 (34 pts), ternaries 8 (21 pts), boolean chains 8, loops 3 (8 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductMysqldb.excelSave (cognitive 65) services/product/ProductMysqldb.php:1420— ProductMysqldb.excelSave has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (35 pts), ternaries 8 (20 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sm-extend.PhotoBrowser (cognitive 65) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2769— sm-extend.PhotoBrowser has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 42, if/else 9 (17 pts), ternaries 4, loops 2 (nesting depth added 8). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LtValidator.validate (cognitive 62) lib/alipay/lotusphp_runtime/Validator/Validator.php:34— LtValidator.validate has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (55 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 41). 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.
Store.bootstrap (cognitive 61) services/Store.php:226— Store.bootstrap has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (42 pts), loops 2 (8 pts), boolean chains 7, ternaries 1 (4 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LtXml.getArray (cognitive 59) lib/alipay/lotusphp_runtime/XML/Xml.php:69— LtXml.getArray has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (41 pts), boolean chains 12, loops 2 (6 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProductController.actionUpdateqty (cognitive 58) REDACTED:355— ProductController.actionUpdateqty has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (41 pts), ternaries 5 (11 pts), boolean chains 4, loops 2 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AppadminbaseBlock.initDataWhere (cognitive 55) app/appadmin/modules/AppadminbaseBlock.php:325— AppadminbaseBlock.initDataWhere has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (48 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProductController.getGroupAttrArr (cognitive 55) app/appserver/modules/Catalog/controllers/ProductController.php:340— ProductController.getGroupAttrArr has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 9, loops 1 (2 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.
LtRouter.init (cognitive 54) lib/alipay/lotusphp_runtime/Router/Router.php:27— LtRouter.init has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 4 (13 pts), boolean chains 5 (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.
Product.initDataWhere (cognitive 53) app/appadmin/modules/Catalog/block/category/Product.php:222— Product.initDataWhere has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (46 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProductController.getSameSpuInfo (cognitive 53) app/appserver/modules/Catalog/controllers/ProductController.php:518— ProductController.getSameSpuInfo has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 8 (15 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Stock.checkItemsQty (cognitive 52) services/product/Stock.php:549— Stock.checkItemsQty has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (46 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 31). 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.
refresh (cognitive 51) REDACTED:5556— refresh has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 14, ternaries 3 (6 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.
ProductController.getSpuAttrInfo (cognitive 47) app/appserver/modules/Catalog/controllers/ProductController.php:615— ProductController.getSpuAttrInfo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (13 pts), boolean chains 3 (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.
Sitemap.category (cognitive 46) services/Sitemap.php:136— Sitemap.category has cognitive complexity 46 (threshold 15). Drivers by points: if/else 5 (22 pts), loops 3 (14 pts), boolean chains 5, ternaries 1 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (Sitemap.product, Sitemap.cmspage) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Sitemap.product (cognitive 46) services/Sitemap.php:189— Sitemap.product has cognitive complexity 46 (threshold 15). Drivers by points: if/else 5 (22 pts), loops 3 (14 pts), boolean chains 5, ternaries 1 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (Sitemap.category, Sitemap.cmspage) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Sitemap.cmspage (cognitive 46) services/Sitemap.php:241— Sitemap.cmspage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 5 (22 pts), loops 3 (14 pts), boolean chains 5, ternaries 1 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (Sitemap.category, Sitemap.product) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
QuoteItem.getCartProductInfo (cognitive 46) services/cart/QuoteItem.php:267— QuoteItem.getCartProductInfo has cognitive complexity 46 (threshold 15). Drivers by points: if/else 6 (22 pts), ternaries 3 (18 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sm.$.initSwipePanels::handleTouchEnd (cognitive 46) REDACTED:6825— sm.$.initSwipePanels::handleTouchEnd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 9, ternaries 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductinfoController.actionManagerdelete (cognitive 45) app/appadmin/modules/Catalog/controllers/ProductinfoController.php:116— ProductinfoController.actionManagerdelete has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (32 pts), boolean chains 8, loops 1 (5 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.
Product.initCustomAttrGroup (cognitive 45) services/Product.php:115— Product.initCustomAttrGroup has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 4 (12 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_key (cognitive 45) REDACTED:5125— _key has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 13 (27 pts), if/else 11 (13 pts), boolean chains 4, match/switch 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.
Wxplaceorder.checkOrderInfoAndInit (cognitive 43) app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:231— Wxplaceorder.checkOrderInfoAndInit has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 1 (5 pts), ternaries 5, boolean chains 2 (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.
LtRbac.checkAcl (cognitive 43) lib/alipay/lotusphp_runtime/RBAC/Rbac.php:28— LtRbac.checkAcl has cognitive complexity 43 (threshold 15). Drivers by points: if/else 5 (18 pts), ternaries 3 (17 pts), loops 3 (8 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sm.FastClick.notNeeded (cognitive 43) REDACTED:1159— sm.FastClick.notNeeded has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 8 (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.
_move (cognitive 43) REDACTED:4110— _move has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (23 pts), ternaries 11 (15 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
gestures (cognitive 43) app/appfront/theme/base/front/assets/js/owl.carousel.js:863— gestures has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 15 (nesting depth added 4). None of this is in the body itself: all 43 points belong to 8 function items inside it that branch (dragMove, dragStart, dragEnd, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CategoryMongodb.excelSave (cognitive 42) services/category/CategoryMongodb.php:613— CategoryMongodb.excelSave has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 7 (17 pts), boolean chains 6 (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.
CategoryMysqldb.excelSave (cognitive 42) services/category/CategoryMysqldb.php:692— CategoryMysqldb.excelSave has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 7 (17 pts), boolean chains 6 (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.
Index.getRedisCacheConfig (cognitive 41) app/appadmin/modules/Fecadmin/block/cache/Index.php:115— Index.getRedisCacheConfig has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 4 (12 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductMongodb.addAndDeleteProductCategory (cognitive 41) services/product/ProductMongodb.php:840— ProductMongodb.addAndDeleteProductCategory has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (8 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Managerbatchedit.getCustomOptionAdd (cognitive 40) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:100— Managerbatchedit.getCustomOptionAdd has cognitive complexity 40 (threshold 15). Drivers by points: loops 4 (17 pts), if/else 5 (11 pts), ternaries 2 (8 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Manageredit.getCustomOptionAdd (cognitive 40) app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:99— Manageredit.getCustomOptionAdd has cognitive complexity 40 (threshold 15). Drivers by points: loops 4 (17 pts), if/else 5 (11 pts), ternaries 2 (8 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
initPullToRefresh::handleTouchMove (cognitive 39) REDACTED:6345— initPullToRefresh::handleTouchMove has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 10, ternaries 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CategoryMongodb.getAllParentCate (cognitive 38) services/category/CategoryMongodb.php:533— CategoryMongodb.getAllParentCate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (27 pts), loops 2 (7 pts), boolean chains 4 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CategoryMysqldb.getAllParentCate (cognitive 38) services/category/CategoryMysqldb.php:601— CategoryMysqldb.getAllParentCate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (27 pts), loops 2 (7 pts), boolean chains 4 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProductMongodb.save (cognitive 38) services/product/ProductMongodb.php:340— ProductMongodb.save has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (8 pts), ternaries 4 (6 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 38) REDACTED:296— (anonymous) has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 13, ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProductMysqldb.save (cognitive 37) services/product/ProductMysqldb.php:437— ProductMysqldb.save has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 5 (7 pts), loops 2 (3 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.
Manageredit.getGroupAttr (cognitive 36) app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:229— Manageredit.getGroupAttr has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (10 pts), boolean chains 4, ternaries 1 (4 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.
Address.remove (cognitive 36) services/customer/Address.php:258— Address.remove has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sm.showTab (cognitive 36) REDACTED:6037— sm.showTab has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 7 (nesting depth added 10). Of this number, 30 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LtUrl.reverseMatchingRoutingTable (cognitive 35) lib/alipay/lotusphp_runtime/Url/Url.php:72— LtUrl.reverseMatchingRoutingTable has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (30 pts), 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.
ProductMysqldb.getFrontCategoryProductsGroupBySpu (cognitive 35) services/product/ProductMysqldb.php:1229— ProductMysqldb.getFrontCategoryProductsGroupBySpu has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductMysqldb.getFrontCategoryFilter (cognitive 35) services/product/ProductMysqldb.php:1313— ProductMysqldb.getFrontCategoryFilter has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MysqlSearch.fullTearchText (cognitive 35) services/search/MysqlSearch.php:250— MysqlSearch.fullTearchText has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 4 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jquery.lazyload.$.fn.lazyload (cognitive 35) app/appfront/theme/base/front/assets/js/jquery.lazyload.js:18— jquery.lazyload.$.fn.lazyload has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 6 (nesting depth added 9). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 37, 84, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Shipping.getAvailableShippingMethods (cognitive 34) services/Shipping.php:291— Shipping.getAvailableShippingMethods has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 5 (11 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
QuoteItem.getProductSpuOptions (cognitive 34) services/cart/QuoteItem.php:371— QuoteItem.getProductSpuOptions has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (8 pts), boolean chains 6 (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.
Item.getProductSpuOptions (cognitive 34) services/order/Item.php:242— Item.getProductSpuOptions has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (8 pts), boolean chains 6 (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.
ProductMysqldb.getFrontCategoryProductsAll (cognitive 34) services/product/ProductMysqldb.php:1157— ProductMysqldb.getFrontCategoryProductsAll has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 34) REDACTED:3656— (anonymous) has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 6 (8 pts), loops 4, boolean chains 3 (nesting depth added 4). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 21 function items inside it that branch (momentum, fn, a function literal at line 3660, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
sm.$.actions (cognitive 33) REDACTED:1429— sm.$.actions has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 17). Of this number, 27 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getAttr1AndAttr2Info (cognitive 32) app/apphtml5/modules/Catalog/block/product/Index.php:200— Index.getAttr1AndAttr2Info has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (20 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (2 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.
ProductController.getProductBySkus (cognitive 32) app/appserver/modules/Catalog/controllers/ProductController.php:803— ProductController.getProductBySkus has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 2 (10 pts), loops 1 (4 pts), boolean chains 2 (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.
HomeController.getProductBySkus (cognitive 32) app/appserver/modules/Cms/controllers/HomeController.php:104— HomeController.getProductBySkus has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 2 (8 pts), loops 1 (3 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.
Shipping.init (cognitive 32) services/Shipping.php:49— Shipping.init has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Store.initCurrentStoreConfig (cognitive 32) services/Store.php:109— Store.initCurrentStoreConfig has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 5 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.getAttr1AndAttr2Info (cognitive 31) app/appfront/modules/Catalog/block/product/Index.php:210— Index.getAttr1AndAttr2Info has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (20 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (2 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.
Echart.getLine (cognitive 31) services/helper/Echart.php:79— Echart.getLine has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (13 pts), boolean chains 1, ternaries 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_initSnap (cognitive 31) REDACTED:4834— _initSnap has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, loops 3 (7 pts) (nesting depth added 10). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 4841, 4932). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
updatePosition (cognitive 31) REDACTED:5641— updatePosition has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 6 (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.
IndexController.getSearchProductColl (cognitive 30) app/appserver/modules/Catalogsearch/controllers/IndexController.php:327— IndexController.getSearchProductColl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 2 (8 pts), loops 1 (2 pts), boolean chains 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.
OrderController.actionWxview (cognitive 30) app/appserver/modules/Customer/controllers/OrderController.php:266— OrderController.actionWxview has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (12 pts), boolean chains 1 (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.
Placeorder.getLastData (cognitive 30) app/appserver/modules/Payment/block/paypal/express/Placeorder.php:37— Placeorder.getLastData has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 2 (6 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.
Sitemap.beginSiteMap (cognitive 30) services/Sitemap.php:40— Sitemap.beginSiteMap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (6 pts), ternaries 1 (5 pts), boolean chains 4 (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. This shape REPEATS in the file: 2 other methods here (Sitemap.endSiteMap, Sitemap.home) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Sitemap.endSiteMap (cognitive 30) services/Sitemap.php:69— Sitemap.endSiteMap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (6 pts), ternaries 1 (5 pts), boolean chains 4 (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. This shape REPEATS in the file: 2 other methods here (Sitemap.beginSiteMap, Sitemap.home) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Sitemap.home (cognitive 30) services/Sitemap.php:95— Sitemap.home has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (6 pts), ternaries 1 (5 pts), boolean chains 4 (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. This shape REPEATS in the file: 2 other methods here (Sitemap.beginSiteMap, Sitemap.endSiteMap) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MongoSearch.syncProductInfo (cognitive 30) services/search/MongoSearch.php:152— MongoSearch.syncProductInfo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 2 (8 pts), boolean chains 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MysqlSearch.syncProductInfo (cognitive 30) services/search/MysqlSearch.php:91— MysqlSearch.syncProductInfo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 2 (8 pts), boolean chains 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_end (cognitive 30) REDACTED:4213— _end has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, ternaries 4 (8 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.
CategoryController.actionUpsertone2 (cognitive 29) app/appapi/modules/V1/controllers/CategoryController.php:413— CategoryController.actionUpsertone2 has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 12, if/else 10 (11 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AopClient.execute (cognitive 29) REDACTED:436— AopClient.execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 3, 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.
LtTemplateView.template (cognitive 29) lib/alipay/lotusphp_runtime/MVC/TemplateView.php:55— LtTemplateView.template has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 1 (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.
LtTemplateView.parseInclude (cognitive 29) lib/alipay/lotusphp_runtime/MVC/TemplateView.php:300— LtTemplateView.parseInclude has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Order.generateOrderByCart (cognitive 29) services/Order.php:591— Order.generateOrderByCart has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ZipFile.unzip (cognitive 29) services/helper/ZipFile.php:38— ZipFile.unzip has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Paypal.updateOrderPayment (cognitive 29) REDACTED:748— Paypal.updateOrderPayment has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 3 (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.
AppadminbaseBlock.getDbSearchBarHtml (cognitive 28) app/appadmin/modules/AppadminbaseBlock.php:249— AppadminbaseBlock.getDbSearchBarHtml has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (12 pts), ternaries 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Product.getDbSearchBarHtml (cognitive 28) app/appadmin/modules/Catalog/block/category/Product.php:463— Product.getDbSearchBarHtml has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (12 pts), ternaries 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Helper.copyDirImage (cognitive 28) services/Helper.php:194— Helper.copyDirImage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 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.
Category.getFilterSortAttrUrl (cognitive 28) services/url/Category.php:138— Category.getFilterSortAttrUrl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updateItems (cognitive 28) app/appfront/theme/base/front/assets/js/owl.carousel.js:212— updateItems has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 8). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
CartController.getCartInfo (cognitive 27) app/appserver/modules/Checkout/controllers/CartController.php:71— CartController.getCartInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 3 (9 pts), loops 2 (6 pts), boolean chains 2 (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.
MongoSearch.fullTearchText (cognitive 27) services/search/MongoSearch.php:314— MongoSearch.fullTearchText has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (9 pts), boolean chains 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Category.getFilterChooseAttrUrl (cognitive 27) services/url/Category.php:63— Category.getFilterChooseAttrUrl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (26 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.
CategoryController.getCategoryProductColl (cognitive 26) app/appserver/modules/Catalog/controllers/CategoryController.php:593— CategoryController.getCategoryProductColl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (6 pts), loops 2 (4 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.
LtAutoloader.parseLibNames (cognitive 26) lib/alipay/lotusphp_runtime/Autoloader/Autoloader.php:182— LtAutoloader.parseLibNames has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LtRouter.matchingRoutingTable (cognitive 26) lib/alipay/lotusphp_runtime/Router/Router.php:140— LtRouter.matchingRoutingTable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (5 pts), boolean chains 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.
Store.html5DeviceCheckAndRedirect (cognitive 26) services/Store.php:302— Store.html5DeviceCheckAndRedirect has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, ternaries 5 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Menu.getLeftMenuTreeHtml (cognitive 26) services/admin/Menu.php:205— Menu.getLeftMenuTreeHtml has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, 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.
Quote.mergeCartAfterUserLogin (cognitive 26) services/cart/Quote.php:470— Quote.mergeCartAfterUserLogin has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 3 (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.
ProductMysqldb.checkSpuAttrUnique (cognitive 26) services/product/ProductMysqldb.php:404— ProductMysqldb.checkSpuAttrUnique has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sm.FastClick.onTouchEnd (cognitive 26) REDACTED:939— sm.FastClick.onTouchEnd has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6 (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.
Managerbatchedit.getGroupGeneralAttr (cognitive 25) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:229— Managerbatchedit.getGroupGeneralAttr has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (7 pts), boolean chains 3 (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.
Quote.getCartId (cognitive 25) services/cart/Quote.php:60— Quote.getCartId has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (23 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.
Product.convertToCategoryInfo (cognitive 25) services/category/Product.php:92— Product.convertToCategoryInfo has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Address.currentAddressList (cognitive 25) services/customer/Address.php:118— Address.currentAddressList has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (9 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Stock.deduct (cognitive 25) services/product/Stock.php:206— Stock.deduct has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Getproductcategory.getMenArray (cognitive 24) app/appadmin/modules/Catalog/block/productinfo/Getproductcategory.php:110— Getproductcategory.getMenArray has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (10 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CategoryController.actionUpdateone (cognitive 24) app/appapi/modules/V1/controllers/CategoryController.php:211— CategoryController.actionUpdateone has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 12, if/else 7, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (CategoryController.actionUpsertone) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
CategoryController.actionUpsertone (cognitive 24) app/appapi/modules/V1/controllers/CategoryController.php:312— CategoryController.actionUpsertone has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 12, if/else 7, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (CategoryController.actionUpdateone) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ArticleController.behaviors (cognitive 24) app/appfront/modules/Cms/controllers/ArticleController.php:33— ArticleController.behaviors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 1 (3 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.
AccountController.actionRegister (cognitive 24) app/apphtml5/modules/Customer/controllers/AccountController.php:72— AccountController.actionRegister has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (23 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.
CategoryController.getOrderBy (cognitive 24) app/appserver/modules/Catalog/controllers/CategoryController.php:507— CategoryController.getOrderBy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (6 pts), loops 1 (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.
Index.getCartInfo (cognitive 24) app/appserver/modules/Checkout/block/onepage/Index.php:303— Index.getCartInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (8 pts), loops 1 (3 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.
AdminUserResetPassword.validateNewPassword (cognitive 24) models/mysqldb/adminUser/AdminUserResetPassword.php:52— AdminUserResetPassword.validateNewPassword has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 1 (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.
Price.getCartPriceByProductId (cognitive 24) services/product/Price.php:117— Price.getCartPriceByProductId has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 3 (6 pts), boolean chains 3 (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.
XunSearch.syncProductInfo (cognitive 24) services/search/XunSearch.php:91— XunSearch.syncProductInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (8 pts), boolean chains 3 (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.
_wheel (cognitive 24) REDACTED:4741— _wheel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19 (22 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AccountController.actionRegister (cognitive 23) app/appfront/modules/Customer/controllers/AccountController.php:71— AccountController.actionRegister has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 1 (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.
AopClient.checkResponseSign (cognitive 23) REDACTED:1022— AopClient.checkResponseSign has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 5 (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.
LtXml.getString (cognitive 23) lib/alipay/lotusphp_runtime/XML/Xml.php:160— LtXml.getString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (8 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Store.isAppServerMobile (cognitive 23) services/Store.php:366— Store.isAppServerMobile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, ternaries 4 (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.
Role.getRoleResourcesByRoleIds (cognitive 23) services/admin/Role.php:282— Role.getRoleResourcesByRoleIds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (6 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.
AR.getCollByFilter (cognitive 23) services/helper/AR.php:45— AR.getCollByFilter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 7, loops 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AttrGroupMysqldb.save (cognitive 23) services/product/attrgroup/AttrGroupMysqldb.php:107— AttrGroupMysqldb.save has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ErrorHandler.argumentsToString (cognitive 23) yii/web/ErrorHandler.php:39— ErrorHandler.argumentsToString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 1 (3 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.
Scroller (cognitive 23) REDACTED:5781— Scroller has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, ternaries 1 (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.
Manageredit.exportExcel (cognitive 22) app/appadmin/modules/Sales/block/orderinfo/Manageredit.php:114— Manageredit.exportExcel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (6 pts), ternaries 1 (5 pts), boolean chains 2 (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.
CategoryController.actionFetchone (cognitive 22) app/appapi/modules/V1/controllers/CategoryController.php:71— CategoryController.actionFetchone has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Placeorder.getLastData (cognitive 22) app/appfront/modules/Checkout/block/onepage/Placeorder.php:39— Placeorder.getLastData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductController.getAttr1AndAttr2Info (cognitive 22) app/appserver/modules/Catalog/controllers/ProductController.php:444— ProductController.getAttr1AndAttr2Info has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 2 (4 pts), boolean chains 3, 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.
RegisterController.actionAccount (cognitive 22) app/appserver/modules/Customer/controllers/RegisterController.php:100— RegisterController.actionAccount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, 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.
LtPagination.renderPager (cognitive 22) lib/alipay/lotusphp_runtime/Pagination/Pagination.php:90— LtPagination.renderPager has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (5 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.
CategoryMysqldb.save (cognitive 22) services/category/CategoryMysqldb.php:209— CategoryMysqldb.save has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 4 (5 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Widget.renderContent (cognitive 22) services/page/Widget.php:186— Widget.renderContent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Info.getProductCOSku (cognitive 22) services/product/Info.php:103— Info.getProductCOSku has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductMysqldb.apicoll (cognitive 22) services/product/ProductMysqldb.php:277— ProductMysqldb.apicoll has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (11 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Stock.updatebybase (cognitive 22) services/product/Stock.php:310— Stock.updatebybase has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CategoryController.behaviors (cognitive 21) app/appfront/modules/Catalog/controllers/CategoryController.php:39— CategoryController.behaviors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProductController.behaviors (cognitive 21) app/appfront/modules/Catalog/controllers/ProductController.php:39— ProductController.behaviors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ConfigController.updateDomainConfig (cognitive 21) app/appinstall/modules/Database/controllers/ConfigController.php:252— ConfigController.updateDomainConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (21 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.
ConfigController.copyDir (cognitive 21) app/appinstall/modules/Database/controllers/ConfigController.php:653— ConfigController.copyDir has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OrderController.actionIndex (cognitive 21) app/appserver/modules/Customer/controllers/OrderController.php:108— OrderController.actionIndex has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 5 (9 pts), boolean chains 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LtDbTableDataGateway.updateRows (cognitive 21) lib/alipay/lotusphp_runtime/DB/QueryEngine/TableDataGateway/DbTableDataGateway.php:252— LtDbTableDataGateway.updateRows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3, 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.
Helper.copyDir (cognitive 21) services/Helper.php:233— Helper.copyDir has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Quote.getCartInfo (cognitive 21) services/cart/Quote.php:310— Quote.getCartInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3 (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.
ProductApi.insertByShopfwPost (cognitive 21) services/product/ProductApi.php:416— ProductApi.insertByShopfwPost has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, 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.
Request.getRewriteUri (cognitive 21) yii/web/Request.php:58— Request.getRewriteUri has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 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.
sm.$.closeModal (cognitive 21) REDACTED:1598— sm.$.closeModal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, ternaries 1 (nesting depth added 2). Of this number, 12 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_nearestSnap (cognitive 21) REDACTED:4947— _nearestSnap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Managerbatchedit.getImgHtml (cognitive 20) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:294— Managerbatchedit.getImgHtml has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 4, if/else 4, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Manageredit.getImgHtml (cognitive 20) app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:293— Manageredit.getImgHtml has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 4, if/else 4, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleController.actionFetchone (cognitive 20) app/appapi/modules/V1/controllers/ArticleController.php:68— ArticleController.actionFetchone has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 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.
Placeorder.getLastData (cognitive 20) app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:38— Placeorder.getLastData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseController.behaviors (cognitive 20) app/appserver/modules/General/controllers/BaseController.php:21— BaseController.behaviors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MysqldatatomongoController.actionSync (cognitive 20) app/console/modules/Product/controllers/MysqldatatomongoController.php:42— MysqldatatomongoController.actionSync has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (8 pts), ternaries 1 (2 pts), boolean chains 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.
WxPayApi.refund (cognitive 20) lib/wxpay/lib/WxPay.Api.php:141— WxPayApi.refund has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Email.mailer (cognitive 20) REDACTED:151— Email.mailer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Search.getAllChildServiceName (cognitive 20) services/Search.php:67— Search.getAllChildServiceName has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UrlKey.getResourcesWithGroupAndSelected (cognitive 20) services/admin/UrlKey.php:189— UrlKey.getResourcesWithGroupAndSelected has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Coupon.couponIsActive (cognitive 20) services/cart/Coupon.php:283— Coupon.couponIsActive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (20 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArticleMysqldb.remove (cognitive 20) services/cms/article/ArticleMysqldb.php:212— ArticleMysqldb.remove has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Menu.getMenuData (cognitive 20) services/page/Menu.php:46— Menu.getMenuData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (6 pts), loops 3 (6 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Theme.getViewFile (cognitive 20) services/page/Theme.php:82— Theme.getViewFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paypal.updateOrderStatusByIpn (cognitive 20) REDACTED:304— Paypal.updateOrderStatusByIpn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (20 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RewriteMysqldb.remove (cognitive 20) services/url/rewrite/RewriteMysqldb.php:144— RewriteMysqldb.remove has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
View.renderBodyEndHtml (cognitive 20) yii/web/View.php:83— View.renderBodyEndHtml has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), 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.
FastClick (cognitive 20) REDACTED:422— FastClick has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, loops 1 (nesting depth added 4). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (removeEventListener, addEventListener, addEventListener::hijacked, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openModal (cognitive 20) REDACTED:1538— openModal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 3). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IScroll (cognitive 20) REDACTED:3918— IScroll has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9, boolean chains 7, if/else 3, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CategoryController.getNumPerPage (cognitive 19) app/appserver/modules/Catalog/controllers/CategoryController.php:553— CategoryController.getNumPerPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
IndexController.getNumPerPage (cognitive 19) app/appserver/modules/Catalogsearch/controllers/IndexController.php:290— IndexController.getNumPerPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
LtDbConfigBuilder.addHost (cognitive 19) lib/alipay/lotusphp_runtime/DB/DbConfigBuilder.php:61— LtDbConfigBuilder.addHost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Customer.save (cognitive 19) services/Customer.php:260— Customer.save has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Request.getRewriteUri (cognitive 19) services/Request.php:71— Request.getRewriteUri has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 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.
CategoryMongodb.save (cognitive 19) services/category/CategoryMongodb.php:145— CategoryMongodb.save has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 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.
Brand.save (cognitive 19) services/product/Brand.php:119— Brand.save has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (4 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Brandcategory.save (cognitive 19) services/product/Brandcategory.php:119— Brandcategory.save has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (4 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sm.handleClicks (cognitive 19) REDACTED:1650— sm.handleClicks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 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.
goTo (cognitive 19) app/appfront/theme/base/front/assets/js/owl.carousel.js:597— goTo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 1 (nesting depth added 3). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ExtensionmarketController.actionAdministertest (cognitive 18) app/appadmin/modules/System/controllers/ExtensionmarketController.php:80— ExtensionmarketController.actionAdministertest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (18 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.
IndexController.getFilterInfo (cognitive 18) app/appserver/modules/Catalogsearch/controllers/IndexController.php:186— IndexController.getFilterInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 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.
CartController.actionAdd (cognitive 18) app/appserver/modules/Checkout/controllers/CartController.php:148— CartController.actionAdd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddressController.actionEdit (cognitive 18) app/appserver/modules/Customer/controllers/AddressController.php:41— AddressController.actionEdit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 1 (4 pts), ternaries 3 (4 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.
WxPayApi.unifiedOrder (cognitive 18) lib/wxpay/lib/WxPay.Api.php:24— WxPayApi.unifiedOrder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Url.getRandomUrlKey (cognitive 18) services/Url.php:438— Url.getRandomUrlKey has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (18 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AR.save (cognitive 18) services/helper/AR.php:90— AR.save has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Country.getStateOptionsByContryCode (cognitive 18) services/helper/Country.php:59— Country.getStateOptionsByContryCode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductMongodb.upsert (cognitive 18) services/product/ProductMongodb.php:469— ProductMongodb.upsert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 2 (4 pts), ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProductMongodb.initSave (cognitive 18) services/product/ProductMongodb.php:735— ProductMongodb.initSave has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProductMysqldb.initSave (cognitive 18) services/product/ProductMysqldb.php:884— ProductMysqldb.initSave has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sm.handleInfiniteScroll (cognitive 18) REDACTED:6520— sm.handleInfiniteScroll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modal (cognitive 18) REDACTED:1271— modal has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (8 pts), boolean chains 4, if/else 4, loops 1 (2 pts) (nesting depth added 3). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProductController.actionIndex (cognitive 17) app/appserver/modules/Catalog/controllers/ProductController.php:190— ProductController.actionIndex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProductController.sortSpuAttr (cognitive 17) app/appserver/modules/Catalog/controllers/ProductController.php:688— ProductController.sortSpuAttr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OrderController.actionView (cognitive 17) app/appserver/modules/Customer/controllers/OrderController.php:222— OrderController.actionView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BaseController.actionWxmenu (cognitive 17) app/appserver/modules/General/controllers/BaseController.php:89— BaseController.actionWxmenu has cognitive complexity 17 (threshold 15). Drivers by points: loops 2 (6 pts), if/else 3 (5 pts), ternaries 1 (5 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.
AopClient.curl (cognitive 17) REDACTED:183— AopClient.curl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LtAction.validateInput (cognitive 17) lib/alipay/lotusphp_runtime/MVC/Action.php:118— LtAction.validateInput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 pts), ternaries 1 (3 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.
Systemhelper.getRecentStatisticsInfo (cognitive 17) services/Systemhelper.php:28— Systemhelper.getRecentStatisticsInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 3, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Menu.hasChildRoleUrlKey (cognitive 17) services/admin/Menu.php:108— Menu.hasChildRoleUrlKey has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jquery.fancybox.$.fn.fancybox (cognitive 17) app/appfront/theme/base/front/assets/fancybox/jquery.fancybox.js:1926— jquery.fancybox.$.fn.fancybox has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8 (nesting depth added 3). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (run). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
getTranslate (cognitive 17) REDACTED:91— getTranslate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Manager.uploadCategory (cognitive 16) app/appadmin/modules/Catalog/block/categoryupload/Manager.php:42— Manager.uploadCategory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Manager.uploadProduct (cognitive 16) app/appadmin/modules/Catalog/block/productupload/Manager.php:31— Manager.uploadProduct has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArticleController.actionUpdateone (cognitive 16) app/appapi/modules/V1/controllers/ArticleController.php:175— ArticleController.actionUpdateone has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 6, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OrderController.actionList (cognitive 16) app/appapi/modules/V1/controllers/OrderController.php:25— OrderController.actionList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 2 (4 pts), ternaries 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProductController.actionUpdateone (cognitive 16) REDACTED:244— ProductController.actionUpdateone has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. 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.
CategoryController.getFilterPrice (cognitive 16) app/appserver/modules/Catalog/controllers/CategoryController.php:447— CategoryController.getFilterPrice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexController.getFilterPrice (cognitive 16) app/appserver/modules/Catalogsearch/controllers/IndexController.php:221— IndexController.getFilterPrice has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 3 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CartController.actionAddcoupon (cognitive 16) app/appserver/modules/Checkout/controllers/CartController.php:221— CartController.actionAddcoupon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), 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.
HomeController.getProductBySkus (cognitive 16) app/appserver/modules/Wx/controllers/HomeController.php:119— HomeController.getProductBySkus has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 2 (3 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ItemController.actionComputesellercount (cognitive 16) app/console/modules/Order/controllers/ItemController.php:43— ItemController.actionComputesellercount has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (5 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.
AppfrontErrorHandler.renderException (cognitive 16) components/AppfrontErrorHandler.php:18— AppfrontErrorHandler.renderException has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 4 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LtAutoloader.scanDirs (cognitive 16) lib/alipay/lotusphp_runtime/Autoloader/Autoloader.php:149— LtAutoloader.scanDirs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LtDbConnectionManager.getCachedConnection (cognitive 16) lib/alipay/lotusphp_runtime/DB/DbConnectionManager.php:55— LtDbConnectionManager.getCachedConnection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LtPagination.renderButton (cognitive 16) lib/alipay/lotusphp_runtime/Pagination/Pagination.php:174— LtPagination.renderButton has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (6 pts), boolean chains 1, match/switch 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.
AdminUserForm.validatePasswordFormat (cognitive 16) models/mysqldb/adminUser/AdminUserForm.php:85— AdminUserForm.validatePasswordFormat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Event.trigger (cognitive 16) services/Event.php:31— Event.trigger has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Helper.htmlEncode (cognitive 16) services/Helper.php:88— Helper.htmlEncode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Menu.getTopMenuHtml (cognitive 16) services/admin/Menu.php:164— Menu.getTopMenuHtml has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 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.
Coupon.addCoupon (cognitive 16) services/cart/Coupon.php:411— Coupon.addCoupon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Order.sendCreateEmail (cognitive 16) services/email/Order.php:46— Order.sendCreateEmail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (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.
Country.getStateByContryCode (cognitive 16) services/helper/Country.php:151— Country.getStateByContryCode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MobileDetect.checkHttpHeadersForMobile (cognitive 16) services/helper/MobileDetect.php:948— MobileDetect.checkHttpHeadersForMobile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 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.
Item.saveOrderItems (cognitive 16) services/order/Item.php:310— Item.saveOrderItems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Wxpay.getStartBizContentAndSetPaymentMethod (cognitive 16) services/payment/Wxpay.php:284— Wxpay.getStartBizContentAndSetPaymentMethod has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WxpayH5.getStartBizContentAndSetPaymentMethod (cognitive 16) services/payment/WxpayH5.php:291— WxpayH5.getStartBizContentAndSetPaymentMethod has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WxpayJsApi.getStartBizContentAndSetPaymentMethod (cognitive 16) services/payment/WxpayJsApi.php:278— WxpayJsApi.getStartBizContentAndSetPaymentMethod has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WxpayMicro.getStartBizContentAndSetPaymentMethod (cognitive 16) services/payment/WxpayMicro.php:263— WxpayMicro.getStartBizContentAndSetPaymentMethod has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductApi.insertByShopfwItem (cognitive 16) services/product/ProductApi.php:491— ProductApi.insertByShopfwItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProductMongodb.remove (cognitive 16) services/product/ProductMongodb.php:783— ProductMongodb.remove has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductMysqldb.spuCollData (cognitive 16) services/product/ProductMysqldb.php:241— ProductMysqldb.spuCollData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 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.
ProductMysqldb.remove (cognitive 16) services/product/ProductMysqldb.php:932— ProductMysqldb.remove has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updatePagination (cognitive 16) app/appfront/theme/base/front/assets/js/owl.carousel.js:454— updatePagination has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), loops 1 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D4 · Code Duplication· Near-duplicate member family (6 members, 19 shared lines) · ×1
Near-duplicate member family (6 members, 19 shared lines) services/email/Customer.php:74— services/email/Customer.php:74-99 | services/email/Customer.php:111-136 | services/email/Customer.php:148-173 | services/email/Customer.php:205-237 | services/email/Customer.php:249-274 | services/email/Order.php:48-77 — These 6 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 15 shared lines) · ×1
Near-duplicate member family (6 members, 15 shared lines) services/product/ProductMongodb.php:342— services/product/ProductMongodb.php:342-459 | services/product/ProductMongodb.php:471-571 | services/product/ProductMongodb.php:1218-1355 | services/product/ProductMysqldb.php:439-557 | services/product/ProductMysqldb.php:570-662 | services/product/ProductMysqldb.php:1422-1560 — These 6 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 22 shared lines) · ×1
Near-duplicate member family (5 members, 22 shared lines) app/appapi/modules/V1/controllers/ArticleController.php:114— app/appapi/modules/V1/controllers/ArticleController.php:114-170 | app/appapi/modules/V1/controllers/ArticleController.php:177-232 | app/appapi/modules/V1/controllers/CategoryController.php:214-304 | app/appapi/modules/V1/controllers/CategoryController.php:315-405 | app/appapi/modules/V1/controllers/CategoryController.php:415-524 — These 5 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 14 shared lines) · ×1
Near-duplicate member family (5 members, 14 shared lines) services/helper/Wx.php:34— services/helper/Wx.php:34-56 | services/payment/Wxpay.php:47-88 | services/payment/WxpayH5.php:47-81 | services/payment/WxpayJsApi.php:47-85 | services/payment/WxpayMicro.php:46-83 — These 5 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 71 shared lines) · ×1
Near-duplicate member family (4 members, 71 shared lines) app/appadmin/modules/System/controllers/ExtensionmarketController.php:132— app/appadmin/modules/System/controllers/ExtensionmarketController.php:132-223 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:229-328 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:334-413 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:419-506 — These 4 members are variants of one another: a block of 71 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 34 shared lines) · ×1
Near-duplicate member family (4 members, 34 shared lines) app/appapi/modules/V1/controllers/CategoryController.php:214— app/appapi/modules/V1/controllers/CategoryController.php:214-304 | app/appapi/modules/V1/controllers/CategoryController.php:315-405 | app/appapi/modules/V1/controllers/CategoryController.php:415-524 | REDACTED:247-325 — These 4 members are variants of one another: a block of 34 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 32 shared lines) · ×1
Near-duplicate member family (4 members, 32 shared lines) services/product/ProductMongodb.php:342— services/product/ProductMongodb.php:342-459 | services/product/ProductMongodb.php:1218-1355 | services/product/ProductMysqldb.php:439-557 | services/product/ProductMysqldb.php:1422-1560 — These 4 members are variants of one another: a block of 32 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 50 shared lines) · ×1
Near-duplicate member family (3 members, 50 shared lines) app/appfront/modules/Catalog/block/product/Index.php:111— app/appfront/modules/Catalog/block/product/Index.php:111-168 | app/apphtml5/modules/Catalog/block/product/Index.php:100-157 | app/appserver/modules/Catalog/controllers/ProductController.php:341-398 — These 3 members are variants of one another: a block of 50 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 44 shared lines) · ×1
Near-duplicate member family (3 members, 44 shared lines) app/appfront/modules/Catalog/block/product/Index.php:385— app/appfront/modules/Catalog/block/product/Index.php:385-434 | app/apphtml5/modules/Catalog/block/product/Index.php:374-423 | app/appserver/modules/Catalog/controllers/ProductController.php:617-668 — These 3 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 19 shared lines) · ×1
Near-duplicate member family (3 members, 19 shared lines) app/appfront/modules/Catalog/block/product/Index.php:459— app/appfront/modules/Catalog/block/product/Index.php:459-481 | app/apphtml5/modules/Catalog/block/product/Index.php:447-469 | app/appserver/modules/Catalog/controllers/ProductController.php:691-713 — These 3 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 12 shared lines) · ×1
Near-duplicate member family (3 members, 12 shared lines) app/appfront/modules/Customer/controllers/GoogleController.php:32— app/appfront/modules/Customer/controllers/GoogleController.php:32-50 | app/apphtml5/modules/Customer/controllers/GoogleController.php:32-50 | app/appserver/modules/Customer/controllers/GoogleController.php:32-55 — These 3 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (220 shared lines) services/product/ProductApi.php:59— services/product/ProductApi.php:59-362 | services/product/ProductApi.php:555-839 — These two members are variants of one another: 220 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (153 shared lines) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:502— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:502-684 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:459-641 — These two members are variants of one another: 153 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (63 shared lines) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:296— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:296-373 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:295-372 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (54 shared lines) app/appadmin/modules/AppadminbaseBlock.php:327— app/appadmin/modules/AppadminbaseBlock.php:327-393 | app/appadmin/modules/Catalog/block/category/Product.php:224-295 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (38 shared lines) services/cms/article/ArticleMysqldb.php:214— services/cms/article/ArticleMysqldb.php:214-264 | services/url/rewrite/RewriteMysqldb.php:146-193 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (36 shared lines) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:102— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:102-166 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:101-165 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) app/appfront/modules/Catalog/block/reviewproduct/Add.php:101— app/appfront/modules/Catalog/block/reviewproduct/Add.php:101-160 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:102-161 — 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 (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) app/appfront/modules/Customer/block/address/Edit.php:27— app/appfront/modules/Customer/block/address/Edit.php:27-73 | app/apphtml5/modules/Customer/block/address/Edit.php:27-73 — 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 (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) services/product/ProductMongodb.php:737— services/product/ProductMongodb.php:737-775 | services/product/ProductMysqldb.php:886-924 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) app/appadmin/modules/AppadminbaseBlock.php:251— app/appadmin/modules/AppadminbaseBlock.php:251-308 | app/appadmin/modules/Catalog/block/category/Product.php:465-523 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) components/AppfrontErrorHandler.php:22— components/AppfrontErrorHandler.php:22-63 | components/AppserverErrorHandler.php:21-56 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) services/product/ProductMongodb.php:942— services/product/ProductMongodb.php:942-983 | services/product/ProductMysqldb.php:1094-1135 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) services/category/CategoryMysqldb.php:211— services/category/CategoryMysqldb.php:211-269 | services/category/CategoryMysqldb.php:282-321 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) services/product/ProductMongodb.php:1360— services/product/ProductMongodb.php:1360-1399 | services/product/ProductMysqldb.php:1567-1605 — 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 (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) app/appfront/modules/Catalog/block/category/Index.php:381— app/appfront/modules/Catalog/block/category/Index.php:381-407 | app/apphtml5/modules/Catalog/block/category/Index.php:368-394 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) services/order/Item.php:122— services/order/Item.php:122-140 | services/order/Item.php:151-170 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) app/appfront/modules/Cms/block/home/Index.php:66— app/appfront/modules/Cms/block/home/Index.php:66-82 | app/apphtml5/modules/Cms/block/home/Index.php:64-80 — 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 (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) app/appadmin/modules/AppadminbaseBlock.php:423— app/appadmin/modules/AppadminbaseBlock.php:423-436 | app/appadmin/modules/Catalog/block/category/Product.php:89-102 — 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· Members sharing a duplicated core (29 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (29 members, 50+ identical tokens) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:50— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:50-59 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:40-49 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:46-55 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:57-66 | app/appadmin/modules/Config/block/appfronthome/Manager.php:41-50 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:46-56 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:49-58 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:40-49 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:46-55 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:57-66 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:40-49 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:35-45 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:50-59 | app/appadmin/modules/Config/block/appserverbase/Manager.php:37-46 | app/appadmin/modules/Config/block/appservercache/Manager.php:46-55 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:57-66 | app/appadmin/modules/Config/block/appserverhome/Manager.php:37-46 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:35-45 | app/appadmin/modules/Config/block/appserverstore/Manager.php:45-54 | app/appadmin/modules/Config/block/base/Manager.php:44-53 | app/appadmin/modules/Config/block/cart/Manager.php:38-47 | app/appadmin/modules/Config/block/email/Manager.php:77-86 | app/appadmin/modules/Config/block/fa/Manager.php:40-49 | app/appadmin/modules/Config/block/order/Manager.php:43-52 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:55-64 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:42-51 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:45-54 | app/appadmin/modules/Config/block/product/Manager.php:42-51 | app/appadmin/modules/Config/block/search/Manager.php:39-48 — These 29 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 29 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 29 times.
D4 · Code Duplication· Members sharing a duplicated core (27 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (27 members, 50+ identical tokens) app/appadmin/modules/Catalog/block/category/Product.php:62— app/appadmin/modules/Catalog/block/category/Product.php:62-81 | app/appadmin/modules/Catalog/block/productattr/Manager.php:46-65 | app/appadmin/modules/Catalog/block/productattrgroup/Manager.php:46-65 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:47-66 | app/appadmin/modules/Catalog/block/productbrandcategory/Manager.php:46-65 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:39-58 | app/appadmin/modules/Catalog/block/productinfo/Index.php:67-86 | app/appadmin/modules/Catalog/block/productreview/Index.php:54-73 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:46-65 | app/appadmin/modules/Cms/block/article/Index.php:48-67 | app/appadmin/modules/Cms/block/staticblock/Index.php:49-68 | app/appadmin/modules/Config/block/appfrontstore/Manager.php:47-66 | app/appadmin/modules/Config/block/apphtml5store/Manager.php:47-66 | app/appadmin/modules/Customer/block/account/Index.php:48-67 | app/appadmin/modules/Customer/block/contacts/Index.php:49-68 | app/appadmin/modules/Customer/block/newsletter/Index.php:48-67 | app/appadmin/modules/Fecadmin/block/account/Manager.php:44-63 | app/appadmin/modules/Fecadmin/block/cache/Index.php:39-58 | app/appadmin/modules/Fecadmin/block/config/Manager.php:44-63 | app/appadmin/modules/Fecadmin/block/log/Index.php:32-51 | app/appadmin/modules/Fecadmin/block/logtj/Index.php:36-55 | app/appadmin/modules/Fecadmin/block/resource/Manager.php:48-67 | app/appadmin/modules/Fecadmin/block/role/Manager.php:48-67 | app/appadmin/modules/Sales/block/coupon/Manager.php:52-71 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:51-70 | app/appadmin/modules/System/block/error/Index.php:44-63 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:54-73 — These 27 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 27 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 27 times.
D4 · Code Duplication· Members sharing a duplicated core (21 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (21 members, 50+ identical tokens) REDACTED:92— REDACTED:92-108 | REDACTED:137-148 | REDACTED:158-169 | REDACTED:179-190 | REDACTED:200-211 | REDACTED:221-232 | REDACTED:241-252 | REDACTED:309-320 | REDACTED:348-359 | REDACTED:368-379 | REDACTED:388-399 | REDACTED:412-423 | REDACTED:432-443 | REDACTED:452-463 | REDACTED:472-483 | REDACTED:492-503 | REDACTED:512-523 | REDACTED:532-543 | REDACTED:552-563 | REDACTED:573-584 | REDACTED:593-604 — These 21 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 21 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 21 times.
D4 · Code Duplication· Members sharing a duplicated core (19 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (19 members, 50+ identical tokens) app/appadmin/modules/Catalog/block/productattr/Manageredit.php:222— app/appadmin/modules/Catalog/block/productattr/Manageredit.php:222-242 | app/appadmin/modules/Catalog/block/productattrgroup/Manageredit.php:143-163 | app/appadmin/modules/Catalog/block/productbrand/Manageredit.php:131-151 | app/appadmin/modules/Catalog/block/productbrandcategory/Manageredit.php:117-137 | app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:690-710 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:647-667 | app/appadmin/modules/Catalog/block/productreview/Manageredit.php:155-175 | app/appadmin/modules/Cms/block/article/Manageredit.php:149-169 | app/appadmin/modules/Cms/block/staticblock/Manageredit.php:127-147 | app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:261-281 | app/appadmin/modules/Config/block/apphtml5store/Manageredit.php:212-232 | app/appadmin/modules/Customer/block/account/Manageredit.php:135-155 | app/appadmin/modules/Customer/block/contacts/Manageredit.php:125-145 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:72-92 | app/appadmin/modules/Fecadmin/block/resource/Manageredit.php:120-140 | app/appadmin/modules/Fecadmin/block/role/Manageredit.php:103-123 | app/appadmin/modules/Sales/block/coupon/Manageredit.php:144-164 | app/appadmin/modules/System/block/extensioninstalled/Manageredit.php:175-195 | app/appadmin/modules/System/block/extensioninstalled/Managerview.php:218-238 — These 19 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 19 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 19 times.
D4 · Code Duplication· Members sharing a duplicated core (17 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (17 members, 50+ identical tokens) app/appadmin/modules/AppadminbaseBlock.php:520— app/appadmin/modules/AppadminbaseBlock.php:520-596 | app/appadmin/modules/Catalog/block/category/Product.php:344-431 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:175-250 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:142-229 | app/appadmin/modules/Catalog/block/productinfo/Index.php:248-373 | app/appadmin/modules/Catalog/block/productreview/Index.php:221-313 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:133-210 | app/appadmin/modules/Cms/block/article/Index.php:164-244 | app/appadmin/modules/Cms/block/staticblock/Index.php:179-259 | app/appadmin/modules/Customer/block/contacts/Index.php:165-240 | app/appadmin/modules/Customer/block/newsletter/Index.php:170-238 | app/appadmin/modules/Fecadmin/block/log/Index.php:133-183 | app/appadmin/modules/Fecadmin/block/logtj/Index.php:179-224 | app/appadmin/modules/Sales/block/coupon/Manager.php:196-275 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:215-301 | app/appadmin/modules/System/block/error/Index.php:158-237 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:202-283 — These 17 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 17 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 17 times.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (11 members, 50+ identical tokens) services/admin/Config.php:74— services/admin/Config.php:74-89 | services/admin/Role.php:88-103 | services/admin/RoleUrlKey.php:78-93 | services/admin/SystemLog.php:84-99 | services/admin/UrlKey.php:109-124 | services/admin/UserRole.php:78-93 | services/adminUser/AdminUser.php:111-126 | services/cms/article/ArticleMysqldb.php:130-145 | services/cms/staticblock/StaticBlockMysqldb.php:96-111 | services/product/Brand.php:97-112 | services/product/Brandcategory.php:82-97 — These 11 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 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
Duplicated block (180 lines × 2) app/appfront/widgets/Page.php:28— app/appfront/widgets/Page.php:28-207 | app/apphtml5/widgets/Page.php:28-207 — before extracting anything, compare `app/appfront/widgets/Page.php` and `app/apphtml5/widgets/Page.php` as WHOLE FILES: 99% 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 (132–134 lines × 2) services/product/ProductApi.php:106— services/product/ProductApi.php:106-237 | services/product/ProductApi.php:610-743 — both copies are in the same file, so extract the 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 `services/product/ProductApi.php:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (93 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:287— app/appfront/modules/Catalog/block/product/Index.php:287-379 | app/apphtml5/modules/Catalog/block/product/Index.php:276-368 | app/appserver/modules/Catalog/controllers/ProductController.php:520-612 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 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 (76 lines × 2) app/appfront/modules/Checkout/block/onepage/Placeorder.php:229— app/appfront/modules/Checkout/block/onepage/Placeorder.php:229-304 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:216-291 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 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 (63 lines × 2) app/appserver/modules/Checkout/block/onepage/Placeorder.php:250— app/appserver/modules/Checkout/block/onepage/Placeorder.php:250-312 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:234-296 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Placeorder.php` and `app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 250 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 (59–60 lines × 2) app/appfront/modules/Checkout/block/onepage/Index.php:506— app/appfront/modules/Checkout/block/onepage/Index.php:506-564 | app/apphtml5/modules/Checkout/block/onepage/Index.php:498-557 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:506` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (59 lines × 2) app/appadmin/modules/System/controllers/ExtensionmarketController.php:164— app/appadmin/modules/System/controllers/ExtensionmarketController.php:164-222 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:269-327 — both copies are in the same file, so extract the 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 (57 lines × 2) app/appfront/modules/Customer/block/editaccount/Index.php:54— app/appfront/modules/Customer/block/editaccount/Index.php:54-110 | app/apphtml5/modules/Customer/block/editaccount/Index.php:44-100 — before extracting anything, compare `app/appfront/modules/Customer/block/editaccount/Index.php` and `app/apphtml5/modules/Customer/block/editaccount/Index.php` as WHOLE FILES: 98% 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/editaccount/Index.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 (56 lines × 2) app/appfront/modules/Payment/block/paypal/standard/Placeorder.php:37— app/appfront/modules/Payment/block/paypal/standard/Placeorder.php:37-92 | app/apphtml5/modules/Payment/block/paypal/standard/Placeorder.php:37-92 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/standard/Placeorder.php` and `app/apphtml5/modules/Payment/block/paypal/standard/Placeorder.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 110 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 (55 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:213— app/appfront/modules/Catalog/block/category/Index.php:213-267 | app/apphtml5/modules/Catalog/block/category/Index.php:202-256 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 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 (52–54 lines × 2) services/product/review/ReviewMongodb.php:394— services/product/review/ReviewMongodb.php:394-447 | services/product/review/ReviewMysqldb.php:409-460 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 (52 lines × 2) services/url/Category.php:78— services/url/Category.php:78-129 | services/url/Category.php:161-212 — both copies are in the same file, so extract the 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 `services/url/Category.php:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (50–51 lines × 4) app/appadmin/modules/System/controllers/ExtensionmarketController.php:140— app/appadmin/modules/System/controllers/ExtensionmarketController.php:140-190 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:245-295 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:341-390 | app/appadmin/modules/System/controllers/ExtensionmarketController.php:433-483 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/System/controllers/ExtensionmarketController.php:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (45–51 lines × 2) app/appfront/modules/Checkout/block/onepage/Placeorder.php:55— app/appfront/modules/Checkout/block/onepage/Placeorder.php:55-105 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:48-92 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.php:55` it begins part-way through the construct above it, so those 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 (48–49 lines × 2) app/appadmin/modules/Config/block/currency/Manager.php:90— app/appadmin/modules/Config/block/currency/Manager.php:90-138 | app/appadmin/modules/Config/block/mutillang/Manager.php:106-153 — `app/appadmin/modules/Config/block/currency/Manager.php` and `app/appadmin/modules/Config/block/mutillang/Manager.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 3 separate duplicated blocks between them, totalling at least 78 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.
Duplicated block (41–43 lines × 2) app/appfront/modules/Checkout/controllers/CartController.php:50— app/appfront/modules/Checkout/controllers/CartController.php:50-92 | app/apphtml5/modules/Checkout/controllers/CartController.php:46-86 — before extracting anything, compare `app/appfront/modules/Checkout/controllers/CartController.php` and `app/apphtml5/modules/Checkout/controllers/CartController.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (42–43 lines × 2) app/appfront/modules/Customer/controllers/FacebookController.php:36— app/appfront/modules/Customer/controllers/FacebookController.php:36-77 | app/apphtml5/modules/Customer/controllers/FacebookController.php:35-77 — before extracting anything, compare `app/appfront/modules/Customer/controllers/FacebookController.php` and `app/apphtml5/modules/Customer/controllers/FacebookController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/FacebookController.php:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (42 lines × 3) app/appfront/modules/Catalog/block/product/Index.php:218— app/appfront/modules/Catalog/block/product/Index.php:218-259 | app/apphtml5/modules/Catalog/block/product/Index.php:208-249 | app/appserver/modules/Catalog/controllers/ProductController.php:451-492 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 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 (39 lines × 2) app/appfront/modules/Catalog/block/reviewproduct/Add.php:55— app/appfront/modules/Catalog/block/reviewproduct/Add.php:55-93 | app/apphtml5/modules/Catalog/block/reviewproduct/Add.php:56-94 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Add.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Add.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 140 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/reviewproduct/Add.php:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37–38 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:292— app/appfront/modules/Catalog/block/category/Index.php:292-329 | app/apphtml5/modules/Catalog/block/category/Index.php:280-316 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33–36 lines × 3) app/appfront/modules/Customer/block/productfavorite/Index.php:75— app/appfront/modules/Customer/block/productfavorite/Index.php:75-110 | app/apphtml5/modules/Customer/block/productfavorite/Index.php:67-102 | app/appserver/modules/Customer/controllers/ProductfavoriteController.php:68-100 — before extracting anything, compare `app/appfront/modules/Customer/block/productfavorite/Index.php` and `app/apphtml5/modules/Customer/block/productfavorite/Index.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/productfavorite/Index.php:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33–34 lines × 4) services/payment/Wxpay.php:288— services/payment/Wxpay.php:288-321 | services/payment/WxpayH5.php:295-327 | services/payment/WxpayJsApi.php:282-314 | services/payment/WxpayMicro.php:267-299 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 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 `services/payment/Wxpay.php:288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31–33 lines × 2) components/AppfrontErrorHandler.php:28— components/AppfrontErrorHandler.php:28-60 | components/AppserverErrorHandler.php:26-56 — before extracting anything, compare `components/AppfrontErrorHandler.php` and `components/AppserverErrorHandler.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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. 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 after the matched lines, `components/AppfrontErrorHandler.php:62` calls `renderException` and `components/AppserverErrorHandler.php:57` 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 (32 lines × 2) app/appfront/modules/Catalogsearch/block/index/Index.php:392— app/appfront/modules/Catalogsearch/block/index/Index.php:392-423 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:415-446 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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–32 lines × 2) app/appfront/modules/Customer/block/account/Login.php:55— app/appfront/modules/Customer/block/account/Login.php:55-86 | app/apphtml5/modules/Customer/block/account/Login.php:47-76 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Login.php` and `app/apphtml5/modules/Customer/block/account/Login.php` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/account/Login.php:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 6) app/appfront/modules/Checkout/block/onepage/Index.php:433— app/appfront/modules/Checkout/block/onepage/Index.php:433-463 | app/appfront/modules/Payment/block/paypal/express/Review.php:366-396 | app/apphtml5/modules/Checkout/block/onepage/Index.php:425-455 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:366-396 | app/appserver/modules/Checkout/block/onepage/Index.php:457-487 | app/appserver/modules/Payment/block/paypal/express/Review.php:387-417 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 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 (31 lines × 3) app/appfront/modules/Checkout/block/onepage/Index.php:392— app/appfront/modules/Checkout/block/onepage/Index.php:392-422 | app/apphtml5/modules/Checkout/block/onepage/Index.php:384-414 | app/appserver/modules/Checkout/block/onepage/Index.php:416-446 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/apphtml5/modules/Checkout/block/onepage/Index.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 423 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29–31 lines × 2) services/product/ProductMysqldb.php:495— services/product/ProductMysqldb.php:495-525 | services/product/ProductMysqldb.php:1499-1527 — both copies are in the same file, so extract the 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 `services/product/ProductMysqldb.php:495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) app/appfront/modules/Customer/block/contacts/Index.php:73— app/appfront/modules/Customer/block/contacts/Index.php:73-102 | app/apphtml5/modules/Customer/block/contacts/Index.php:74-103 — before extracting anything, compare `app/appfront/modules/Customer/block/contacts/Index.php` and `app/apphtml5/modules/Customer/block/contacts/Index.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/contacts/Index.php:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 10) app/appadmin/modules/Catalog/block/category/Product.php:386— app/appadmin/modules/Catalog/block/category/Product.php:386-414 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:182-210 | app/appadmin/modules/Catalog/block/productreview/Index.php:263-291 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:163-191 | app/appadmin/modules/Cms/block/article/Index.php:194-222 | app/appadmin/modules/Cms/block/staticblock/Index.php:209-237 | app/appadmin/modules/Sales/block/coupon/Manager.php:226-254 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:250-278 | app/appadmin/modules/System/block/error/Index.php:188-216 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:232-260 — before extracting anything, compare `app/appadmin/modules/Catalog/block/category/Product.php` and `app/appadmin/modules/Catalog/block/productfavorite/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/category/Product.php:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–29 lines × 2) app/appfront/modules/Catalog/block/favoriteproduct/Add.php:25— app/appfront/modules/Catalog/block/favoriteproduct/Add.php:25-52 | app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php:25-53 — before extracting anything, compare `app/appfront/modules/Catalog/block/favoriteproduct/Add.php` and `app/apphtml5/modules/Catalog/block/favoriteproduct/Add.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 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 `app/appfront/modules/Catalog/block/favoriteproduct/Add.php:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appfront/modules/Catalog/block/favoriteproduct/Add.php:52` calls `redirectByUrlKey` and `app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php:53` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–29 lines × 3) app/appfront/modules/Customer/block/account/Resetpassword.php:52— app/appfront/modules/Customer/block/account/Resetpassword.php:52-79 | app/apphtml5/modules/Customer/block/account/Resetpassword.php:42-70 | REDACTED:221-224 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Resetpassword.php` and `app/apphtml5/modules/Customer/block/account/Resetpassword.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `app/appfront/modules/Customer/block/account/Resetpassword.php:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (27–29 lines × 2) app/appfront/modules/Payment/block/paypal/standard/Start.php:24— app/appfront/modules/Payment/block/paypal/standard/Start.php:24-52 | app/apphtml5/modules/Payment/block/paypal/standard/Start.php:23-49 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/standard/Start.php` and `app/apphtml5/modules/Payment/block/paypal/standard/Start.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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (28 lines × 4) services/payment/Wxpay.php:330— services/payment/Wxpay.php:330-357 | services/payment/WxpayH5.php:341-368 | services/payment/WxpayJsApi.php:328-355 | services/payment/WxpayMicro.php:313-340 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 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 `services/payment/Wxpay.php:330` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (28 lines × 3) services/product/ProductMongodb.php:956— services/product/ProductMongodb.php:956-983 | services/product/ProductMysqldb.php:1108-1135 | services/product/ProductMysqldb.php:1271-1298 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/product/ProductMongodb.php:955` calls `andWhere`, `getEnableStatus` and `services/product/ProductMysqldb.php:1270` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (26–28 lines × 2) app/appserver/modules/Checkout/block/onepage/Placeorder.php:101— app/appserver/modules/Checkout/block/onepage/Placeorder.php:101-126 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:83-110 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Placeorder.php` and `app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 250 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Checkout/block/onepage/Placeorder.php:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–26 lines × 4) app/appapi/modules/V1/controllers/CategoryController.php:254— app/appapi/modules/V1/controllers/CategoryController.php:254-276 | app/appapi/modules/V1/controllers/CategoryController.php:355-377 | app/appapi/modules/V1/controllers/CategoryController.php:474-496 | REDACTED:276-301 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/CategoryController.php:254` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25–26 lines × 2) app/appadmin/modules/Config/block/appserverstorelang/Manager.php:113— app/appadmin/modules/Config/block/appserverstorelang/Manager.php:113-137 | app/appadmin/modules/Config/block/categorysort/Manager.php:116-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.
Duplicated block (24–26 lines × 2) app/appserver/modules/Checkout/block/onepage/Index.php:54— app/appserver/modules/Checkout/block/onepage/Index.php:54-79 | app/appserver/modules/Payment/block/paypal/express/Review.php:54-77 — before extracting anything, compare `app/appserver/modules/Checkout/block/onepage/Index.php` and `app/appserver/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 254 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 × 4) app/appfront/modules/Checkout/block/onepage/Placeorder.php:168— app/appfront/modules/Checkout/block/onepage/Placeorder.php:168-192 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:155-179 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:190-214 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:174-198 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.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 (24–25 lines × 2) services/page/Theme.php:106— services/page/Theme.php:106-130 | services/page/Widget.php:234-257 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 4) app/appfront/modules/Catalog/controllers/CategoryController.php:71— app/appfront/modules/Catalog/controllers/CategoryController.php:71-95 | app/appfront/modules/Cms/controllers/ArticleController.php:70-93 | app/apphtml5/modules/Catalog/controllers/CategoryController.php:61-84 | app/apphtml5/modules/Cms/controllers/ArticleController.php:58-82 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/CategoryController.php` and `app/appfront/modules/Cms/controllers/ArticleController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/controllers/CategoryController.php:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–24 lines × 3) services/product/ProductMysqldb.php:1166— services/product/ProductMysqldb.php:1166-1188 | services/product/ProductMysqldb.php:1243-1266 | services/product/ProductMysqldb.php:1327-1350 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21–23 lines × 2) services/Extension.php:403— services/Extension.php:403-423 | services/Extension.php:428-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19–23 lines × 2) services/product/ProductApi.php:244— services/product/ProductApi.php:244-262 | services/product/ProductApi.php:734-756 — both copies are in the same file, so extract the 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 `services/product/ProductApi.php:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (22 lines × 9) app/appfront/modules/Checkout/block/cart/Index.php:147— app/appfront/modules/Checkout/block/cart/Index.php:147-168 | app/appfront/modules/Checkout/block/onepage/Index.php:319-340 | app/appfront/modules/Payment/block/paypal/express/Review.php:261-282 | app/apphtml5/modules/Checkout/block/cart/Index.php:136-157 | app/apphtml5/modules/Checkout/block/onepage/Index.php:309-330 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:261-282 | app/appserver/modules/Checkout/block/onepage/Index.php:343-364 | app/appserver/modules/Checkout/controllers/CartController.php:119-140 | app/appserver/modules/Payment/block/paypal/express/Review.php:282-303 — `app/appfront/modules/Checkout/block/cart/Index.php` and `app/appfront/modules/Checkout/block/onepage/Index.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 6 separate duplicated blocks between them, totalling at least 65 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.
Duplicated block (21–22 lines × 5) services/payment/Alipay.php:295— services/payment/Alipay.php:295-316 | services/payment/Wxpay.php:393-413 | services/payment/WxpayH5.php:404-424 | services/payment/WxpayJsApi.php:391-411 | services/payment/WxpayMicro.php:376-396 — 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 5 call sites, so a change lands once.
Duplicated block (19–22 lines × 3) services/payment/WxpayH5.php:63— services/payment/WxpayH5.php:63-81 | services/payment/WxpayJsApi.php:64-85 | services/payment/WxpayMicro.php:62-83 — before extracting anything, compare `services/payment/WxpayH5.php` and `services/payment/WxpayJsApi.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 226 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 (4–22 lines × 3) app/appapi/modules/V1/controllers/ProductbrandController.php:71— app/appapi/modules/V1/controllers/ProductbrandController.php:71-93 | app/appapi/modules/V1/controllers/ProductbrandController.php:123-126 | app/appapi/modules/V1/controllers/ProductbrandcategoryController.php:69-90 — before extracting anything, compare `app/appapi/modules/V1/controllers/ProductbrandController.php` and `app/appapi/modules/V1/controllers/ProductbrandcategoryController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appapi/modules/V1/controllers/ProductbrandController.php:69` calls `post` and `app/appapi/modules/V1/controllers/ProductbrandcategoryController.php:68` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–22 lines × 2) migrations/mysqldb/m191219_070617_fecshop_tables.php:16— migrations/mysqldb/m191219_070617_fecshop_tables.php:16-37 | migrations/mysqldb/m200331_082139_fecshop_tables.php:71-85 — 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 `migrations/mysqldb/m200331_082139_fecshop_tables.php:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–22 lines × 2) services/search/MongoSearch.php:339— services/search/MongoSearch.php:339-360 | services/search/XunSearch.php:233-246 — before extracting anything, compare `services/search/MongoSearch.php` and `services/search/XunSearch.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 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 `services/search/MongoSearch.php:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 19) app/appadmin/modules/Catalog/block/productattr/Manageredit.php:222— app/appadmin/modules/Catalog/block/productattr/Manageredit.php:222-242 | app/appadmin/modules/Catalog/block/productattrgroup/Manageredit.php:143-163 | app/appadmin/modules/Catalog/block/productbrand/Manageredit.php:131-151 | app/appadmin/modules/Catalog/block/productbrandcategory/Manageredit.php:117-137 | app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:690-710 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:647-667 | app/appadmin/modules/Catalog/block/productreview/Manageredit.php:155-175 | app/appadmin/modules/Cms/block/article/Manageredit.php:149-169 | app/appadmin/modules/Cms/block/staticblock/Manageredit.php:127-147 | app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:261-281 | app/appadmin/modules/Config/block/apphtml5store/Manageredit.php:212-232 | app/appadmin/modules/Customer/block/account/Manageredit.php:135-155 | app/appadmin/modules/Customer/block/contacts/Manageredit.php:125-145 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:72-92 | app/appadmin/modules/Fecadmin/block/resource/Manageredit.php:120-140 | app/appadmin/modules/Fecadmin/block/role/Manageredit.php:103-123 | app/appadmin/modules/Sales/block/coupon/Manageredit.php:144-164 | app/appadmin/modules/System/block/extensioninstalled/Manageredit.php:175-195 | app/appadmin/modules/System/block/extensioninstalled/Managerview.php:218-238 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productattr/Manageredit.php` and `app/appadmin/modules/Customer/block/contacts/Manageredit.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (14–21 lines × 4) services/payment/Wxpay.php:57— services/payment/Wxpay.php:57-70 | services/payment/WxpayH5.php:57-73 | services/payment/WxpayJsApi.php:57-77 | services/payment/WxpayMicro.php:55-75 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 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 × 3) app/appadmin/modules/Cms/block/article/Manageredit.php:123— app/appadmin/modules/Cms/block/article/Manageredit.php:123-143 | app/appadmin/modules/Cms/block/staticblock/Manageredit.php:101-121 | app/appadmin/modules/System/block/extensioninstalled/Managerview.php:154-174 — `app/appadmin/modules/Cms/block/article/Manageredit.php` and `app/appadmin/modules/Cms/block/staticblock/Manageredit.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 2 separate duplicated blocks between them, totalling at least 42 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.
Duplicated block (19–21 lines × 3) app/appfront/modules/Catalog/block/category/Index.php:389— app/appfront/modules/Catalog/block/category/Index.php:389-407 | app/apphtml5/modules/Catalog/block/category/Index.php:376-394 | app/appserver/modules/Catalog/controllers/CategoryController.php:524-544 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/apphtml5/modules/Catalog/block/category/Index.php` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 393 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:389` it begins part-way through the construct above it, so those 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 (20 lines × 27) app/appadmin/modules/Catalog/block/category/Product.php:62— app/appadmin/modules/Catalog/block/category/Product.php:62-81 | app/appadmin/modules/Catalog/block/productattr/Manager.php:46-65 | app/appadmin/modules/Catalog/block/productattrgroup/Manager.php:46-65 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:47-66 | app/appadmin/modules/Catalog/block/productbrandcategory/Manager.php:46-65 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:39-58 | app/appadmin/modules/Catalog/block/productinfo/Index.php:67-86 | app/appadmin/modules/Catalog/block/productreview/Index.php:54-73 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:46-65 | app/appadmin/modules/Cms/block/article/Index.php:48-67 | app/appadmin/modules/Cms/block/staticblock/Index.php:49-68 | app/appadmin/modules/Config/block/appfrontstore/Manager.php:47-66 | app/appadmin/modules/Config/block/apphtml5store/Manager.php:47-66 | app/appadmin/modules/Customer/block/account/Index.php:48-67 | app/appadmin/modules/Customer/block/contacts/Index.php:49-68 | app/appadmin/modules/Customer/block/newsletter/Index.php:48-67 | app/appadmin/modules/Fecadmin/block/account/Manager.php:44-63 | app/appadmin/modules/Fecadmin/block/cache/Index.php:39-58 | app/appadmin/modules/Fecadmin/block/config/Manager.php:44-63 | app/appadmin/modules/Fecadmin/block/log/Index.php:32-51 | app/appadmin/modules/Fecadmin/block/logtj/Index.php:36-55 | app/appadmin/modules/Fecadmin/block/resource/Manager.php:48-67 | app/appadmin/modules/Fecadmin/block/role/Manager.php:48-67 | app/appadmin/modules/Sales/block/coupon/Manager.php:52-71 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:51-70 | app/appadmin/modules/System/block/error/Index.php:44-63 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:54-73 — before extracting anything, compare `app/appadmin/modules/Catalog/block/category/Product.php` and `app/appadmin/modules/Catalog/block/productbrand/Manager.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 5) app/appapi/modules/V1/controllers/CategoryController.php:47— app/appapi/modules/V1/controllers/CategoryController.php:47-66 | app/appapi/modules/V1/controllers/ProductattrController.php:49-68 | app/appapi/modules/V1/controllers/ProductattrgroupController.php:49-68 | app/appapi/modules/V1/controllers/ProductbrandController.php:41-60 | app/appapi/modules/V1/controllers/ProductbrandcategoryController.php:41-60 — before extracting anything, compare `app/appapi/modules/V1/controllers/ProductattrController.php` and `app/appapi/modules/V1/controllers/ProductattrgroupController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appapi/modules/V1/controllers/CategoryController.php:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–20 lines × 5) migrations/mysqldb/m181126_143605_fecshop_tables.php:16— migrations/mysqldb/m181126_143605_fecshop_tables.php:16-33 | migrations/mysqldb/m190730_130707_fecshop_tables.php:16-33 | migrations/mysqldb/m190809_154516_fecshop_tables.php:16-34 | migrations/mysqldb/m190904_025251_fecshop_tables.php:40-58 | migrations/mysqldb/m200331_082139_fecshop_tables.php:16-35 — 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 5 call sites, so a change lands once.
Duplicated block (18–19 lines × 7) app/appfront/modules/Checkout/block/onepage/Placeorder.php:307— app/appfront/modules/Checkout/block/onepage/Placeorder.php:307-325 | app/appfront/modules/Payment/block/paypal/express/Placeorder.php:230-247 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:293-310 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:230-247 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:314-331 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:298-315 | app/appserver/modules/Payment/block/paypal/express/Placeorder.php:284-301 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.php:307` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17–19 lines × 6) app/appfront/modules/Payment/block/paypal/express/Placeorder.php:157— app/appfront/modules/Payment/block/paypal/express/Placeorder.php:157-173 | app/appfront/modules/Payment/block/paypal/standard/Placeorder.php:103-121 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:157-173 | app/apphtml5/modules/Payment/block/paypal/standard/Placeorder.php:103-121 | app/appserver/modules/Payment/block/paypal/express/Placeorder.php:194-210 | app/appserver/modules/Payment/block/paypal/standard/Placeorder.php:117-135 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Placeorder.php` and `app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 188 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 (15–19 lines × 4) app/appfront/modules/Catalog/block/category/Index.php:217— app/appfront/modules/Catalog/block/category/Index.php:217-231 | app/appfront/modules/Catalogsearch/block/index/Index.php:109-127 | app/apphtml5/modules/Catalog/block/category/Index.php:206-220 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:132-150 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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. 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 (18–19 lines × 3) app/appfront/modules/Cms/controllers/HomeController.php:39— app/appfront/modules/Cms/controllers/HomeController.php:39-56 | app/apphtml5/modules/Cms/controllers/HomeController.php:26-44 | app/appserver/modules/Cms/controllers/HomeController.php:23-40 — before extracting anything, compare `app/appfront/modules/Cms/controllers/HomeController.php` and `app/apphtml5/modules/Cms/controllers/HomeController.php` as WHOLE FILES: 89% 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Cms/controllers/HomeController.php:39` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) services/cart/QuoteItem.php:200— services/cart/QuoteItem.php:200-217 | services/cart/QuoteItem.php:228-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 9) app/appfront/modules/Checkout/block/onepage/Index.php:140— app/appfront/modules/Checkout/block/onepage/Index.php:140-157 | app/appfront/modules/Checkout/block/onepage/Index.php:184-201 | app/appfront/modules/Payment/block/paypal/express/Review.php:80-97 | app/apphtml5/modules/Checkout/block/onepage/Index.php:130-147 | app/apphtml5/modules/Checkout/block/onepage/Index.php:174-191 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:80-97 | app/appserver/modules/Checkout/block/onepage/Index.php:152-169 | app/appserver/modules/Checkout/block/onepage/Index.php:196-213 | app/appserver/modules/Payment/block/paypal/express/Review.php:95-112 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 6) app/appfront/modules/Checkout/block/onepage/Index.php:385— app/appfront/modules/Checkout/block/onepage/Index.php:385-402 | app/appfront/modules/Payment/block/paypal/express/Review.php:327-344 | app/apphtml5/modules/Checkout/block/onepage/Index.php:377-394 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:327-344 | app/appserver/modules/Checkout/block/onepage/Index.php:409-426 | app/appserver/modules/Payment/block/paypal/express/Review.php:348-365 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 5) app/appadmin/modules/AppadminbaseBlock.php:554— app/appadmin/modules/AppadminbaseBlock.php:554-571 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:209-226 | app/appadmin/modules/Catalog/block/productinfo/Index.php:328-345 | app/appadmin/modules/Customer/block/contacts/Index.php:199-216 | app/appadmin/modules/Customer/block/newsletter/Index.php:203-220 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/productbrand/Manager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:554` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–18 lines × 4) app/appapi/modules/V1/controllers/ArticleController.php:185— app/appapi/modules/V1/controllers/ArticleController.php:185-195 | app/appapi/modules/V1/controllers/CategoryController.php:238-255 | app/appapi/modules/V1/controllers/CategoryController.php:339-356 | REDACTED:268-277 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (17–18 lines × 4) services/Extension.php:132— services/Extension.php:132-149 | services/StoreBaseConfig.php:126-143 | services/StoreDomain.php:128-145 | services/helper/ScriptDate.php:130-146 — before extracting anything, compare `services/Extension.php` and `services/StoreBaseConfig.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `services/Extension.php:132` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/Extension.php:129` calls `getCurrentDateTime` and `services/helper/ScriptDate.php:127` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 3) app/appfront/modules/Payment/block/paypal/express/Review.php:111— app/appfront/modules/Payment/block/paypal/express/Review.php:111-128 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:111-128 | app/appserver/modules/Payment/block/paypal/express/Review.php:126-143 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Review.php` and `app/apphtml5/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Review.php:111` it begins part-way through the construct above it, so those exact lines 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–18 lines × 2) services/category/CategoryMongodb.php:387— services/category/CategoryMongodb.php:387-404 | services/category/CategoryMysqldb.php:452-467 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:387` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 5) app/appadmin/modules/AppadminController.php:151— app/appadmin/modules/AppadminController.php:151-167 | app/appfront/modules/AppfrontController.php:66-82 | app/apphtml5/modules/AppfrontController.php:66-82 | app/appserver/modules/AppserverController.php:49-65 | app/appserver/modules/AppserverTokenController.php:85-101 — before extracting anything, compare `app/appadmin/modules/AppadminController.php` and `app/appfront/modules/AppfrontController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 (16–17 lines × 4) services/payment/Wxpay.php:248— services/payment/Wxpay.php:248-264 | services/payment/WxpayH5.php:256-271 | services/payment/WxpayJsApi.php:242-258 | services/payment/WxpayMicro.php:227-243 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–17 lines × 3) app/appserver/modules/Customer/controllers/AccountController.php:95— app/appserver/modules/Customer/controllers/AccountController.php:95-105 | app/appserver/modules/Customer/controllers/ForgotController.php:38-48 | app/appserver/modules/Customer/controllers/RegisterController.php:212-228 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (13–17 lines × 2) app/appfront/modules/Catalog/block/product/Index.php:63— app/appfront/modules/Catalog/block/product/Index.php:63-79 | app/apphtml5/modules/Catalog/block/product/Index.php:58-70 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appfront/modules/Catalog/block/product/Index.php:60` calls `get` and `app/apphtml5/modules/Catalog/block/product/Index.php:57` 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–17 lines × 2) app/appserver/modules/Catalogsearch/controllers/IndexController.php:55— app/appserver/modules/Catalogsearch/controllers/IndexController.php:55-71 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:123-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 9) app/appfront/modules/Catalog/controllers/CategoryController.php:55— app/appfront/modules/Catalog/controllers/CategoryController.php:55-70 | app/appfront/modules/Catalog/controllers/ProductController.php:54-69 | app/appfront/modules/Cms/controllers/ArticleController.php:54-69 | app/apphtml5/modules/Catalog/controllers/CategoryController.php:45-60 | app/apphtml5/modules/Catalog/controllers/ProductController.php:45-60 | app/apphtml5/modules/Cms/controllers/ArticleController.php:42-57 | app/appserver/modules/Catalog/controllers/CategoryController.php:63-78 | app/appserver/modules/Catalog/controllers/ProductController.php:55-70 | app/appserver/modules/Cms/controllers/ArticleController.php:58-73 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/CategoryController.php` and `app/appfront/modules/Cms/controllers/ArticleController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/controllers/CategoryController.php:55` it does not close everything it opens, so those exact lines 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–16 lines × 6) app/appfront/modules/Checkout/block/onepage/Index.php:358— app/appfront/modules/Checkout/block/onepage/Index.php:358-371 | app/appfront/modules/Payment/block/paypal/express/Review.php:300-313 | app/apphtml5/modules/Checkout/block/onepage/Index.php:348-363 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:300-313 | app/appserver/modules/Checkout/block/onepage/Index.php:382-395 | app/appserver/modules/Payment/block/paypal/express/Review.php:321-334 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 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–16 lines × 4) services/extension/Administer.php:81— services/extension/Administer.php:81-96 | services/extension/Administer.php:131-146 | services/extension/Administer.php:192-206 | services/extension/Administer.php:241-256 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/extension/Administer.php:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–16 lines × 3) app/appfront/modules/Catalogsearch/block/index/Index.php:363— app/appfront/modules/Catalogsearch/block/index/Index.php:363-378 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:386-401 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:451-465 — before extracting anything, compare `app/appfront/modules/Catalogsearch/block/index/Index.php` and `app/apphtml5/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 295 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 (14–16 lines × 3) app/appfront/modules/Customer/block/account/Register.php:84— app/appfront/modules/Customer/block/account/Register.php:84-99 | app/apphtml5/modules/Customer/block/account/Register.php:75-90 | app/appserver/modules/Customer/controllers/RegisterController.php:47-60 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Register.php` and `app/apphtml5/modules/Customer/block/account/Register.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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. Note first that the copies are not typed on the same thing: `Email` names `fecshop\app\appfront\helper\mailer\Email` in one and `fecshop\app\apphtml5\helper\mailer\Email` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13–16 lines × 2) app/appadmin/modules/Catalog/block/productfavorite/Index.php:160— app/appadmin/modules/Catalog/block/productfavorite/Index.php:160-172 | app/appadmin/modules/Catalog/block/productreview/Index.php:238-253 — `app/appadmin/modules/Catalog/block/productfavorite/Index.php` and `app/appadmin/modules/Catalog/block/productreview/Index.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 11 separate duplicated blocks between them, totalling at least 143 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/appadmin/modules/Catalog/block/productfavorite/Index.php:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–16 lines × 6) app/appfront/modules/Checkout/block/cart/Index.php:124— app/appfront/modules/Checkout/block/cart/Index.php:124-139 | app/appfront/modules/Checkout/block/onepage/Index.php:292-295 | app/appfront/modules/Payment/block/paypal/express/Review.php:234-237 | app/apphtml5/modules/Checkout/block/cart/Index.php:113-128 | app/apphtml5/modules/Checkout/block/onepage/Index.php:282-285 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:234-237 — `app/appfront/modules/Checkout/block/cart/Index.php` and `app/appfront/modules/Checkout/block/onepage/Index.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 6 separate duplicated blocks between them, totalling at least 65 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/appfront/modules/Checkout/block/cart/Index.php:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appfront/modules/Checkout/block/cart/Index.php:124` calls `getUrl` and `app/appfront/modules/Checkout/block/onepage/Index.php:292` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–16 lines × 3) services/category/CategoryMysqldb.php:250— services/category/CategoryMysqldb.php:250-265 | services/category/CategoryMysqldb.php:304-319 | services/category/CategoryMysqldb.php:754-757 — 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 `services/category/CategoryMysqldb.php:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/category/CategoryMysqldb.php:266` calls `foreach`, `unserialize` and `services/category/CategoryMysqldb.php:321` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–16 lines × 2) services/product/ProductApi.php:326— services/product/ProductApi.php:326-341 | services/product/ProductApi.php:788-798 — both copies are in the same file, so extract the 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–15 lines × 13) app/appadmin/modules/AppadminbaseBlock.php:572— app/appadmin/modules/AppadminbaseBlock.php:572-583 | app/appadmin/modules/Catalog/block/category/Product.php:412-425 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:208-222 | app/appadmin/modules/Catalog/block/productreview/Index.php:289-303 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:189-203 | app/appadmin/modules/Cms/block/article/Index.php:220-234 | app/appadmin/modules/Cms/block/staticblock/Index.php:235-249 | app/appadmin/modules/Customer/block/contacts/Index.php:217-228 | app/appadmin/modules/Customer/block/newsletter/Index.php:221-232 | app/appadmin/modules/Sales/block/coupon/Manager.php:252-265 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:276-290 | app/appadmin/modules/System/block/error/Index.php:214-228 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:258-272 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:572` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appadmin/modules/AppadminbaseBlock.php:585` calls `__` and `app/appadmin/modules/Customer/block/newsletter/Index.php:233` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 11) services/admin/Config.php:75— services/admin/Config.php:75-89 | services/admin/Role.php:89-103 | services/admin/RoleUrlKey.php:79-93 | services/admin/SystemLog.php:85-99 | services/admin/UrlKey.php:110-124 | services/admin/UserRole.php:79-93 | services/adminUser/AdminUser.php:112-126 | services/cms/article/ArticleMysqldb.php:131-145 | services/cms/staticblock/StaticBlockMysqldb.php:97-111 | services/product/Brand.php:98-112 | services/product/Brandcategory.php:83-97 — before extracting anything, compare `services/admin/Role.php` and `services/admin/UserRole.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 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 (15 lines × 6) services/product/ProductMongodb.php:373— services/product/ProductMongodb.php:373-387 | services/product/ProductMongodb.php:512-526 | services/product/ProductMongodb.php:1247-1261 | services/product/ProductMysqldb.php:474-488 | services/product/ProductMysqldb.php:605-619 | services/product/ProductMysqldb.php:1453-1467 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 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 `services/product/ProductMongodb.php:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/product/ProductMysqldb.php:1451` calls `unserializeData` and `services/product/ProductMongodb.php:371` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 5) app/appfront/modules/Payment/block/paypal/express/Placeorder.php:208— app/appfront/modules/Payment/block/paypal/express/Placeorder.php:208-222 | app/appfront/modules/Payment/block/paypal/standard/Placeorder.php:156-170 | app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php:208-222 | app/apphtml5/modules/Payment/block/paypal/standard/Placeorder.php:156-170 | app/appserver/modules/Payment/block/paypal/standard/Placeorder.php:170-184 — before extracting anything, compare `app/appfront/modules/Payment/block/paypal/express/Placeorder.php` and `app/apphtml5/modules/Payment/block/paypal/express/Placeorder.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 188 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Payment/block/paypal/express/Placeorder.php:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–15 lines × 5) services/helper/Wx.php:34— services/helper/Wx.php:34-48 | services/payment/Wxpay.php:48-62 | services/payment/WxpayH5.php:48-62 | services/payment/WxpayJsApi.php:48-62 | services/payment/WxpayMicro.php:47-60 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/payment/Wxpay.php:47` calls `ini_set` and `services/helper/Wx.php:33` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 4) services/payment/Wxpay.php:139— services/payment/Wxpay.php:139-153 | services/payment/WxpayH5.php:132-146 | services/payment/WxpayJsApi.php:136-150 | services/payment/WxpayMicro.php:134-148 — before extracting anything, compare `services/payment/Wxpay.php` and `services/payment/WxpayH5.php` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 204 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–15 lines × 3) app/appadmin/modules/AppadminbaseBlockEdit.php:289— app/appadmin/modules/AppadminbaseBlockEdit.php:289-303 | app/appadmin/modules/Fecadmin/block/account/Manageredit.php:245-257 | app/appadmin/modules/Fecadmin/block/config/Manageredit.php:176-187 — `app/appadmin/modules/Fecadmin/block/account/Manageredit.php` and `app/appadmin/modules/Fecadmin/block/config/Manageredit.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 4 separate duplicated blocks between them, totalling at least 80 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/appadmin/modules/AppadminbaseBlockEdit.php:289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–15 lines × 2) app/appserver/modules/Catalog/controllers/CategoryController.php:138— app/appserver/modules/Catalog/controllers/CategoryController.php:138-152 | app/appserver/modules/Catalog/controllers/CategoryController.php:232-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 10) app/appfront/modules/Catalog/controllers/CategoryController.php:51— app/appfront/modules/Catalog/controllers/CategoryController.php:51-64 | app/appfront/modules/Catalog/controllers/ProductController.php:50-63 | app/appfront/modules/Cms/controllers/ArticleController.php:50-63 | app/apphtml5/modules/Catalog/controllers/CategoryController.php:41-54 | app/apphtml5/modules/Catalog/controllers/ProductController.php:41-54 | app/apphtml5/modules/Cms/controllers/ArticleController.php:38-51 | app/appserver/modules/Catalog/controllers/CategoryController.php:59-72 | app/appserver/modules/Catalog/controllers/ProductController.php:51-64 | app/appserver/modules/Cms/controllers/ArticleController.php:54-67 | app/appserver/modules/General/controllers/BaseController.php:24-37 — before extracting anything, compare `app/appfront/modules/Catalog/controllers/CategoryController.php` and `app/appfront/modules/Cms/controllers/ArticleController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/controllers/CategoryController.php:51` it does not close everything it opens, so those exact lines 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 × 6) services/extension/Administer.php:65— services/extension/Administer.php:65-78 | services/extension/Administer.php:115-128 | services/extension/Administer.php:176-189 | services/extension/Administer.php:225-238 | services/extension/Administer.php:286-299 | services/extension/Administer.php:342-354 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/extension/Administer.php:65` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13–14 lines × 5) app/appadmin/modules/AppadminController.php:105— app/appadmin/modules/AppadminController.php:105-117 | app/appadmin/modules/Fecadmin/controllers/LoginController.php:124-136 | app/appadmin/modules/Fecadmin/controllers/LogoutController.php:91-103 | app/appfront/modules/AppfrontController.php:115-128 | app/apphtml5/modules/AppfrontController.php:109-122 — before extracting anything, compare `app/appadmin/modules/AppadminController.php` and `app/appadmin/modules/Fecadmin/controllers/LoginController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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–14 lines × 4) app/appfront/modules/Catalog/block/category/Index.php:386— app/appfront/modules/Catalog/block/category/Index.php:386-398 | app/appfront/modules/Catalogsearch/block/index/Index.php:265-278 | app/apphtml5/modules/Catalog/block/category/Index.php:373-385 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:288-301 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:386` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 3) app/appserver/modules/Catalog/controllers/CategoryController.php:133— app/appserver/modules/Catalog/controllers/CategoryController.php:133-146 | app/appserver/modules/Catalog/controllers/CategoryController.php:180-193 | app/appserver/modules/Catalog/controllers/CategoryController.php:227-239 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 × 15) app/appadmin/modules/AppadminbaseBlock.php:538— app/appadmin/modules/AppadminbaseBlock.php:538-550 | app/appadmin/modules/Catalog/block/category/Product.php:381-393 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:193-205 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:177-189 | app/appadmin/modules/Catalog/block/productinfo/Index.php:312-324 | app/appadmin/modules/Catalog/block/productreview/Index.php:258-270 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:158-170 | app/appadmin/modules/Cms/block/article/Index.php:189-201 | app/appadmin/modules/Cms/block/staticblock/Index.php:204-216 | app/appadmin/modules/Customer/block/contacts/Index.php:183-195 | app/appadmin/modules/Customer/block/newsletter/Index.php:187-199 | app/appadmin/modules/Sales/block/coupon/Manager.php:221-233 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:245-257 | app/appadmin/modules/System/block/error/Index.php:183-195 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:227-239 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:538` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–13 lines × 14) app/appfront/modules/Checkout/block/onepage/Index.php:149— app/appfront/modules/Checkout/block/onepage/Index.php:149-161 | app/appfront/modules/Checkout/block/onepage/Index.php:193-205 | app/appfront/modules/Payment/block/paypal/express/Review.php:89-101 | app/appfront/modules/Payment/block/paypal/express/Review.php:428-437 | app/appfront/modules/Payment/block/paypal/express/Review.php:447-456 | app/apphtml5/modules/Checkout/block/onepage/Index.php:139-151 | app/apphtml5/modules/Checkout/block/onepage/Index.php:183-195 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:89-101 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:428-437 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:447-456 | app/appserver/modules/Checkout/block/onepage/Index.php:161-173 | app/appserver/modules/Checkout/block/onepage/Index.php:205-217 | app/appserver/modules/Payment/block/paypal/express/Review.php:104-116 | app/appserver/modules/Payment/block/paypal/express/Review.php:463-472 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appfront/modules/Payment/block/paypal/express/Review.php:426` calls `setValue` and `app/appfront/modules/Payment/block/paypal/express/Review.php:446` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 6) app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:51— app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:51-63 | app/appadmin/modules/Config/block/apphtml5store/Manageredit.php:51-63 | app/appadmin/modules/Config/block/appserverstore/Manager.php:83-94 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:93-104 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:80-91 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:83-94 — `app/appadmin/modules/Config/block/appfrontstore/Manageredit.php` and `app/appadmin/modules/Config/block/apphtml5store/Manageredit.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 3 separate duplicated blocks between them, totalling at least 56 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/appadmin/modules/Config/block/appfrontstore/Manageredit.php:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appadmin/modules/Config/block/appserverstore/Manager.php:80` calls `getStatusDeleted`, `getStatusActive` and `app/appadmin/modules/Config/block/appfrontstore/Manageredit.php:50` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–13 lines × 5) app/appserver/modules/Checkout/controllers/OnepageController.php:105— app/appserver/modules/Checkout/controllers/OnepageController.php:105-117 | app/appserver/modules/Customer/controllers/AddressController.php:225-234 | app/appserver/modules/Customer/controllers/AddressController.php:245-255 | app/appserver/modules/Customer/controllers/LoginController.php:148-158 | app/appserver/modules/Customer/controllers/RegisterController.php:237-249 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Checkout/controllers/OnepageController.php:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–13 lines × 5) app/appserver/modules/Customer/controllers/LoginController.php:27— app/appserver/modules/Customer/controllers/LoginController.php:27-39 | app/appserver/modules/Customer/controllers/LoginController.php:101-112 | app/appserver/modules/Customer/controllers/LoginController.php:141-152 | app/appserver/modules/Customer/controllers/RegisterController.php:101-111 | app/appserver/modules/Customer/controllers/RegisterController.php:198-209 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appserver/modules/Customer/controllers/LoginController.php:40` calls `post` and `app/appserver/modules/Customer/controllers/LoginController.php:113` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 4) app/appadmin/modules/Catalog/controllers/ProductinfoController.php:38— app/appadmin/modules/Catalog/controllers/ProductinfoController.php:38-50 | app/appadmin/modules/Catalog/controllers/ProductinfoController.php:97-109 | app/appadmin/modules/Catalog/controllers/ProductinfoController.php:131-142 | app/appadmin/modules/Catalog/controllers/ProductinfoController.php:148-160 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/controllers/ProductinfoController.php:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 3) app/appfront/modules/Customer/block/contacts/Index.php:23— app/appfront/modules/Customer/block/contacts/Index.php:23-35 | app/apphtml5/modules/Customer/block/contacts/Index.php:23-34 | app/appserver/modules/Customer/controllers/ContactController.php:39-51 — before extracting anything, compare `app/appfront/modules/Customer/block/contacts/Index.php` and `app/apphtml5/modules/Customer/block/contacts/Index.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 101 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 (1–13 lines × 3) app/appadmin/modules/Catalog/block/productinfo/Imageupload.php:54— app/appadmin/modules/Catalog/block/productinfo/Imageupload.php:54-54 | app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:297-309 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:296-308 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–13 lines × 2) services/Helper.php:196— services/Helper.php:196-205 | services/Helper.php:235-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 `services/Helper.php:196` it does not close everything it opens, so those exact lines 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–13 lines × 2) services/product/ProductMongodb.php:132— services/product/ProductMongodb.php:132-142 | services/product/ProductMysqldb.php:160-172 — before extracting anything, compare `services/product/ProductMongodb.php` and `services/product/ProductMysqldb.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 358 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 30) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:198— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:198-209 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:125-136 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:207-218 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:338-349 | app/appadmin/modules/Config/block/appfronthome/Manager.php:131-142 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:192-203 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:197-208 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:122-133 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:205-216 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:339-350 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:121-132 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:179-190 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:198-209 | app/appadmin/modules/Config/block/appserverbase/Manager.php:99-110 | app/appadmin/modules/Config/block/appservercache/Manager.php:206-217 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:313-324 | app/appadmin/modules/Config/block/appserverhome/Manager.php:91-102 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:181-192 | app/appadmin/modules/Config/block/appserverstore/Manager.php:179-190 | app/appadmin/modules/Config/block/base/Manager.php:199-210 | app/appadmin/modules/Config/block/cart/Manager.php:105-116 | app/appadmin/modules/Config/block/email/Manager.php:417-428 | app/appadmin/modules/Config/block/fa/Manager.php:136-147 | app/appadmin/modules/Config/block/order/Manager.php:148-159 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:185-196 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:160-171 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:155-166 | app/appadmin/modules/Config/block/product/Manager.php:146-157 | app/appadmin/modules/Config/block/search/Manager.php:121-132 | app/appadmin/modules/Config/block/service/Db.php:188-199 — `app/appadmin/modules/Config/block/appfrontaccount/Manager.php` and `app/appadmin/modules/Config/block/appfrontbase/Manager.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 5 separate duplicated blocks between them, totalling at least 59 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.
Duplicated block (10–12 lines × 8) app/appadmin/modules/Catalog/block/productfavorite/Index.php:167— app/appadmin/modules/Catalog/block/productfavorite/Index.php:167-176 | app/appadmin/modules/Catalog/block/productreview/Index.php:246-257 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:148-157 | app/appadmin/modules/Cms/block/article/Index.php:179-188 | app/appadmin/modules/Cms/block/staticblock/Index.php:194-203 | app/appadmin/modules/Sales/block/coupon/Manager.php:211-220 | app/appadmin/modules/System/block/error/Index.php:173-182 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:217-226 — `app/appadmin/modules/Catalog/block/productfavorite/Index.php` and `app/appadmin/modules/Catalog/block/productreview/Index.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 11 separate duplicated blocks between them, totalling at least 143 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/appadmin/modules/Catalog/block/productfavorite/Index.php:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 7) services/Extension.php:154— services/Extension.php:154-165 | services/StoreBaseConfig.php:169-180 | services/StoreDomain.php:150-161 | services/admin/RoleUrlKey.php:209-220 | services/helper/ScriptDate.php:151-162 | services/product/Brand.php:193-204 | services/product/Brandcategory.php:194-205 — before extracting anything, compare `services/Extension.php` and `services/StoreBaseConfig.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `services/Extension.php:154` it does not close everything it opens, so those 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, `services/StoreBaseConfig.php:181` calls `foreach` and `services/Extension.php:166` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 6) app/appfront/modules/Catalog/block/category/Index.php:362— app/appfront/modules/Catalog/block/category/Index.php:362-373 | app/appfront/modules/Catalogsearch/block/index/Index.php:223-234 | app/apphtml5/modules/Catalog/block/category/Index.php:349-360 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:246-257 | app/appserver/modules/Catalog/controllers/CategoryController.php:490-501 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:256-267 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:362` it does not close everything it opens, so those 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–12 lines × 6) app/appfront/modules/Catalog/block/product/Index.php:568— app/appfront/modules/Catalog/block/product/Index.php:568-578 | app/appfront/modules/Cms/block/home/Index.php:49-58 | app/apphtml5/modules/Catalog/block/product/Index.php:564-574 | app/apphtml5/modules/Cms/block/home/Index.php:45-56 | app/appserver/modules/Catalog/controllers/ProductController.php:808-818 | app/appserver/modules/Cms/controllers/HomeController.php:107-118 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:568` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/apphtml5/modules/Catalog/block/product/Index.php:563` calls `explode` and `app/appfront/modules/Cms/block/home/Index.php:48` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 6) lib/wxpay/lib/WxPay.Api.php:55— lib/wxpay/lib/WxPay.Api.php:55-66 | lib/wxpay/lib/WxPay.Api.php:87-97 | lib/wxpay/lib/WxPay.Api.php:118-128 | lib/wxpay/lib/WxPay.Api.php:194-204 | lib/wxpay/lib/WxPay.Api.php:262-272 | lib/wxpay/lib/WxPay.Api.php:390-400 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/wxpay/lib/WxPay.Api.php:53` calls `SetSpbill_create_ip` and `lib/wxpay/lib/WxPay.Api.php:86` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–12 lines × 4) app/appfront/modules/Checkout/block/onepage/Placeorder.php:69— app/appfront/modules/Checkout/block/onepage/Placeorder.php:69-80 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:60-68 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:84-92 | app/appserver/modules/Checkout/block/onepage/Wxplaceorder.php:66-74 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.php:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 3) app/appfront/modules/Checkout/block/onepage/Placeorder.php:41— app/appfront/modules/Checkout/block/onepage/Placeorder.php:41-52 | app/apphtml5/modules/Checkout/block/onepage/Placeorder.php:40-50 | app/appserver/modules/Checkout/block/onepage/Placeorder.php:39-49 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Placeorder.php` and `app/apphtml5/modules/Checkout/block/onepage/Placeorder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Placeorder.php:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–12 lines × 4) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:631— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:631-634 | app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:636-647 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:588-591 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:593-604 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:631` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:647` calls `getAllLangCode`, `is_array`, `empty` and `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:634` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 30) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:245— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:245-255 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:172-182 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:254-264 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:385-395 | app/appadmin/modules/Config/block/appfronthome/Manager.php:178-188 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:239-249 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:244-254 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:169-179 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:252-262 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:386-396 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:168-178 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:226-236 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:245-255 | app/appadmin/modules/Config/block/appserverbase/Manager.php:146-156 | app/appadmin/modules/Config/block/appservercache/Manager.php:253-263 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:360-370 | app/appadmin/modules/Config/block/appserverhome/Manager.php:138-148 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:228-238 | app/appadmin/modules/Config/block/appserverstore/Manager.php:226-236 | app/appadmin/modules/Config/block/base/Manager.php:246-256 | app/appadmin/modules/Config/block/cart/Manager.php:152-162 | app/appadmin/modules/Config/block/email/Manager.php:464-474 | app/appadmin/modules/Config/block/fa/Manager.php:183-193 | app/appadmin/modules/Config/block/order/Manager.php:195-205 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:232-242 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:207-217 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:202-212 | app/appadmin/modules/Config/block/product/Manager.php:193-203 | app/appadmin/modules/Config/block/search/Manager.php:168-178 | app/appadmin/modules/Config/block/service/Db.php:236-246 — `app/appadmin/modules/Config/block/appfrontaccount/Manager.php` and `app/appadmin/modules/Config/block/appfrontbase/Manager.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 5 separate duplicated blocks between them, totalling at least 59 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. 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 × 12) REDACTED:180— REDACTED:180-190 | REDACTED:201-211 | REDACTED:222-232 | REDACTED:242-252 | REDACTED:310-320 | REDACTED:349-359 | REDACTED:413-423 | REDACTED:433-443 | REDACTED:453-463 | REDACTED:473-483 | REDACTED:493-503 | REDACTED:513-523 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–11 lines × 7) app/appfront/modules/Customer/block/account/Forgotpassword.php:48— app/appfront/modules/Customer/block/account/Forgotpassword.php:48-58 | app/appfront/modules/Customer/block/account/Login.php:52-59 | app/appfront/modules/Customer/block/contacts/Index.php:101-109 | app/apphtml5/modules/Customer/block/account/Forgotpassword.php:39-47 | app/apphtml5/modules/Customer/block/account/Login.php:44-51 | app/apphtml5/modules/Customer/block/contacts/Index.php:102-109 | app/appserver/modules/Customer/block/account/Login.php:42-49 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Forgotpassword.php` and `app/apphtml5/modules/Customer/block/account/Forgotpassword.php` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/account/Forgotpassword.php:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 6) app/appserver/modules/Catalog/controllers/ProductController.php:100— app/appserver/modules/Catalog/controllers/ProductController.php:100-109 | app/appserver/modules/Catalog/controllers/ProductController.php:130-139 | app/appserver/modules/Checkout/controllers/CartController.php:223-233 | app/appserver/modules/Checkout/controllers/CartController.php:284-293 | app/appserver/modules/Customer/controllers/AccountController.php:22-31 | app/appserver/modules/Customer/controllers/AccountController.php:66-75 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appserver/modules/Checkout/controllers/CartController.php:235` calls `htmlEncode` and `app/appserver/modules/Checkout/controllers/CartController.php:295` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 5) services/product/ProductMongodb.php:389— services/product/ProductMongodb.php:389-399 | services/product/ProductMongodb.php:418-428 | services/product/ProductMongodb.php:528-538 | services/product/ProductMongodb.php:1263-1273 | services/product/ProductMongodb.php:1317-1327 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/product/ProductMongodb.php:389` it begins part-way through the construct above it, so those 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, `services/product/ProductMongodb.php:386` calls `getPrimaryKey`, `ObjectId`, `andWhere` and `services/product/ProductMongodb.php:416` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–11 lines × 3) services/product/ProductMongodb.php:433— services/product/ProductMongodb.php:433-443 | services/product/ProductMongodb.php:543-553 | services/product/ProductMongodb.php:1332-1339 — 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 `services/product/ProductMongodb.php:433` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–11 lines × 2) app/appfront/modules/Catalog/block/category/Index.php:381— app/appfront/modules/Catalog/block/category/Index.php:381-388 | app/appserver/modules/Catalog/controllers/CategoryController.php:509-519 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appserver/modules/Catalog/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/category/Index.php:381` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–11 lines × 3) app/appfront/modules/Customer/block/account/Login.php:24— app/appfront/modules/Customer/block/account/Login.php:24-27 | app/apphtml5/modules/Customer/block/account/Login.php:25-35 | app/appserver/modules/Customer/block/account/Login.php:25-35 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Login.php` and `app/apphtml5/modules/Customer/block/account/Login.php` as WHOLE FILES: this scan already matched 4 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. 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/apphtml5/modules/Customer/block/account/Login.php:25` calls `get` and `app/appfront/modules/Customer/block/account/Login.php:24` does not — after which the two agree again for 5 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 × 29) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:50— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:50-59 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:40-49 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:46-55 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:57-66 | app/appadmin/modules/Config/block/appfronthome/Manager.php:41-50 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:46-55 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:49-58 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:40-49 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:46-55 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:57-66 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:40-49 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:35-44 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:50-59 | app/appadmin/modules/Config/block/appserverbase/Manager.php:37-46 | app/appadmin/modules/Config/block/appservercache/Manager.php:46-55 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:57-66 | app/appadmin/modules/Config/block/appserverhome/Manager.php:37-46 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:35-44 | app/appadmin/modules/Config/block/appserverstore/Manager.php:45-54 | app/appadmin/modules/Config/block/base/Manager.php:44-53 | app/appadmin/modules/Config/block/cart/Manager.php:38-47 | app/appadmin/modules/Config/block/email/Manager.php:77-86 | app/appadmin/modules/Config/block/fa/Manager.php:40-49 | app/appadmin/modules/Config/block/order/Manager.php:43-52 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:55-64 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:42-51 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:45-54 | app/appadmin/modules/Config/block/product/Manager.php:42-51 | app/appadmin/modules/Config/block/search/Manager.php:39-48 — `app/appadmin/modules/Config/block/appfrontaccount/Manager.php` and `app/appadmin/modules/Config/block/appfrontbase/Manager.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 5 separate duplicated blocks between them, totalling at least 59 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appadmin/modules/Config/block/appfrontpayment/Manager.php:56` calls `_getEditArr` and `app/appadmin/modules/Config/block/appfrontaccount/Manager.php:60` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 10) app/appadmin/modules/Catalog/block/category/Product.php:359— app/appadmin/modules/Catalog/block/category/Product.php:359-367 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:158-166 | app/appadmin/modules/Catalog/block/productreview/Index.php:236-245 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:144-152 | app/appadmin/modules/Cms/block/article/Index.php:175-183 | app/appadmin/modules/Cms/block/staticblock/Index.php:190-198 | app/appadmin/modules/Sales/block/coupon/Manager.php:207-215 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:226-234 | app/appadmin/modules/System/block/error/Index.php:169-177 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:213-221 — before extracting anything, compare `app/appadmin/modules/Catalog/block/category/Product.php` and `app/appadmin/modules/Catalog/block/productfavorite/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/category/Product.php:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–10 lines × 7) app/appapi/modules/V1/controllers/ArticleController.php:118— app/appapi/modules/V1/controllers/ArticleController.php:118-126 | app/appapi/modules/V1/controllers/ArticleController.php:183-191 | app/appapi/modules/V1/controllers/CategoryController.php:236-245 | app/appapi/modules/V1/controllers/CategoryController.php:337-346 | app/appapi/modules/V1/controllers/CategoryController.php:440-449 | app/appapi/modules/V1/controllers/OrderController.php:145-151 | REDACTED:267-273 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (2–10 lines × 9) app/appadmin/modules/AppadminbaseBlock.php:580— app/appadmin/modules/AppadminbaseBlock.php:580-589 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:234-243 | app/appadmin/modules/Catalog/block/productinfo/Index.php:363-366 | app/appadmin/modules/Catalog/block/productreview/Index.php:306-307 | app/appadmin/modules/Cms/block/article/Index.php:237-238 | app/appadmin/modules/Cms/block/staticblock/Index.php:252-253 | app/appadmin/modules/Customer/block/contacts/Index.php:225-234 | app/appadmin/modules/Sales/block/coupon/Manager.php:268-269 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:293-294 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/productbrand/Manager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:580` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (8–10 lines × 3) app/appserver/modules/Customer/controllers/ForgotController.php:91— app/appserver/modules/Customer/controllers/ForgotController.php:91-100 | app/appserver/modules/Customer/controllers/LoginController.php:201-209 | app/appserver/modules/Customer/controllers/RegisterController.php:107-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Customer/controllers/ForgotController.php:91` it begins part-way through the construct above it, so those exact lines 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 × 12) app/appfront/modules/Checkout/block/onepage/Index.php:90— app/appfront/modules/Checkout/block/onepage/Index.php:90-98 | app/appfront/modules/Checkout/block/onepage/Index.php:113-121 | app/appfront/modules/Payment/block/paypal/express/Review.php:127-135 | app/appfront/modules/Payment/block/paypal/express/Review.php:150-158 | app/apphtml5/modules/Checkout/block/onepage/Index.php:80-88 | app/apphtml5/modules/Checkout/block/onepage/Index.php:103-111 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:127-135 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:150-158 | app/appserver/modules/Checkout/block/onepage/Index.php:99-107 | app/appserver/modules/Checkout/block/onepage/Index.php:122-130 | app/appserver/modules/Payment/block/paypal/express/Review.php:142-150 | app/appserver/modules/Payment/block/paypal/express/Review.php:165-173 — before extracting anything, compare `app/appfront/modules/Checkout/block/onepage/Index.php` and `app/appfront/modules/Payment/block/paypal/express/Review.php` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 242 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Checkout/block/onepage/Index.php:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appfront/modules/Checkout/block/onepage/Index.php:121` calls `isset`, `empty` and `app/appfront/modules/Checkout/block/onepage/Index.php:98` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 10) app/appfront/modules/Checkout/block/cart/Index.php:151— app/appfront/modules/Checkout/block/cart/Index.php:151-159 | app/appfront/modules/Checkout/block/onepage/Index.php:323-331 | app/appfront/modules/Payment/block/paypal/express/Review.php:265-273 | app/apphtml5/modules/Checkout/block/cart/Index.php:140-148 | app/apphtml5/modules/Checkout/block/onepage/Index.php:313-321 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:265-273 | app/appserver/modules/Checkout/block/onepage/Index.php:347-355 | app/appserver/modules/Checkout/controllers/CartController.php:123-131 | app/appserver/modules/Payment/block/paypal/express/Review.php:286-294 | services/order/Item.php:209-217 — `app/appfront/modules/Checkout/block/cart/Index.php` and `app/appfront/modules/Checkout/block/onepage/Index.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 6 separate duplicated blocks between them, totalling at least 65 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/appfront/modules/Checkout/block/cart/Index.php:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 8) services/admin/Role.php:130— services/admin/Role.php:130-138 | services/admin/RoleUrlKey.php:120-128 | services/admin/UrlKey.php:276-284 | services/cms/staticblock/StaticBlockMysqldb.php:139-147 | services/product/Brand.php:141-149 | services/product/Brand.php:176-184 | services/product/Brandcategory.php:141-149 | services/product/Brandcategory.php:175-183 — before extracting anything, compare `services/admin/RoleUrlKey.php` and `services/product/Brand.php` as WHOLE FILES: this scan already matched 5 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. 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 after the matched lines, `services/product/Brand.php:150` calls `foreach`, `unserialize` and `services/admin/Role.php:140` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–9 lines × 7) app/appapi/modules/V1/controllers/ArticleController.php:114— app/appapi/modules/V1/controllers/ArticleController.php:114-122 | app/appapi/modules/V1/controllers/ArticleController.php:177-185 | app/appapi/modules/V1/controllers/CategoryController.php:121-129 | app/appapi/modules/V1/controllers/CategoryController.php:214-222 | app/appapi/modules/V1/controllers/CategoryController.php:315-323 | app/appapi/modules/V1/controllers/CategoryController.php:418-426 | app/appserver/modules/Customer/controllers/AddressController.php:177-182 — before extracting anything, compare `app/appapi/modules/V1/controllers/ArticleController.php` and `app/appapi/modules/V1/controllers/CategoryController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appapi/modules/V1/controllers/ArticleController.php:188` calls `post` and `app/appapi/modules/V1/controllers/ArticleController.php:124` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 5) app/appfront/modules/Catalog/block/category/Index.php:494— app/appfront/modules/Catalog/block/category/Index.php:494-501 | app/appfront/modules/Catalogsearch/block/index/Index.php:363-370 | app/apphtml5/modules/Catalog/block/category/Index.php:481-488 | app/apphtml5/modules/Catalogsearch/block/index/Index.php:386-393 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:451-459 — before extracting anything, compare `app/appfront/modules/Catalog/block/category/Index.php` and `app/appfront/modules/Catalogsearch/block/index/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 × 5) services/Extension.php:130— services/Extension.php:130-138 | services/StoreBaseConfig.php:124-132 | services/StoreDomain.php:126-134 | services/helper/ScriptDate.php:128-136 | services/product/Brand.php:122-130 — before extracting anything, compare `services/Extension.php` and `services/StoreBaseConfig.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/Extension.php:129` calls `getCurrentDateTime` and `services/helper/ScriptDate.php:127` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 3) app/appfront/modules/Customer/controllers/FacebookController.php:65— app/appfront/modules/Customer/controllers/FacebookController.php:65-72 | app/apphtml5/modules/Customer/controllers/FacebookController.php:64-72 | app/appserver/modules/Customer/controllers/FacebookController.php:81-89 — before extracting anything, compare `app/appfront/modules/Customer/controllers/FacebookController.php` and `app/apphtml5/modules/Customer/controllers/FacebookController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/FacebookController.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 (8–9 lines × 2) app/appfront/modules/Catalog/block/reviewproduct/Lists.php:68— app/appfront/modules/Catalog/block/reviewproduct/Lists.php:68-76 | app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php:70-77 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Lists.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 15) app/appadmin/modules/AppadminbaseBlock.php:553— app/appadmin/modules/AppadminbaseBlock.php:553-560 | app/appadmin/modules/Catalog/block/category/Product.php:395-402 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:208-215 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:191-198 | app/appadmin/modules/Catalog/block/productinfo/Index.php:327-334 | app/appadmin/modules/Catalog/block/productreview/Index.php:272-279 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:172-179 | app/appadmin/modules/Cms/block/article/Index.php:203-210 | app/appadmin/modules/Cms/block/staticblock/Index.php:218-225 | app/appadmin/modules/Customer/block/contacts/Index.php:198-205 | app/appadmin/modules/Customer/block/newsletter/Index.php:202-209 | app/appadmin/modules/Sales/block/coupon/Manager.php:235-242 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:259-266 | app/appadmin/modules/System/block/error/Index.php:197-204 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:241-248 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/category/Product.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:553` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 9) app/appfront/modules/Customer/block/account/Forgotpassword.php:54— app/appfront/modules/Customer/block/account/Forgotpassword.php:54-61 | app/appfront/modules/Customer/block/account/Login.php:55-62 | app/appfront/modules/Customer/block/account/Register.php:60-67 | app/appfront/modules/Customer/block/contacts/Index.php:105-112 | app/apphtml5/modules/Customer/block/account/Forgotpassword.php:43-50 | app/apphtml5/modules/Customer/block/account/Login.php:47-54 | app/apphtml5/modules/Customer/block/account/Register.php:52-59 | app/apphtml5/modules/Customer/block/contacts/Index.php:105-112 | app/appserver/modules/Customer/block/account/Login.php:45-52 — before extracting anything, compare `app/appfront/modules/Customer/block/account/Forgotpassword.php` and `app/apphtml5/modules/Customer/block/account/Forgotpassword.php` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/block/account/Forgotpassword.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. 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 × 6) services/Order.php:474— services/Order.php:474-481 | services/Order.php:485-492 | services/cart/Coupon.php:227-234 | services/cart/Coupon.php:238-245 | services/product/review/ReviewMongodb.php:328-335 | services/product/review/ReviewMysqldb.php:343-350 — before extracting anything, compare `services/product/review/ReviewMongodb.php` and `services/product/review/ReviewMysqldb.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 206 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 `services/Order.php:474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) services/payment/Alipay.php:363— services/payment/Alipay.php:363-370 | services/payment/Wxpay.php:286-293 | services/payment/WxpayH5.php:293-300 | services/payment/WxpayJsApi.php:280-287 | services/payment/WxpayMicro.php:265-272 — 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 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `services/payment/Alipay.php:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `services/payment/Wxpay.php:295` calls `strlen`, `mb_substr` and `services/payment/Alipay.php:371` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–8 lines × 3) app/appfront/modules/Customer/controllers/AccountController.php:52— app/appfront/modules/Customer/controllers/AccountController.php:52-57 | app/appfront/modules/Customer/controllers/AccountController.php:77-82 | app/apphtml5/modules/Customer/controllers/AccountController.php:74-81 — before extracting anything, compare `app/appfront/modules/Customer/controllers/AccountController.php` and `app/apphtml5/modules/Customer/controllers/AccountController.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Customer/controllers/AccountController.php:52` it does not close everything it opens, so those exact lines 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–8 lines × 3) app/appserver/modules/Checkout/controllers/CartController.php:150— app/appserver/modules/Checkout/controllers/CartController.php:150-157 | app/appserver/modules/Customer/controllers/AddressController.php:174-181 | app/appserver/modules/Customer/controllers/EditaccountController.php:48-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 21) REDACTED:92— REDACTED:92-98 | REDACTED:137-143 | REDACTED:158-164 | REDACTED:179-185 | REDACTED:200-206 | REDACTED:221-227 | REDACTED:241-247 | REDACTED:309-315 | REDACTED:348-354 | REDACTED:368-374 | REDACTED:388-394 | REDACTED:412-418 | REDACTED:432-438 | REDACTED:452-458 | REDACTED:472-478 | REDACTED:492-498 | REDACTED:512-518 | REDACTED:532-538 | REDACTED:552-558 | REDACTED:573-579 | REDACTED:593-599 — all 21 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:92` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:101` calls `getAppServerUrl` and `REDACTED:145` 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 × 8) app/appfront/modules/Checkout/block/cart/Index.php:130— app/appfront/modules/Checkout/block/cart/Index.php:130-137 | app/appfront/modules/Checkout/block/onepage/Index.php:300-307 | app/appfront/modules/Payment/block/paypal/express/Review.php:242-249 | app/apphtml5/modules/Checkout/block/cart/Index.php:119-126 | app/apphtml5/modules/Checkout/block/onepage/Index.php:290-297 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:242-249 | app/appserver/modules/Checkout/block/onepage/Index.php:322-328 | app/appserver/modules/Payment/block/paypal/express/Review.php:263-270 — `app/appfront/modules/Checkout/block/cart/Index.php` and `app/appfront/modules/Checkout/block/onepage/Index.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 6 separate duplicated blocks between them, totalling at least 65 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/appfront/modules/Checkout/block/cart/Index.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.
Duplicated block (7 lines × 7) lib/wxpay/lib/WxPay.Api.php:85— lib/wxpay/lib/WxPay.Api.php:85-92 | lib/wxpay/lib/WxPay.Api.php:116-123 | lib/wxpay/lib/WxPay.Api.php:156-162 | lib/wxpay/lib/WxPay.Api.php:192-199 | lib/wxpay/lib/WxPay.Api.php:260-267 | lib/wxpay/lib/WxPay.Api.php:291-298 | lib/wxpay/lib/WxPay.Api.php:388-395 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/wxpay/lib/WxPay.Api.php:259` calls `SetSpbill_create_ip` and `lib/wxpay/lib/WxPay.Api.php:84` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 6) app/appfront/modules/Catalog/block/product/Index.php:145— app/appfront/modules/Catalog/block/product/Index.php:145-150 | app/appfront/modules/Catalog/block/product/Index.php:157-163 | app/apphtml5/modules/Catalog/block/product/Index.php:134-139 | app/apphtml5/modules/Catalog/block/product/Index.php:146-152 | app/appserver/modules/Catalog/controllers/ProductController.php:375-380 | app/appserver/modules/Catalog/controllers/ProductController.php:387-393 — before extracting anything, compare `app/appfront/modules/Catalog/block/product/Index.php` and `app/apphtml5/modules/Catalog/block/product/Index.php` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 409 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appfront/modules/Catalog/block/product/Index.php:145` it begins part-way through the construct above it, so those 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–7 lines × 3) services/cms/article/ArticleMongodb.php:183— services/cms/article/ArticleMongodb.php:183-189 | services/cms/article/ArticleMongodb.php:198-203 | services/cms/article/ArticleMysqldb.php:224-230 — before extracting anything, compare `services/cms/article/ArticleMongodb.php` and `services/cms/article/ArticleMysqldb.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 13) app/appadmin/modules/AppadminbaseBlock.php:523— app/appadmin/modules/AppadminbaseBlock.php:523-528 | app/appadmin/modules/Catalog/block/productbrand/Manager.php:178-183 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:155-160 | app/appadmin/modules/Catalog/block/productreview/Index.php:233-238 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:141-146 | app/appadmin/modules/Cms/block/article/Index.php:172-177 | app/appadmin/modules/Cms/block/staticblock/Index.php:187-192 | app/appadmin/modules/Customer/block/contacts/Index.php:168-173 | app/appadmin/modules/Customer/block/newsletter/Index.php:173-178 | app/appadmin/modules/Sales/block/coupon/Manager.php:204-209 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:223-228 | app/appadmin/modules/System/block/error/Index.php:166-171 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:210-215 — before extracting anything, compare `app/appadmin/modules/AppadminbaseBlock.php` and `app/appadmin/modules/Catalog/block/productbrand/Manager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminbaseBlock.php:523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appadmin/modules/Catalog/block/productreview/Index.php:231` calls `getSkusByIds` and `app/appadmin/modules/Catalog/block/urlrewrite/Index.php:140` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 12) app/appadmin/modules/Catalog/block/category/Product.php:378— app/appadmin/modules/Catalog/block/category/Product.php:378-383 | app/appadmin/modules/Catalog/block/productfavorite/Index.php:174-179 | app/appadmin/modules/Catalog/block/productreview/Index.php:255-260 | app/appadmin/modules/Catalog/block/urlrewrite/Index.php:155-160 | app/appadmin/modules/Cms/block/article/Index.php:186-191 | app/appadmin/modules/Cms/block/staticblock/Index.php:201-206 | app/appadmin/modules/Fecadmin/block/log/Index.php:152-157 | app/appadmin/modules/Fecadmin/block/logtj/Index.php:193-198 | app/appadmin/modules/Sales/block/coupon/Manager.php:218-223 | app/appadmin/modules/Sales/block/orderinfo/Manager.php:242-247 | app/appadmin/modules/System/block/error/Index.php:180-185 | app/appadmin/modules/System/block/extensioninstalled/Manager.php:224-229 — before extracting anything, compare `app/appadmin/modules/Catalog/block/category/Product.php` and `app/appadmin/modules/Catalog/block/productfavorite/Index.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/category/Product.php:378` it begins part-way through the construct above it, so those exact lines 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–6 lines × 4) app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:297— app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:297-302 | app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:393-397 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:296-301 | app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:392-396 — before extracting anything, compare `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php` and `app/appadmin/modules/Catalog/block/productinfo/Manageredit.php` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 398 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–6 lines × 5) services/category/CategoryMongodb.php:200— services/category/CategoryMongodb.php:200-205 | services/category/CategoryMongodb.php:254-259 | services/category/CategoryMongodb.php:681-686 | services/category/CategoryMysqldb.php:759-764 | services/cms/article/ArticleMongodb.php:144-146 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/category/CategoryMongodb.php:199` calls `isset`, `getDefaultLangAttrVal` and `services/cms/article/ArticleMongodb.php:144` 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 (2–5 lines × 10) app/appfront/modules/Checkout/block/cart/Index.php:116— app/appfront/modules/Checkout/block/cart/Index.php:116-120 | app/appfront/modules/Checkout/block/onepage/Index.php:287-291 | app/appfront/modules/Payment/block/paypal/express/Review.php:229-233 | app/apphtml5/modules/Checkout/block/cart/Index.php:105-109 | app/apphtml5/modules/Checkout/block/onepage/Index.php:277-281 | app/apphtml5/modules/Payment/block/paypal/express/Review.php:229-233 | app/appserver/modules/Checkout/block/onepage/Index.php:308-312 | app/appserver/modules/Checkout/controllers/CartController.php:73-76 | app/appserver/modules/Checkout/controllers/CartController.php:81-82 | app/appserver/modules/Payment/block/paypal/express/Review.php:249-253 — `app/appfront/modules/Checkout/block/cart/Index.php` and `app/appfront/modules/Checkout/block/onepage/Index.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 6 separate duplicated blocks between them, totalling at least 65 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/appfront/modules/Checkout/block/cart/Index.php:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/appfront/modules/Checkout/block/cart/Index.php:115` calls `isset`, `is_array`, `foreach` and `app/appserver/modules/Checkout/controllers/CartController.php:73` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 5) app/appadmin/modules/AppadminController.php:38— app/appadmin/modules/AppadminController.php:38-42 | app/appadmin/modules/Fecadmin/controllers/LoginController.php:34-38 | app/appadmin/modules/Fecadmin/controllers/LogoutController.php:33-37 | app/appfront/modules/AppfrontController.php:38-45 | app/apphtml5/modules/AppfrontController.php:38-45 — before extracting anything, compare `app/appadmin/modules/AppadminController.php` and `app/appadmin/modules/Fecadmin/controllers/LoginController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/AppadminController.php:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 3) app/appserver/modules/Catalog/controllers/CategoryController.php:687— app/appserver/modules/Catalog/controllers/CategoryController.php:687-692 | app/appserver/modules/Catalogsearch/controllers/IndexController.php:408-412 | app/appserver/modules/Wx/controllers/HomeController.php:135-138 — before extracting anything, compare `app/appserver/modules/Catalog/controllers/CategoryController.php` and `app/appserver/modules/Catalogsearch/controllers/IndexController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appserver/modules/Catalog/controllers/CategoryController.php:687` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/appserver/modules/Catalog/controllers/CategoryController.php:692` calls `foreach` and `app/appserver/modules/Wx/controllers/HomeController.php:138` does not — after which the two agree again for 5 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 (4–5 lines × 4) services/category/CategoryMongodb.php:653— services/category/CategoryMongodb.php:653-656 | services/category/CategoryMysqldb.php:729-732 | services/product/ProductMongodb.php:1296-1300 | services/product/ProductMysqldb.php:1496-1500 — before extracting anything, compare `services/category/CategoryMongodb.php` and `services/category/CategoryMysqldb.php` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 274 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 `services/category/CategoryMongodb.php:653` it begins part-way through the construct above it, so those 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 (20 lines × 14) app/appadmin/modules/Catalog/controllers/ProductattrController.php:24— app/appadmin/modules/Catalog/controllers/ProductattrController.php:24-43 | app/appadmin/modules/Catalog/controllers/ProductattrgroupController.php:24-43 | app/appadmin/modules/Catalog/controllers/ProductbrandController.php:24-48 | app/appadmin/modules/Catalog/controllers/ProductbrandcategoryController.php:24-43 | app/appadmin/modules/Catalog/controllers/ProductreviewController.php:24-53 | app/appadmin/modules/Catalog/controllers/UrlrewriteController.php:24-43 | app/appadmin/modules/Cms/controllers/ArticleController.php:24-43 | app/appadmin/modules/Config/controllers/AppfrontstoreController.php:24-43 | app/appadmin/modules/Config/controllers/Apphtml5storeController.php:24-43 | app/appadmin/modules/Customer/controllers/AccountController.php:24-43 | app/appadmin/modules/Fecadmin/controllers/AccountController.php:23-60 | app/appadmin/modules/Fecadmin/controllers/ConfigController.php:22-45 | app/appadmin/modules/Fecadmin/controllers/ResourceController.php:23-60 | app/appadmin/modules/Sales/controllers/CouponController.php:24-43 — before extracting anything, compare `app/appadmin/modules/Catalog/controllers/ProductattrController.php` and `app/appadmin/modules/Catalog/controllers/ProductattrgroupController.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/controllers/ProductattrController.php:24` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 34) app/appadmin/modules/Config/controllers/AppfrontaccountController.php:24— app/appadmin/modules/Config/controllers/AppfrontaccountController.php:24-34 | app/appadmin/modules/Config/controllers/AppfrontbaseController.php:24-34 | app/appadmin/modules/Config/controllers/AppfrontcacheController.php:24-34 | app/appadmin/modules/Config/controllers/AppfrontcatalogController.php:24-34 | app/appadmin/modules/Config/controllers/AppfronthomeController.php:24-34 | app/appadmin/modules/Config/controllers/AppfrontpaymentController.php:24-34 | app/appadmin/modules/Config/controllers/Apphtml5accountController.php:24-34 | app/appadmin/modules/Config/controllers/Apphtml5baseController.php:24-34 | app/appadmin/modules/Config/controllers/Apphtml5cacheController.php:24-34 | app/appadmin/modules/Config/controllers/Apphtml5catalogController.php:24-34 | app/appadmin/modules/Config/controllers/Apphtml5homeController.php:24-34 | app/appadmin/modules/Config/controllers/Apphtml5paymentController.php:24-34 | app/appadmin/modules/Config/controllers/AppserveraccountController.php:24-34 | app/appadmin/modules/Config/controllers/AppserverbaseController.php:24-34 | app/appadmin/modules/Config/controllers/AppservercacheController.php:24-34 | app/appadmin/modules/Config/controllers/AppservercatalogController.php:24-34 | app/appadmin/modules/Config/controllers/AppserverhomeController.php:24-32 | app/appadmin/modules/Config/controllers/AppserverpaymentController.php:24-34 | app/appadmin/modules/Config/controllers/AppserverstoreController.php:24-34 | app/appadmin/modules/Config/controllers/AppserverstorelangController.php:24-34 | app/appadmin/modules/Config/controllers/BaseController.php:24-34 | app/appadmin/modules/Config/controllers/CartController.php:24-34 | app/appadmin/modules/Config/controllers/CategorysortController.php:24-34 | app/appadmin/modules/Config/controllers/CurrencyController.php:24-34 | app/appadmin/modules/Config/controllers/EmailController.php:24-34 | app/appadmin/modules/Config/controllers/FaController.php:25-35 | app/appadmin/modules/Config/controllers/MutillangController.php:24-34 | app/appadmin/modules/Config/controllers/OrderController.php:24-34 | app/appadmin/modules/Config/controllers/PaymentalipayController.php:24-34 | app/appadmin/modules/Config/controllers/PaymentpaypalController.php:24-34 | app/appadmin/modules/Config/controllers/PaymentwxpayController.php:24-34 | app/appadmin/modules/Config/controllers/ProductController.php:24-34 | app/appadmin/modules/Config/controllers/SearchController.php:24-34 | app/appadmin/modules/Config/controllers/ServiceController.php:24-34 — before extracting anything, compare `app/appadmin/modules/Config/controllers/AppfrontaccountController.php` and `app/appadmin/modules/Config/controllers/AppfrontbaseController.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 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 `app/appadmin/modules/Config/controllers/AppfrontaccountController.php:24` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 18) app/appadmin/modules/Catalog/controllers/ProductattrController.php:24— app/appadmin/modules/Catalog/controllers/ProductattrController.php:24-43 | app/appadmin/modules/Catalog/controllers/ProductattrgroupController.php:24-43 | app/appadmin/modules/Catalog/controllers/ProductbrandController.php:24-48 | app/appadmin/modules/Catalog/controllers/ProductbrandcategoryController.php:24-43 | app/appadmin/modules/Catalog/controllers/ProductreviewController.php:24-53 | app/appadmin/modules/Catalog/controllers/UrlrewriteController.php:24-43 | app/appadmin/modules/Cms/controllers/ArticleController.php:24-43 | app/appadmin/modules/Config/controllers/AppfrontstoreController.php:24-43 | app/appadmin/modules/Config/controllers/Apphtml5storeController.php:24-43 | app/appadmin/modules/Customer/controllers/AccountController.php:24-43 | app/appadmin/modules/Customer/controllers/ContactsController.php:24-33 | app/appadmin/modules/Fecadmin/controllers/AccountController.php:23-60 | app/appadmin/modules/Fecadmin/controllers/ConfigController.php:22-45 | app/appadmin/modules/Fecadmin/controllers/ResourceController.php:23-60 | app/appadmin/modules/Fecadmin/controllers/RoleController.php:22-43 | app/appadmin/modules/Sales/controllers/CouponController.php:24-43 | app/appadmin/modules/System/controllers/ErrorController.php:24-33 | app/appadmin/modules/System/controllers/ExtensioninstalledController.php:24-58 — before extracting anything, compare `app/appadmin/modules/Catalog/controllers/ProductattrController.php` and `app/appadmin/modules/Catalog/controllers/ProductattrgroupController.php` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/appadmin/modules/Catalog/controllers/ProductattrController.php:24` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (122 lines × 2) lib/alipay/aop/request/AlipayAcquireCancelRequest.php:47— lib/alipay/aop/request/AlipayAcquireCancelRequest.php:47-168 | lib/alipay/aop/request/AlipayAcquireRefundRequest.php:68-233 — before extracting anything, compare `lib/alipay/aop/request/AlipayAcquireCancelRequest.php` and `lib/alipay/aop/request/AlipayAcquireRefundRequest.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 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. 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 `lib/alipay/aop/request/AlipayAcquireCancelRequest.php:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (111 lines × 3) lib/alipay/aop/request/AlipayAcquireCancelRequest.php:47— lib/alipay/aop/request/AlipayAcquireCancelRequest.php:47-168 | lib/alipay/aop/request/AlipayAcquireCloseRequest.php:39-149 | lib/alipay/aop/request/AlipayAcquireRefundRequest.php:68-233 — before extracting anything, compare `lib/alipay/aop/request/AlipayAcquireCancelRequest.php` and `lib/alipay/aop/request/AlipayAcquireCloseRequest.php` as WHOLE FILES: 88% 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 `lib/alipay/aop/request/AlipayAcquireCancelRequest.php:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (78 lines × 36) lib/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php:23— lib/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayAssetPointBudgetQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayCommerceCityfacilitatorCityQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayCommerceEducateStudentinfoShareRequest.php:23-100 | lib/alipay/aop/request/AlipayCommerceTransportOfflinepayKeyQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayDataDataserviceSdfsdfRequest.php:23-100 | lib/alipay/aop/request/AlipayEbppMerchantConfigGetRequest.php:23-100 | lib/alipay/aop/request/AlipayMobilePublicContactFollowListRequest.php:23-100 | lib/alipay/aop/request/AlipayMobilePublicInfoQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayMobilePublicMenuGetRequest.php:23-100 | lib/alipay/aop/request/AlipayMobilePublicMenuQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayMobileStdPublicMenuQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOfflineMaterialImageModifyRequest.php:23-100 | lib/alipay/aop/request/AlipayOfflineMaterialImageQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicContactFollowBatchqueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicGroupBatchqueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicInfoQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicLabelQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicLifeLabelBatchqueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicMenuBatchqueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicMenuQueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicMultimediaDownloadProxyRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenPublicPersonalizedExtensionBatchqueryRequest.php:23-100 | lib/alipay/aop/request/AlipayOpenServicemarketOrderNotifyRequest.php:23-100 | lib/alipay/aop/request/AlipayPointBalanceGetRequest.php:23-100 | lib/alipay/aop/request/AlipayPointBudgetGetRequest.php:23-100 | lib/alipay/aop/request/AlipayTrustUserScoreGetRequest.php:23-100 | lib/alipay/aop/request/AlipayUserAccountGetRequest.php:23-100 | lib/alipay/aop/request/AlipayUserInfoShareRequest.php:23-100 | lib/alipay/aop/request/AlipayUserUserinfoShareRequest.php:23-100 | lib/alipay/aop/request/KoubeiItemExtitemBrandQueryRequest.php:23-100 | lib/alipay/aop/request/KoubeiMarketingCampaignTagsQueryRequest.php:23-100 | lib/alipay/aop/request/KoubeiMarketingDataDishdiagnosetypeBatchqueryRequest.php:23-100 | lib/alipay/aop/request/KoubeiMarketingDataSmartmanagementDiagnoseRequest.php:23-100 | lib/alipay/aop/request/KoubeiMemberBrandownerNameQueryRequest.php:23-100 | lib/alipay/aop/request/KoubeiMemberRetailerQueryRequest.php:23-100 — 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 36 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/alipay/aop/request/AlipayAssetPointBalanceQueryRequest.php:23` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (133 lines × 5) lib/alipay/aop/request/AlipayEcapiprodDrawndnContractGetRequest.php:47— lib/alipay/aop/request/AlipayEcapiprodDrawndnContractGetRequest.php:47-179 | lib/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php:57-211 | lib/alipay/aop/request/AlipayEcapiprodDrawndnLendingrecordQueryRequest.php:57-211 | lib/alipay/aop/request/AlipayEcapiprodDrawndnPaymentscheduleGetRequest.php:47-179 | lib/alipay/aop/request/AlipayEcapiprodDrawndnRepaymentrecordQueryRequest.php:57-211 — before extracting anything, compare `lib/alipay/aop/request/AlipayEcapiprodDrawndnContractGetRequest.php` and `lib/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php` as WHOLE FILES: 89% 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 `lib/alipay/aop/request/AlipayEcapiprodDrawndnContractGetRequest.php:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (155 lines × 3) lib/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php:57— lib/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php:57-211 | lib/alipay/aop/request/AlipayEcapiprodDrawndnLendingrecordQueryRequest.php:57-211 | lib/alipay/aop/request/AlipayEcapiprodDrawndnRepaymentrecordQueryRequest.php:57-211 — before extracting anything, compare `lib/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php` and `lib/alipay/aop/request/AlipayEcapiprodDrawndnLendingrecordQueryRequest.php` as WHOLE FILES: 88% 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. 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 `lib/alipay/aop/request/AlipayEcapiprodDrawndnFeerecordQueryRequest.php:57` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (89 lines × 6) lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47— lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47-179 | lib/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php:47-179 | lib/alipay/aop/request/AlipayMicropayOrderFreezepayurlGetRequest.php:27-115 | lib/alipay/aop/request/AlipayMicropayOrderGetRequest.php:27-115 | lib/alipay/aop/request/AlipayMicropayOrderUnfreezeRequest.php:32-131 | lib/alipay/aop/request/AlipayUserTradeSearchRequest.php:67-243 — before extracting anything, compare `lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php` and `lib/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 443 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 `lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (100 lines × 3) lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47— lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47-179 | lib/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php:47-179 | lib/alipay/aop/request/AlipayMicropayOrderUnfreezeRequest.php:32-131 — before extracting anything, compare `lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php` and `lib/alipay/aop/request/AlipayMicropayOrderDirectPayRequest.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 443 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 `lib/alipay/aop/request/AlipayMicropayOrderConfirmpayurlGetRequest.php:47` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (144 lines × 2) lib/alipay/aop/request/AlipayMobilePublicAccountAddRequest.php:52— lib/alipay/aop/request/AlipayMobilePublicAccountAddRequest.php:52-195 | lib/alipay/aop/request/AlipayMobilePublicAccountResetRequest.php:52-195 — before extracting anything, compare `lib/alipay/aop/request/AlipayMobilePublicAccountAddRequest.php` and `lib/alipay/aop/request/AlipayMobilePublicAccountResetRequest.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. 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 `lib/alipay/aop/request/AlipayMobilePublicAccountAddRequest.php:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (111 lines × 2) lib/alipay/aop/request/AlipayPassCodeAddRequest.php:46— lib/alipay/aop/request/AlipayPassCodeAddRequest.php:46-167 | lib/alipay/aop/request/AlipayPassFileAddRequest.php:40-150 — 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 `lib/alipay/aop/request/AlipayPassCodeAddRequest.php:46` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (89 lines × 2) lib/alipay/aop/request/AlipayTrustUserAuthSendRequest.php:27— lib/alipay/aop/request/AlipayTrustUserAuthSendRequest.php:27-115 | lib/alipay/aop/request/AlipayTrustUserTokenGetRequest.php:27-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/alipay/aop/request/AlipayTrustUserAuthSendRequest.php:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 3) migrations/mysqldb/m191219_031426_fecshop_tables.php:16— migrations/mysqldb/m191219_031426_fecshop_tables.php:16-38 | migrations/mysqldb/m200924_022049_fecshop_tables.php:16-38 | migrations/mysqldb/m201218_021946_fecshop_tables.php:16-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `migrations/mysqldb/m191219_031426_fecshop_tables.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.
Duplicated block (35 lines × 3) models/mongodb/cms/Article.php:30— models/mongodb/cms/Article.php:30-68 | models/mongodb/cms/StaticBlock.php:29-64 | models/mongodb/url/UrlRewrite.php:25-59 — before extracting anything, compare `models/mongodb/cms/Article.php` and `models/mongodb/cms/StaticBlock.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. Read the line range as the matched WINDOW rather than a finished unit: at `models/mongodb/cms/Article.php:30` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 4) models/mysqldb/Category.php:29— models/mysqldb/Category.php:29-39 | models/mysqldb/Product.php:32-50 | models/mysqldb/Search.php:23-33 | models/mysqldb/cms/Article.php:27-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `models/mysqldb/Category.php:29` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (51 lines × 2) app/appadmin/modules/Catalog/block/productbrand/Manager.php:104— app/appadmin/modules/Catalog/block/productbrand/Manager.php:104-168 | app/appadmin/modules/Catalog/block/productbrandcategory/Manager.php:103-153 — `app/appadmin/modules/Catalog/block/productbrand/Manager.php` and `app/appadmin/modules/Catalog/block/productbrandcategory/Manager.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 3 separate duplicated blocks between them, totalling at least 95 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.
Duplicated block (9 lines × 31) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:67— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:67-77 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:57-67 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:63-73 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:74-84 | app/appadmin/modules/Config/block/appfronthome/Manager.php:58-68 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:63-73 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:66-76 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:57-67 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:63-73 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:74-84 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:57-67 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:53-63 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:67-77 | app/appadmin/modules/Config/block/appserverbase/Manager.php:54-64 | app/appadmin/modules/Config/block/appservercache/Manager.php:63-73 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:74-84 | app/appadmin/modules/Config/block/appserverhome/Manager.php:54-64 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:53-63 | app/appadmin/modules/Config/block/appserverstore/Manager.php:62-72 | app/appadmin/modules/Config/block/base/Manager.php:60-70 | app/appadmin/modules/Config/block/cart/Manager.php:55-65 | app/appadmin/modules/Config/block/currency/Manager.php:46-54 | app/appadmin/modules/Config/block/email/Manager.php:94-104 | app/appadmin/modules/Config/block/fa/Manager.php:56-66 | app/appadmin/modules/Config/block/order/Manager.php:60-70 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:72-82 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:59-69 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:62-72 | app/appadmin/modules/Config/block/product/Manager.php:59-69 | app/appadmin/modules/Config/block/search/Manager.php:56-66 | app/appadmin/modules/Config/block/service/Db.php:64-74 — `app/appadmin/modules/Config/block/appfrontaccount/Manager.php` and `app/appadmin/modules/Config/block/appfrontbase/Manager.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 5 separate duplicated blocks between them, totalling at least 59 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.
Duplicated block (15 lines × 30) app/appadmin/modules/Config/block/appfrontaccount/Manager.php:225— app/appadmin/modules/Config/block/appfrontaccount/Manager.php:225-239 | app/appadmin/modules/Config/block/appfrontbase/Manager.php:152-166 | app/appadmin/modules/Config/block/appfrontcache/Manager.php:234-248 | app/appadmin/modules/Config/block/appfrontcatalog/Manager.php:365-379 | app/appadmin/modules/Config/block/appfronthome/Manager.php:158-172 | app/appadmin/modules/Config/block/appfrontpayment/Manager.php:219-233 | app/appadmin/modules/Config/block/apphtml5account/Manager.php:224-238 | app/appadmin/modules/Config/block/apphtml5base/Manager.php:149-163 | app/appadmin/modules/Config/block/apphtml5cache/Manager.php:232-246 | app/appadmin/modules/Config/block/apphtml5catalog/Manager.php:366-380 | app/appadmin/modules/Config/block/apphtml5home/Manager.php:148-162 | app/appadmin/modules/Config/block/apphtml5payment/Manager.php:206-220 | app/appadmin/modules/Config/block/appserveraccount/Manager.php:225-239 | app/appadmin/modules/Config/block/appserverbase/Manager.php:126-140 | app/appadmin/modules/Config/block/appservercache/Manager.php:233-247 | app/appadmin/modules/Config/block/appservercatalog/Manager.php:340-354 | app/appadmin/modules/Config/block/appserverhome/Manager.php:118-132 | app/appadmin/modules/Config/block/appserverpayment/Manager.php:208-222 | app/appadmin/modules/Config/block/appserverstore/Manager.php:206-220 | app/appadmin/modules/Config/block/base/Manager.php:226-240 | app/appadmin/modules/Config/block/cart/Manager.php:132-146 | app/appadmin/modules/Config/block/email/Manager.php:444-458 | app/appadmin/modules/Config/block/fa/Manager.php:163-177 | app/appadmin/modules/Config/block/order/Manager.php:175-189 | app/appadmin/modules/Config/block/paymentalipay/Manager.php:212-226 | app/appadmin/modules/Config/block/paymentpaypal/Manager.php:187-201 | app/appadmin/modules/Config/block/paymentwxpay/Manager.php:182-196 | app/appadmin/modules/Config/block/product/Manager.php:173-187 | app/appadmin/modules/Config/block/search/Manager.php:148-162 | app/appadmin/modules/Config/block/service/Db.php:216-230 — `app/appadmin/modules/Config/block/appfrontaccount/Manager.php` and `app/appadmin/modules/Config/block/appfrontbase/Manager.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 5 separate duplicated blocks between them, totalling at least 59 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.
Duplicated block (22 lines × 6) app/appadmin/modules/Customer/block/account/Index.php:75— app/appadmin/modules/Customer/block/account/Index.php:75-113 | app/appadmin/modules/Customer/block/account/Index.php:121-181 | app/appadmin/modules/Customer/block/contacts/Index.php:76-100 | app/appadmin/modules/Customer/block/contacts/Index.php:108-159 | app/appadmin/modules/Customer/block/newsletter/Index.php:75-96 | app/appadmin/modules/Customer/block/newsletter/Index.php:104-139 — `app/appadmin/modules/Customer/block/contacts/Index.php` and `app/appadmin/modules/Customer/block/newsletter/Index.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 8 separate duplicated blocks between them, totalling at least 151 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.
Duplicated block (18 lines × 15) app/appfront/modules/Catalog/Module.php:26— app/appfront/modules/Catalog/Module.php:26-44 | app/appfront/modules/Catalogsearch/Module.php:26-46 | app/appfront/modules/Checkout/Module.php:26-46 | app/appfront/modules/Cms/Module.php:26-44 | app/appfront/modules/Customer/Module.php:26-44 | app/appfront/modules/Payment/Module.php:26-44 | app/appfront/modules/Site/Module.php:26-44 | app/apphtml5/modules/Catalog/Module.php:26-44 | app/apphtml5/modules/Catalogsearch/Module.php:26-44 | app/apphtml5/modules/Checkout/Module.php:26-44 | app/apphtml5/modules/Cms/Module.php:25-43 | app/apphtml5/modules/Customer/Module.php:26-44 | app/apphtml5/modules/Payment/Module.php:26-44 | app/apphtml5/modules/Site/Module.php:25-43 | app/appserver/modules/Checkout/Module.php:22-39 — `app/appfront/modules/Catalog/Module.php` and `app/appfront/modules/Catalogsearch/Module.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 21 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.
Duplicated block (13 lines × 10) app/appfront/modules/Catalog/block/reviewproduct/Lists.php:50— app/appfront/modules/Catalog/block/reviewproduct/Lists.php:50-62 | app/appfront/modules/Customer/block/address/Index.php:77-89 | app/appfront/modules/Customer/block/order/Index.php:74-86 | app/appfront/modules/Customer/block/productfavorite/Index.php:127-139 | app/appfront/modules/Customer/block/productreview/Index.php:75-87 | app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php:51-64 | app/apphtml5/modules/Customer/block/order/Index.php:64-76 | app/apphtml5/modules/Customer/block/productfavorite/Index.php:119-131 | app/apphtml5/modules/Customer/block/productreview/Index.php:65-77 | app/appserver/modules/Catalog/block/reviewproduct/Lists.php:50-62 — before extracting anything, compare `app/appfront/modules/Catalog/block/reviewproduct/Lists.php` and `app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 18) app/appfront/modules/Checkout/block/cart/Index.php:44— app/appfront/modules/Checkout/block/cart/Index.php:44-48 | app/appfront/modules/Checkout/block/onepage/Index.php:66-70 | app/appfront/modules/Customer/block/account/Forgotpassword.php:37-41 | app/appfront/modules/Customer/block/account/Index.php:38-42 | app/appfront/modules/Customer/block/account/Login.php:41-45 | app/appfront/modules/Customer/block/account/Register.php:43-47 | app/appfront/modules/Customer/block/account/Registerenable.php:41-45 | app/appfront/modules/Customer/block/account/Resetpassword.php:41-45 | app/appfront/modules/Customer/block/account/Resetpasswordsuccess.php:31-35 | app/appfront/modules/Customer/block/address/Edit.php:90-94 | app/appfront/modules/Customer/block/address/Index.php:45-49 | app/appfront/modules/Customer/block/editaccount/Index.php:35-39 | app/appfront/modules/Customer/block/order/Index.php:65-69 | app/appfront/modules/Customer/block/order/View.php:31-35 | app/appfront/modules/Customer/block/productfavorite/Index.php:65-69 | app/appfront/modules/Customer/block/productreview/Index.php:66-70 | app/appfront/modules/Customer/controllers/AccountController.php:206-210 | app/apphtml5/modules/Customer/block/account/Registerenable.php:37-41 — `app/appfront/modules/Checkout/block/cart/Index.php` and `app/appfront/modules/Checkout/block/onepage/Index.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 6 separate duplicated blocks between them, totalling at least 65 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.
Duplicated block (11 lines × 9) lib/alipay/lotusphp_runtime/Cache/Cache.php:13— lib/alipay/lotusphp_runtime/Cache/Cache.php:13-23 | lib/alipay/lotusphp_runtime/Captcha/Captcha.php:11-21 | lib/alipay/lotusphp_runtime/Cookie/Cookie.php:9-19 | lib/alipay/lotusphp_runtime/DB/Db.php:12-22 | lib/alipay/lotusphp_runtime/Pagination/Pagination.php:9-19 | lib/alipay/lotusphp_runtime/RBAC/Rbac.php:10-20 | lib/alipay/lotusphp_runtime/Session/Session.php:9-19 | lib/alipay/lotusphp_runtime/Url/Url.php:10-20 | lib/alipay/lotusphp_runtime/Validator/Validator.php:9-19 — `lib/alipay/lotusphp_runtime/Cache/Cache.php` and `lib/alipay/lotusphp_runtime/DB/Db.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 3 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.
Duplicated block (79 lines × 2 locations) REDACTED:1863— REDACTED:1863 · REDACTED:1976 — both copies are in the same file, so extract the 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 (33 lines × 2 locations) REDACTED:2721— REDACTED:2721 · REDACTED:3352 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (24 lines × 2 locations) REDACTED:5254— REDACTED:5254 · REDACTED:5394 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (19 matched lines × 2 locations) · ×1
Duplicated block with local edits (19 matched lines × 2 locations) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:652— app/apphtml5/theme/base/html5/assets/js/sm-extend.js:652 · app/apphtml5/theme/base/html5/assets/js/sm-extend.js:690 — the two spans are one implementation copied and then locally edited — 153 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (18 lines × 2 locations) REDACTED:5589— REDACTED:5589 · REDACTED:5613 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) REDACTED:5648— REDACTED:5648 · REDACTED:5667 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 2 locations) REDACTED:2824— REDACTED:2824 · REDACTED:3437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 3 locations) app/appadmin/theme/base/default/assets/js/appadmin.js:1— app/appadmin/theme/base/default/assets/js/appadmin.js:1 · app/appfront/theme/base/front/assets/js/js.js:79 · app/apphtml5/theme/base/html5/assets/js/fec.js:7 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (12 lines × 4 locations) REDACTED:1314— REDACTED:1314 · REDACTED:1329 · REDACTED:1354 · REDACTED:1381 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) REDACTED:2484— REDACTED:2484 · REDACTED:2582 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function onTouchMove (cyclomatic 62, cognitive 82) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:946— onTouchMove has cyclomatic complexity 62 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function onTouchEnd (cyclomatic 57, cognitive 125) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1096— onTouchEnd has cyclomatic complexity 57 and cognitive complexity 125; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Swiper (cyclomatic 45, cognitive 58) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:15— Swiper has cyclomatic complexity 45 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function updateSlidesSize (cyclomatic 40, cognitive 79) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:312— updateSlidesSize has cyclomatic complexity 40 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleTouchMove (cyclomatic 40, cognitive 67) REDACTED:6723— handleTouchMove has cyclomatic complexity 40 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _move (cyclomatic 36, cognitive 43) REDACTED:4110— _move has cyclomatic complexity 36 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _key (cyclomatic 35, cognitive 45) REDACTED:5125— _key has cyclomatic complexity 35 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 35, cognitive 38) REDACTED:296— (anonymous) has cyclomatic complexity 35 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function setTranslate (cyclomatic 33, cognitive 68) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1754— setTranslate has cyclomatic complexity 33 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function refresh (cyclomatic 31, cognitive 51) REDACTED:5556— refresh has cyclomatic complexity 31 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function PhotoBrowser (cyclomatic 31, cognitive 40) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2769— PhotoBrowser has cyclomatic complexity 31 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function monthHTML (cyclomatic 28, cognitive 62) REDACTED:2261— monthHTML has cyclomatic complexity 28 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleTouchMove (cyclomatic 28, cognitive 39) REDACTED:6345— handleTouchMove has cyclomatic complexity 28 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function setYearMonth (cyclomatic 27, cognitive 36) REDACTED:2595— setYearMonth has cyclomatic complexity 27 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _end (cyclomatic 27, cognitive 30) REDACTED:4213— _end has cyclomatic complexity 27 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function onSlideTouchMove (cyclomatic 27, cognitive 27) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:3158— onSlideTouchMove has cyclomatic complexity 27 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleTouchEnd (cyclomatic 26, cognitive 46) REDACTED:6825— handleTouchEnd has cyclomatic complexity 26 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function init (cyclomatic 26, cognitive 35) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2368— init has cyclomatic complexity 26 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function setTranslate (cyclomatic 25, cognitive 58) app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1861— setTranslate has cyclomatic complexity 25 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· app/apphtml5/theme/base/html5/assets/js/sm-city-picker.js · ×1
app/apphtml5/theme/base/html5/assets/js/sm-city-picker.js: 13351 lines of code app/apphtml5/theme/base/html5/assets/js/sm-city-picker.js:1— app/apphtml5/theme/base/html5/assets/js/sm-city-picker.js has 13351 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 7022 lines of code REDACTED:1— REDACTED has 7022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/apphtml5/theme/base/html5/assets/js/sm-extend.js · ×1
app/apphtml5/theme/base/html5/assets/js/sm-extend.js: 3127 lines of code app/apphtml5/theme/base/html5/assets/js/sm-extend.js:1— app/apphtml5/theme/base/html5/assets/js/sm-extend.js has 3127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/appfront/theme/base/front/assets/js/owl.carousel.js · ×1
app/appfront/theme/base/front/assets/js/owl.carousel.js: 1310 lines of code app/appfront/theme/base/front/assets/js/owl.carousel.js:1— app/appfront/theme/base/front/assets/js/owl.carousel.js has 1310 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×1
Untrusted text written into markup unescaped REDACTED:1483— `modal.trim()` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Orphaned file lib/wxpay/lib/WxPay.Data.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/product/ProductMongodb.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/Order.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file yii/views/errorHandler/exception.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/helper/Country.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file migrations/mysqldb/m190809_154516_fecshop_tables.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appserver/modules/Catalog/controllers/ProductController.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/product/ProductApi.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/Customer.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appadmin/modules/Catalog/block/productinfo/Manageredit.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/category/CategoryMysqldb.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appserver/modules/Catalog/controllers/CategoryController.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appadmin/theme/base/default/catalog/productinfo/managerbatchedit.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/product/Stock.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/category/CategoryMongodb.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file lib/google/lib/io/Google_IO.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appadmin/modules/AppadminbaseBlock.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appadmin/theme/base/default/layouts/dashboard.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file services/cart/QuoteItem.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/appfront/modules/Catalog/block/product/Index.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/apphtml5/modules/Catalog/block/product/Index.php:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate app/apphtml5/theme/base/html5/assets/js/sm-extend.js:2676— `!ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/)` appears character-identically in 2 files — app/apphtml5/theme/base/html5/assets/js/sm-extend.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate services/product/ProductMongodb.php:742— `!$PrimaryVal && (!isset($one['sku']) || empty($one['sku']))` appears character-identically in 2 files — services/product/ProductMongodb.php, services/product/ProductMysqldb.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 services/product/ProductMongodb.php:747— `!$PrimaryVal && (!isset($one['spu']) || empty($one['spu']))` appears character-identically in 2 files — services/product/ProductMongodb.php, services/product/ProductMysqldb.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/appfront/modules/Customer/block/order/Reorder.php:31— `!$order['customer_id'] || ($order['customer_id'] != $customer_id)` appears character-identically in 3 files — app/appfront/modules/Customer/block/order/Reorder.php, app/apphtml5/modules/Customer/block/order/Reorder.php, app/appserver/modules/Customer/controllers/OrderController.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/appfront/modules/Catalog/block/category/Index.php:346— `!empty($category_query_priceRange) && is_array($category_query_priceRange)` appears character-identically in 3 files — app/appfront/modules/Catalog/block/category/Index.php, app/apphtml5/modules/Catalog/block/category/Index.php, app/appserver/modules/Catalog/controllers/CategoryController.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/appfront/modules/Catalog/controllers/ReviewproductController.php:45— `!empty($editForm) && is_array($editForm)` appears character-identically in 2 files — app/appfront/modules/Catalog/controllers/ReviewproductController.php, app/apphtml5/modules/Catalog/controllers/ReviewproductController.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/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:341— `!empty($gallery_image) && is_array($gallery_image)` appears character-identically in 2 files — app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php, app/appadmin/modules/Catalog/block/productinfo/Manageredit.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/appfront/theme/base/front/customer/leftmenu.php:17— `!empty($leftMenuArr) && is_array($leftMenuArr)` appears character-identically in 2 files — app/appfront/theme/base/front/customer/leftmenu.php, app/apphtml5/theme/base/html5/customer/leftmenu.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/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php:317— `!empty($main_image) && is_array($main_image)` appears character-identically in 2 files — app/appadmin/modules/Catalog/block/productinfo/Managerbatchedit.php, app/appadmin/modules/Catalog/block/productinfo/Manageredit.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 services/payment/Wxpay.php:370— `!empty($out_trade_no) && !empty($trade_no)` appears character-identically in 4 files — services/payment/Wxpay.php, services/payment/WxpayH5.php, services/payment/WxpayJsApi.php, services/payment/WxpayMicro.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 services/search/MysqlSearch.php:122— `!empty($searchLangCode) && is_array($searchLangCode)` appears character-identically in 2 files — services/search/MysqlSearch.php, services/search/XunSearch.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/appfront/theme/base/front/checkout/onepage/index/shipping.php:18— `!empty($shippings) && is_array($shippings)` appears character-identically in 4 files — app/appfront/theme/base/front/checkout/onepage/index/shipping.php, app/appfront/theme/base/front/payment/paypal/express/review/shipping.php, app/apphtml5/theme/base/html5/checkout/onepage/index/shipping.php, app/apphtml5/theme/base/html5/payment/paypal/express/review/shipping.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/appapi/modules/V1/controllers/ProductattrgroupController.php:133— `!is_array($attr_ids) || empty($attr_ids)` appears character-identically in 2 files — app/appapi/modules/V1/controllers/ProductattrgroupController.php, services/Product.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 services/category/CategoryMongodb.php:707— `!is_array($remoteIds) || empty($remoteIds)` appears character-identically in 2 files — services/category/CategoryMongodb.php, services/category/CategoryMysqldb.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/appfront/modules/Catalog/block/product/Index.php:290— `!is_array($this->_productSpuAttrArr) || empty($this->_productSpuAttrArr)` appears character-identically in 3 files — app/appfront/modules/Catalog/block/product/Index.php, app/apphtml5/modules/Catalog/block/product/Index.php, app/appserver/modules/Catalog/controllers/ProductController.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/appfront/modules/Checkout/block/onepage/Index.php:37— `!isset($cartInfo['products']) || !is_array($cartInfo['products']) || empty($cartInfo['products'])` appears character-identically in 6 files — app/appfront/modules/Checkout/block/onepage/Index.php, app/appfront/modules/Payment/block/paypal/express/Review.php, app/apphtml5/modules/Checkout/block/onepage/Index.php, app/apphtml5/modules/Payment/block/paypal/express/Review.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 services/category/CategoryMongodb.php:626— `!isset($model[$this->getPrimaryKey()]) || !$model[$this->getPrimaryKey()]` appears character-identically in 3 files — services/category/CategoryMongodb.php, services/category/CategoryMysqldb.php, services/product/ProductMysqldb.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 services/product/ProductMongodb.php:739— `!isset($one[$primaryKey]) || !$one[$primaryKey]` appears character-identically in 2 files — services/product/ProductMongodb.php, services/product/ProductMysqldb.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/appfront/modules/Catalog/block/product/Index.php:301— `!isset($one[$spuAttr]) || !$one[$spuAttr]` appears character-identically in 3 files — app/appfront/modules/Catalog/block/product/Index.php, app/apphtml5/modules/Catalog/block/product/Index.php, app/appserver/modules/Catalog/controllers/ProductController.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 services/product/ProductMongodb.php:769— `!isset($one['description'][$defaultLangDes]) || empty($one['description'][$defaultLangDes])` appears character-identically in 2 files — services/product/ProductMongodb.php, services/product/ProductMysqldb.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 services/product/ProductMongodb.php:758— `!isset($one['name'][$defaultLangName]) || empty($one['name'][$defaultLangName])` appears character-identically in 2 files — services/product/ProductMongodb.php, services/product/ProductMysqldb.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 services/category/CategoryMongodb.php:697— `!isset($one['remote_id']) || !$one['remote_id']` appears character-identically in 6 files — services/category/CategoryMongodb.php, services/category/CategoryMysqldb.php, services/product/Brand.php, services/product/Brandcategory.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/appfront/modules/Customer/block/address/Edit.php:59— `!isset($this->_address['email']) || empty($this->_address['email'])` appears character-identically in 2 files — app/appfront/modules/Customer/block/address/Edit.php, app/apphtml5/modules/Customer/block/address/Edit.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/appfront/modules/Customer/block/address/Edit.php:64— `!isset($this->_address['first_name']) || empty($this->_address['first_name'])` appears character-identically in 2 files — app/appfront/modules/Customer/block/address/Edit.php, app/apphtml5/modules/Customer/block/address/Edit.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/appfront/modules/Customer/block/address/Edit.php:69— `!isset($this->_address['last_name']) || empty($this->_address['last_name'])` appears character-identically in 2 files — app/appfront/modules/Customer/block/address/Edit.php, app/apphtml5/modules/Customer/block/address/Edit.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.
D34 · Knowledge Freshness· Most significant orphaned file · ×3
Most significant orphaned file app/appfront/theme/base/front/layouts/wxpay_start.php:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file services/helper/MobileDetect.php:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file services/product/ProductMysqldb.php:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Hand-rolled JSON/XML parsing via regex lib/alipay/lotusphp_runtime/MVC/TemplateView.php:253— 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 lib/alipay/lotusphp_runtime/MVC/TemplateView.php:262— 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 1 significant file(s) lose their only recent owner: services/Cart.php. Pair on, review, or document these before any departure.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (227391 LoC, 1501 module-visible types across 328 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
Concentrated knowledge decay — 586 of 587 significant files have no living knowledge, while the repository is still being changed at a low rate (2 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 586 separate risks. Counted over 587 of the 1775 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the REDACTED, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add phpstan or psalm (or `semgrep --config=auto`, which runs on any language) — 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.
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.
Silent fallback default in catch lib/wxpay/example/phpqrcode/phpqrcode.php:1279— `encodeBitStream` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).
0
—
Run 01a15b6c-f753-7f42-adf3-8959569fbab3 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 26 · Warnings: 1468 · Recommendations: 627 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 20-10-2026 @ 22:27 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.