Public report of phacility/phabricator, published 25 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.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, 25 October 2026, 03:03 UTC · Survey ID cd_28deba0096b44695a9c2c2982ea72eb9

phacility/phabricator

Measured 25 October 2026, 02:57 UTC, at code version d66a1e1

Regression: 1 dimension fell since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 29out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 2 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 very large codebase: 510,985 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 2.8 person-years · Weakest lens: Production Readiness, 17

Findings by how serious they are

20 critical 3677 serious 215 minor

16 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
25 October 2026, 02:57 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 ▸

51of 54 dimensions measured by tools. The other 3 are advisory notes from an AI model, which explain the code but don't count towards the score.
3899of 3912 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.
54dimensions across 5 lenses, read from 510,985 lines of product code in 1 project.
Chapters

Executive summary

phacility/phabricator scores 29 out of 100 and is rated Weak, while three of its five lenses score higher still: Architecture at 93, rated Exemplary, and Maturity at 47 and Code Health at 42, both rated Weak.

The score is lower than those three because the weakest lens counts most, and here that is Production Readiness, which scores 17 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 4 Leaked secret finding(s) in REDACTED Scanning and to resolve the 9 High secret finding(s) in Secrets (history), and if Production Readiness rose to 70, the score would rise from 29 to about 40.

20 findings are critical: 16 in Secrets (history) and four in REDACTED Scanning.

Watchdog couldn't measure 14 dimensions in this code, among them Code Coverage, Test Distribution and Test Reliability, so they are left out of the score. The product code is 510,985 lines, which would take an estimated 2.8 person-years, around €410,000, to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 17 · counts for 47%Security and Compliance 27 · counts for 26%Code Health 42 · counts for 14%Maturity 47 · counts for 8%Architecture 93 · counts for 4%

If Production Readiness rose from 17 to 70, the lowest score rated Strong, the score would rise from 29 to about 40.

Code composition: what the lines of code are
Product code 96%Tests 4%
New since the last survey: 36 findings

These 36 critical or serious findings weren't in the previous survey, on 11 October 2026.

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: 64 findings

These 64 critical or serious findings were in the previous survey, on 11 October 2026, and are gone from this one.

  • Code Duplication · Members sharing a duplicated core (19 members, 50+ identical tokens) src/applications/badges/query/PhabricatorBadgesSearchEngine.php
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php
  • Explicit Debt · TodoComment src/applications/project/storage/PhabricatorProject.php
  • Change Coupling · Change coupling: PhabricatorInlineComment.php ↔ DiffInline.js src/infrastructure/diff/interface/PhabricatorInlineComment.php
  • Change Coupling · Change coupling: PHUIDiffInlineCommentView.php ↔ DiffInline.js src/infrastructure/diff/view/PHUIDiffInlineCommentView.php
  • Change Coupling · Change coupling: AlmanacDevice.php ↔ AlmanacService.php src/applications/almanac/storage/AlmanacDevice.php
  • Change Coupling · Change coupling: DifferentialCreateDiffConduitAPIMethod.php ↔ DifferentialCreateRawDiffConduitAPIMethod.php src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
  • Change Coupling · Change coupling: PhabricatorInlineComment.php ↔ PHUIDiffInlineCommentEditView.php src/infrastructure/diff/interface/PhabricatorInlineComment.php
  • Code Duplication · Duplicated block (7 lines × 3 locations) webroot/rsrc/js/application/herald/HeraldRuleEditor.js
  • Code Duplication · Duplicated block (7 lines × 2 locations) webroot/rsrc/js/application/trigger/TriggerRuleEditor.js
  • Code Duplication · Duplicated block with local edits (7 matched lines × 2 locations) webroot/rsrc/js/core/ToolTip.js
  • Code Duplication · Duplicated block (6 lines × 3 locations) webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js
  • Code Duplication · Duplicated block (6 lines × 7 locations) webroot/rsrc/js/application/config/behavior-reorder-fields.js
  • Code Duplication · Duplicated block with local edits (5 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (5 lines × 2 locations) webroot/rsrc/js/application/policy/behavior-policy-control.js
  • Code Duplication · Duplicated block (5 lines × 2 locations) webroot/rsrc/js/core/behavior-badge-view.js
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/herald/engine/HeraldEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/herald/engine/HeraldEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/macro/markup/PhabricatorMemeRemarkupRule.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/notification/builder/PhabricatorNotificationBuilder.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/oauthserver/PhabricatorOAuthServer.php
  • Exception handling · Swallowed exception (empty catch) src/applications/passphrase/controller/PassphraseCredentialEditController.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/people/storage/PhabricatorUser.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/people/storage/PhabricatorUser.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/phortune/storage/PhortuneCart.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/phortune/storage/PhortuneCart.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/phortune/storage/PhortuneCart.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/policy/storage/PhabricatorPolicy.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/repository/management/PhabricatorRepositoryManagementMarkReachableWorkflow.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/repository/storage/PhabricatorRepositoryWorkingCopyVersion.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/repository/storage/PhabricatorRepository.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/repository/storage/PhabricatorRepository.php
  • Exception handling · Swallowed exception (empty catch) src/applications/system/engine/PhabricatorDestructionEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/system/engine/PhabricatorDestructionEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/editengine/PhabricatorEditEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/editengine/PhabricatorEditEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/editengine/PhabricatorEditEngine.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
  • Exception handling · Swallowed exception (caught, then discarded) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/env/PhabricatorEnv.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/env/PhabricatorEnv.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/env/PhabricatorEnv.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/env/PhabricatorEnv.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/export/field/PhabricatorEpochExportField.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/markup/markuprule/PhutilRemarkupHyperlinkRule.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/markup/markuprule/PhutilRemarkupHyperlinkRule.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/markup/rule/PhabricatorYoutubeRemarkupRule.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/markup/rule/PhabricatorConfigRemarkupRule.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/ssh/PhabricatorSSHWorkflow.php
  • Exception handling · Swallowed exception (caught, then discarded) src/infrastructure/util/PhabricatorGlobalLock.php
  • Exception handling · Swallowed exception (caught, then discarded) src/view/form/control/AphrontFormDateControlValue.php
  • Exception handling · Swallowed exception (caught, then discarded) src/view/form/control/AphrontFormDateControl.php
  • Exception handling · Swallowed exception (caught, then discarded) src/view/form/control/AphrontFormDateControl.php
  • Exception handling · Swallowed exception (caught, then discarded) src/view/form/control/AphrontFormDateControl.php
  • Outbound HTTP resilience · Outbound HTTP without resilience support/aphlict/server/lib/AphlictPeer.js
Rebuild cost: about €410,000 · Estimate
Cost to rebuild€130,000 to €680,000, for 2,248 to 7,132 hours of work, about 2.8 person-years for 1 to 6 engineers
Difficulty of the problemLow, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 29. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 510,985 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 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 13 points · Low effort · REDACTED Scanning
2
Resolve the 9 High secret finding(s) in Secrets (history) — start with REDACTED (5), REDACTED, REDACTED.
Raises the score by about 5 points · Low effort · Secrets (history)
3
Resolve the 7 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED.
Raises the score by about 5 points · Low effort · Secrets (history)

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 €410,000 to build again, about 2.8 person-years of work. Its weakest lens is Production Readiness, at 17 (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 4 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 13 points for low effort, because it clears the 4 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 7.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 434 lines over the last 90 days, which is about 1,760 lines a year. At that pace, the extra work comes to an estimated 0.1 to 0.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of 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; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

55 modules, with 4 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; 15 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 (global)2 conf3 externals.JsShrink4 externals.pear-figlet.docs.examples5 externals.xhprof6 resources.sql.autopatches.201412227 resources.sql.patches.0908 scripts.init9 scripts.ssh10 src.applications.celerity11 src.applications.phid12 src.infrastructure.markup13 support.aphlict.server14 support.phame15 support.startup16 webroot17 webroot.rsrc.externals.javelin.core18 webroot.rsrc.externals.javelin.docs19 webroot.rsrc.externals.javelin.ext.view20 webroot.rsrc.externals.javelin.lib21 webroot.rsrc.js.application.aphlict22 webroot.rsrc.js.application.calendar23 webroot.rsrc.js.application.config24 webroot.rsrc.js.application.conpherence25 webroot.rsrc.js.application.countdown26 webroot.rsrc.js.application.daemon27 webroot.rsrc.js.application.dashboard28 webroot.rsrc.js.application.differential29 webroot.rsrc.js.application.diffusion30 webroot.rsrc.js.application.doorkeeper31 webroot.rsrc.js.application.drydock32 webroot.rsrc.js.application.files33 webroot.rsrc.js.application.harbormaster34 webroot.rsrc.js.application.herald35 webroot.rsrc.js.application.maniphest36 webroot.rsrc.js.application.owners37 scripts.symbols38 src.infrastructure.javelin39 src.infrastructure.storage.xsprintf40 src.view
1 (global)
2 conf
3 externals.JsShrink
4 externals.pear-figlet.docs.examples
5 externals.xhprof
6 resources.sql.autopatches.20141222
7 resources.sql.patches.090
8 scripts.init
9 scripts.ssh
10 src.applications.celerity
11 src.applications.phid
12 src.infrastructure.markup
13 support.aphlict.server
14 support.phame
15 support.startup
16 webroot
17 webroot.rsrc.externals.javelin.core
18 webroot.rsrc.externals.javelin.docs
19 webroot.rsrc.externals.javelin.ext.view
20 webroot.rsrc.externals.javelin.lib
21 webroot.rsrc.js.application.aphlict
22 webroot.rsrc.js.application.calendar
23 webroot.rsrc.js.application.config
24 webroot.rsrc.js.application.conpherence
25 webroot.rsrc.js.application.countdown
26 webroot.rsrc.js.application.daemon
27 webroot.rsrc.js.application.dashboard
28 webroot.rsrc.js.application.differential
29 webroot.rsrc.js.application.diffusion
30 webroot.rsrc.js.application.doorkeeper
31 webroot.rsrc.js.application.drydock
32 webroot.rsrc.js.application.files
33 webroot.rsrc.js.application.harbormaster
34 webroot.rsrc.js.application.herald
35 webroot.rsrc.js.application.maniphest
36 webroot.rsrc.js.application.owners
37 scripts.symbols1
38 src.infrastructure.javelin1
39 src.infrastructure.storage.xsprintf2
40 src.view1
Uses a module listed above itPart of a loopThe module itself
1 (global)2 conf3 externals.JsShrink4 externals.pear-figlet.docs.examples5 externals.xhprof6 resources.sql.autopatches.201412227 resources.sql.patches.0908 scripts.init9 scripts.ssh10 src.applications.celerity11 src.applications.phid12 src.infrastructure.markup13 support.aphlict.server14 support.phame15 support.startup16 webroot17 webroot.rsrc.externals.javelin.core18 webroot.rsrc.externals.javelin.docs19 webroot.rsrc.externals.javelin.ext.view20 webroot.rsrc.externals.javelin.lib21 webroot.rsrc.js.application.aphlict22 webroot.rsrc.js.application.calendar23 webroot.rsrc.js.application.config24 webroot.rsrc.js.application.conpherence25 webroot.rsrc.js.application.countdown26 webroot.rsrc.js.application.daemon27 webroot.rsrc.js.application.dashboard28 webroot.rsrc.js.application.differential29 webroot.rsrc.js.application.diffusion30 webroot.rsrc.js.application.doorkeeper31 webroot.rsrc.js.application.drydock32 webroot.rsrc.js.application.files33 webroot.rsrc.js.application.harbormaster34 webroot.rsrc.js.application.herald35 webroot.rsrc.js.application.maniphest36 webroot.rsrc.js.application.owners37 scripts.symbols38 src.infrastructure.javelin39 src.infrastructure.storage.xsprintf40 src.view(global)1conf2externals.JsShrink3externals.pear-figlet.docs.examples4externals.xhprof5resources.sql.autopatches.201412226resources.sql.patches.0907scripts.init8scripts.ssh9src.applications.celerity10src.applications.phid11src.infrastructure.markup12support.aphlict.server13support.phame14support.startup15webroot16webroot.rsrc.externals.javelin.core17webroot.rsrc.externals.javelin.docs18webroot.rsrc.externals.javelin.ext.view19webroot.rsrc.externals.javelin.lib20webroot.rsrc.js.application.aphlict21webroot.rsrc.js.application.calendar22webroot.rsrc.js.application.config23webroot.rsrc.js.application.conpherence24webroot.rsrc.js.application.countdown25webroot.rsrc.js.application.daemon26webroot.rsrc.js.application.dashboard27webroot.rsrc.js.application.differential28webroot.rsrc.js.application.diffusion29webroot.rsrc.js.application.doorkeeper30webroot.rsrc.js.application.drydock31webroot.rsrc.js.application.files32webroot.rsrc.js.application.harbormaster33webroot.rsrc.js.application.herald34webroot.rsrc.js.application.maniphest35webroot.rsrc.js.application.owners36scripts.symbols37src.infrastructure.javelin38src.infrastructure.storage.xsprintf39src.view401121+15 more modules (most-connected shown)

At a glance — Code Health · 42% · Weak · gated by R1, X5 ·

At a glance — Architecture · 93% · Exemplary ·

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

At a glance — Readiness · 17% · Critical · gated by D13, P1, P3, P7 ·

At a glance — Security · 27% · Weak · gated by D28 ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection35Medium
A07:2025 — Authentication Failures21High / Critical

Roadmap

Immediately resolve the four leaked secrets in source files and the nine historical secret findings to eliminate critical exposure risks. Establish a CI pipeline that builds and tests on every push, integrating static analysis and security scanning to prevent regressions from merging. Finally, address the thirty-two static analysis issues to improve code reliability and maintainability.

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

Do thisHelpsEffortDimension
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.+13.2 ptsLowREDACTED Scanning
Resolve the 9 High secret finding(s) in Secrets (history) — start with REDACTED (5), REDACTED, REDACTED.+5.1 ptsLowSecrets (history)
Resolve the 7 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED.+4.6 ptsLowSecrets (history)
Add a CI workflow that builds and runs the test suite on every push/PR.+4.9 ptsMediumCI/CD gates
Run what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.+4.9 ptsMediumSecurity & performance tooling
Resolve the 32 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8), REDACTED (6), REDACTED (5).+4.7 ptsMediumStatic Analysis (SAST)
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.+2.8 ptsMediumOutbound HTTP resilience
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.+2.0 ptsMediumArchitecture documentation

File quality

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

FileScoreBandWorst signal
REDACTED2.6SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED3.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.6MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.6MixedSecrets (history): High secret: REDACTED
REDACTED5.0MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED5.0MixedSecrets (history): High secret: REDACTED
src/applications/herald/adapter/HeraldAdapter.php5.5MixedCyclomatic Complexity: HeraldAdapter.doesConditionMatch (cyclomatic 43)
src/view/phui/PHUITimelineEventView.php5.5MixedCyclomatic Complexity: PHUITimelineEventView.render (cyclomatic 28)
src/applications/maniphest/query/ManiphestTaskQuery.php5.5MixedCyclomatic Complexity: ManiphestTaskQuery.buildWhereClauseParts (cyclomatic 24)
src/applications/differential/query/DifferentialRevisionQuery.php5.5MixedCyclomatic Complexity: DifferentialRevisionQuery.buildWhereClause (cyclomatic 22)
src/applications/differential/render/DifferentialChangesetRenderer.php5.5MixedCyclomatic Complexity: DifferentialChangesetRenderer.buildPrimitives (cyclomatic 19)
src/applications/maniphest/query/ManiphestTaskSearchEngine.php5.6MixedCyclomatic Complexity: ManiphestTaskSearchEngine.buildQueryFromParameters (cyclomatic 25)
src/applications/phriction/query/PhrictionDocumentQuery.php5.7MixedCyclomatic Complexity: PhrictionDocumentQuery.buildWhereClauseParts (cyclomatic 21)
src/applications/transactions/editfield/PhabricatorEditField.php5.7MixedGod Classes: TooManyMethods: PhabricatorEditField
REDACTED5.7MixedCognitive Complexity: AphrontApplicationConfiguration.readHTTPPOSTData (cognitive 25)
REDACTED5.8MixedCyclomatic Complexity: PhabricatorNotificationServersConfigType.validateStoredValue (cyclomatic 18)
src/applications/herald/action/HeraldAction.php5.9MixedCyclomatic Complexity: HeraldAction.loadStandardTargets (cyclomatic 21)
src/applications/phriction/editor/PhrictionTransactionEditor.php5.9MixedCognitive Complexity: PhrictionTransactionEditor.validateTransaction (cognitive 40)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 20

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

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

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

Could not be resolved — 16

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 51 of 54 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 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 — 54 dimensions across the health lenses
D1D2D3D4D6D10D13D15D16D17D19D21D26D27D28D29D34D35AX10AX3AX5M1M2M3M4P1P2P3P6P7R1R10R2R3R9X1X12X13X14X15X16X17X18X19X21X22X23X24X25X28X29X3X30X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 3899 of 3912 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

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

Every finding is locatable in findings.md. Run 01a170fe-08ee-709a-b3cf-d1624c9be835.

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

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.php, .js) 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`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) 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`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) 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.
  • D9 Test Distribution — 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 distribution NOT SCORED: this repository's production source spans more than one ecosystem, and the test-pyramid census cannot read the .php test suite(s) — so the pyramid was not measured for the repository as a whole. The suites we could count came back with 96 test method(s) (96 unit, 0 integration, 0 BDD, 0 e2e), but that is a shape for one part of the product and we do not publish a partial pyramid as if it were complete. This is OUR limitation, not a defect in the repo — test distribution is excluded from the score rather than counted.
  • D10 Test Quality — 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. The 96 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 216 test source file(s) (.php) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • 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, .js) 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. No dependency manifest this pass reads for hygiene (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems)) was found in this repository, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
  • 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 — no dependency manifest this pass reads for licence data (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems)) was found in this repository, so it declares no third-party dependency closure to grade. A gap in the analyzer, NOT a finding that this repository's licences are compliant: a manifest in an ecosystem outside that list, or third-party code copied into the tree, is not read — so this dimension asserts nothing about this repository's licensing in either direction.
  • D20 ADR Quality — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The ADR expectation is gated on whether a repository ships a deployable product. Our repo-kind classifier reads .NET project files and the host and package markers of the other ecosystems it knows (a Go `package main`, a Cargo binary, a package.json `bin`, `start` script or application dev server such as Vite or Next, Python console scripts or a Django/WSGI entry point, a Spring Boot / WAR / Gradle application build, a Rack or Rails app, a Composer project, an OTP release or escript, a Dockerfile, a Procfile, a Platform.sh `.platform/routes.yaml`, and the corresponding published-package manifests, including an OTP `*.app.src`, a Drupal module's `*.info` and a Claude Code `.claude-plugin/plugin.json`), and found none here, so we could not tell what kind of repository this is and did not assess its ADR log. This is a gap in our analyzer, not a finding about this repository.
  • 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: 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.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `externals/stripe-php/lib/Stripe/ApiRequestor.php` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • 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.
  • 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.
  • 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. 8 further occurrence(s) are not listed individually; the score already reflects all 48.
  • 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.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 84 further occurrence(s) are not listed individually; the score already reflects all 124.
  • 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 make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • 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.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • 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 (3): D19, 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.

Dimensions

D1 · Cyclomatic Complexity6.1 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

390 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PhabricatorAuthRegisterController.handleRequest at 88. A further 13 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 AphrontResponse.getHTTPResponseMessage at 44 — they are counted neither in the figure above nor in this dimension's score. 5 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/aphront/response/AphrontResponse.php (AphrontResponse.getHTTPResponseMessage at 44), src/applications/files/constants/FileTypeIcon.php (FileTypeIcon.getFileIcon at 27), src/applications/differential/constants/DifferentialAction.php (DifferentialAction.getBasicStoryText at 19), src/applications/config/schema/PhabricatorConfigStorageSchema.php (PhabricatorConfigStorageSchema.getIssueName at 18), src/infrastructure/customfield/field/PhabricatorCustomField.php (PhabricatorCustomField.shouldEnableForRole at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

(anonymous)::assist (cyclomatic 29) · ×3webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188
(anonymous) (cyclomatic 27) · ×2webroot/rsrc/js/application/transactions/behavior-comment-actions.js:12
(anonymous) (cyclomatic 23) · ×2webroot/rsrc/js/core/behavior-line-linker.js:10
(anonymous) (cyclomatic 20) · ×2webroot/rsrc/js/core/behavior-object-selector.js:9
(anonymous) (cyclomatic 16) · ×2webroot/rsrc/js/application/policy/behavior-policy-control.js:13

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

What to do

  1. Bring the 9 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with PhabricatorAuthRegisterController.handleRequest (cyclomatic 88), behavior-pholio-mock-view.JX.behavior("pholio-mock-view") (cyclomatic 75), (anonymous) (cyclomatic 75). — 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 9 together lifts Cyclomatic Complexity from 6.1 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. 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.

D2 · Cognitive Complexity5.2 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

903 method(s) exceeded the cognitive complexity threshold of 15; the worst was PhabricatorAuthRegisterController.handleRequest at 208.

(anonymous)::assist (cognitive 26) · ×10webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188
(anonymous) (cognitive 16) · ×5webroot/rsrc/js/core/behavior-refresh-csrf.js:31
(anonymous) (cognitive 59) · ×2webroot/rsrc/js/core/behavior-fancy-datepicker.js:10
(anonymous) (cognitive 29) · ×2webroot/rsrc/js/core/behavior-lightbox-attachments.js:12
(anonymous) (cognitive 24) · ×2webroot/rsrc/js/application/projects/behavior-project-boards.js:13

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

What to do

  1. Bring the 10 bodies over 120 down to 120 or less in Cognitive Complexity — start with PhabricatorAuthRegisterController.handleRequest (cognitive 208), DifferentialChangesetTwoUpRenderer.renderTextChange (cognitive 174), PhabricatorApplicationTransaction.getTitle (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 10 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.
  2. 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.

D3 · God Classes6.3 / 10Adequate✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

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

577 god class(es) detected.

MethodTooLong: PhabricatorUSEnglishTranslation.getTranslations · ×285src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php:10
TooManyMethods: PhabricatorApplicationTransactionEditor · ×112src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:40
ClassTooLong: PhabricatorApplicationTransactionEditor · ×98src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:40
FileTooLong: editor/PhabricatorApplicationTransactionEditor.php · ×63src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
FunctionTooLong: behavior-pholio-mock-view.JX.behavior("pholio-mock-view") · ×19webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:16

What to do

  1. Resolve the 285 MethodTooLong finding(s) in God Classes — start with PhabricatorStorageManagementWorkflow.php (3), PhabricatorCursorPagedPolicyAwareQuery.php (3), DiffusionCommitController.php (2). — One of this dimension's main actionable groups (285 warning-level).
  2. Resolve the 112 TooManyMethods finding(s) in God Classes — start with PhabricatorApplicationTransactionEditor.php, PhabricatorRepository.php, PhabricatorEditEngine.php. — One of this dimension's main actionable groups (112 warning-level).
  3. Resolve the 98 ClassTooLong finding(s) in God Classes — start with PhabricatorApplicationTransactionEditor.php, PhabricatorCursorPagedPolicyAwareQuery.php, PhabricatorRepository.php. — One of this dimension's main actionable groups (98 warning-level).
  4. 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.

D4 · Code Duplication9.0 / 10Stronggated by 1070 serious findings✓ Tool-verified

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

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

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

1021 duplicated block group(s) detected. A further 49 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 20 of the 1070 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (11 lines × 2) · ×49src/applications/almanac/controller/AlmanacBindingEditController.php:78
Duplicated block (14 lines × 2) · ×42src/applications/almanac/query/AlmanacBindingQuery.php:53
Duplicated block (9 lines × 2) · ×40src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:274
Duplicated block (13 lines × 2) · ×38src/applications/almanac/controller/AlmanacDeviceViewController.php:20
Duplicated block (15 lines × 2) · ×37src/applications/almanac/controller/AlmanacDeviceViewController.php:127

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

What to do

  1. Resolve the 49 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with DifferentialRevisionRequiredActionResultBucket.php (2), AlmanacBindingEditController.php, AlmanacDeviceViewController.php. — One of this dimension's main actionable groups (49 warning-level).
  2. Resolve the 42 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with AlmanacBindingQuery.php, PhabricatorAuditManagementDeleteWorkflow.php, PhabricatorAuthRevokeTokenController.php. — One of this dimension's main actionable groups (42 warning-level).
  3. Resolve the 40 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with PhabricatorAuditManagementDeleteWorkflow.php, PhabricatorCommitSearchEngine.php, PhabricatorAuthSetPasswordController.php. — One of this dimension's main actionable groups (40 warning-level).
  4. 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.

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

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

99 of 907 classes have LCOM4 above 3.

Low cohesion: DifferentialChangesetRenderer (LCOM4 25) · ×99src/applications/differential/render/DifferentialChangesetRenderer.php:3

What to do

  1. Resolve the 99 Low cohesion finding(s) in Cohesion (LCOM4) — start with DifferentialChangesetRenderer.php, REDACTED, HeraldAdapter.php. — One of this dimension's main actionable groups (99 warning-level).
  2. 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.

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 96 tests. Measured on the JavaScript/TypeScript suite only — at least 216 test source file(s) (.php) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

4 secret(s) detected.

REDACTED

What to do

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

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

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

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

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

Top hotspots: src/applications/policy/filter/PhabricatorPolicyFilter.php (4×25=100); src/applications/calendar/query/PhabricatorCalendarEventQuery.php (3×29=87); src/applications/diffusion/query/DiffusionCommitQuery.php (2×24=48)

Hotspot: src/applications/policy/filter/PhabricatorPolicyFilter.php · ×4src/applications/policy/filter/PhabricatorPolicyFilter.php:156

What to do

  1. Resolve the 4 Hotspot finding(s) in Churn × Complexity Hotspots — start with PhabricatorPolicyFilter.php, PhabricatorCalendarEventQuery.php, DiffusionCommitQuery.php. — One of this dimension's main actionable groups (4 warning-level).

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

D16 · Bus Factor9.2 / 10Exemplary✓ Tool-verified

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.

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

51 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/applications/repository/storage/PhabricatorRepository.php. Counted over 629 of the 5927 production source files in this repository: 4151 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1147 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.

D17 · Explicit Debt9.8 / 10Stronggated by 517 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

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

TodoComment · ×513scripts/ssh/ssh-auth.php:12
HackComment · ×4src/applications/project/events/PhabricatorProjectUIEventListener.php:15

What to do

  1. Resolve the 513 TodoComment finding(s) in Explicit Debt — start with PhabricatorApplicationTransactionEditor.php (15), PhabricatorPolicyFilter.php (9), DiffusionCommitController.php (7). — One of this dimension's main actionable groups (513 warning-level).
  2. Resolve the 4 HackComment finding(s) in Explicit Debt — start with PhabricatorProjectUIEventListener.php, PhabricatorSubscriptionsUIEventListener.php, PhabricatorTokenUIEventListener.php. — One of this dimension's main actionable groups (4 warning-level).
  3. 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.

D19 · Documentation QualityStrong◐ Sampled · advisory

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

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

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

The repository's root README is stale (Effective June 1, 2021) and documents Phabricator as a no-longer-maintained collection of web apps with an Apache 2.0 license, but the remaining READMEs are for specific directories: JsShrink (PHP/JS minifier), GitHub Octicons (scalable icon set handcrafted by GitHub), Porter stemmer (Richard Heyes), FIGlet project home page and download info, and D3 (data-driven documents). All four non-root READMEs document their own directories rather than the repository as a whole, so each is judged against its own directory. The root README lacks an overview of what Phabricator does or what it is for; it only states that Phabricator is no longer actively maintained and lists license info.

What to do

  1. Improve Documentation Quality — currently 8.0/10. — The repository's root README is stale (Effective June 1, 2021) and documents Phabricator as a no-longer-maintained collection of web apps with an Apache 2.0 license, but the remaining READMEs are for specific directories: JsShrink (PHP/JS minifier), GitHub Octicons (scalable icon set handcrafted by GitHub), Porter stemmer (Richard Heyes), FIGlet project home page and download info, and D3 (data-driven documents). All four non-root READMEs document their own directories rather than the repository as a whole, so each is judged against its own directory. The root README lacks an overview of what Phabricator does or what it is for; it only states that Phabricator is no longer actively maintained and lists license info.

Detailed fixes: d19_recommendation.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d26_recommendation.md.

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

0 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D29 · Static Analysis (SAST)5.4 / 10Adequate✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

36 finding(s): 0 critical, 0 high, 3 medium, 33 low. semgrep hit a parse error in 3 file(s) — `externals/figlet/figlet.c`, `externals/figlet/inflate.c` (line 702, lines 749–760, lines 761–765, …), `externals/stripe-php/lib/Stripe/ApiRequestor.php` (line 357) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness9.1 / 10Exemplary✓ Tool-verified

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

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

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

143 of 1776 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php. Counted over 1776 of the 5927 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×143src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

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

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

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

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

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition8.3 / 10Strong✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

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

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

M1 · Documentation (README)2.5 / 10Weak✓ Tool-verified

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

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

  • The root README is 33 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers.
  • 82 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.

What to do

  • Expand the README with getting-started, architecture overview and a project map.
  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Review the README against recent changes; refresh the parts that drifted.
M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

What to do

  • Record 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.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy9.5 / 10Exemplary◐ Sampled · advisory

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

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

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

What to do

  • Reconcile the README with reality: externals/octicons/README.md links to `./CHANGELOG.md`, but `externals/octicons/CHANGELOG.md` does not exist.
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

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

What to do

  • Add a CI workflow that builds and runs the test suite on every push/PR.
P2 · Observability5.5 / 10Adequate✓ Tool-verified

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

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

  • Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Consider OpenTelemetry tracing/metrics (opentelemetry-php) and a health-check endpoint (Laravel's /up health route or a /health route) for operability.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add phpstan or psalm (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Run what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

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

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

  • `https.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — support/aphlict/server/lib/AphlictPeer.js:46
  • `http.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — support/aphlict/server/lib/AphlictPeer.js:48

What to do

  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
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 · 183 plain JS — the untyped files are support/aphlict/server/aphlict_server.js, support/aphlict/server/lib/AphlictAdminServer.js, support/aphlict/server/lib/AphlictClientServer.js, support/aphlict/server/lib/AphlictListener.js, support/aphlict/server/lib/AphlictListenerList.js, support/aphlict/server/lib/AphlictLog.js (+177 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication9.2 / 10Exemplary✓ Tool-verified

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

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

  • 23 duplicated blocks under webroot/rsrc/js/ have copies in at least two of the sibling directories application, core, phui, phuix — 14 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 23 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 23 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 23 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — webroot/rsrc/js/application/diff/DiffPathView.js:189
  • 5 duplicated blocks under webroot/rsrc/js/application/ have copies in at least two of the sibling directories conpherence, diff, files, owners, pholio, projects — 2 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:810
  • webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:10 · webroot/rsrc/js/application/search/behavior-reorder-queries.js:10 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:10
  • webroot/rsrc/js/application/herald/HeraldRuleEditor.js:179 · webroot/rsrc/js/application/herald/HeraldRuleEditor.js:258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webroot/rsrc/js/application/herald/HeraldRuleEditor.js:179
  • support/aphlict/server/lib/AphlictAdminServer.js:41 · support/aphlict/server/lib/AphlictClientServer.js:46 — 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. — support/aphlict/server/lib/AphlictAdminServer.js:41
  • webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:252 · webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:274 — 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. — webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:252
  • webroot/rsrc/js/application/diff/DiffChangesetList.js:418 · webroot/rsrc/js/application/diff/DiffChangesetList.js:470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webroot/rsrc/js/application/diff/DiffChangesetList.js:418
  • webroot/rsrc/js/application/transactions/behavior-reorder-configs.js:10 · webroot/rsrc/js/application/transactions/behavior-reorder-fields.js:10 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — webroot/rsrc/js/application/transactions/behavior-reorder-configs.js:10
  • webroot/rsrc/js/core/behavior-lightbox-attachments.js:212 · webroot/rsrc/js/core/behavior-lightbox-attachments.js: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. — webroot/rsrc/js/core/behavior-lightbox-attachments.js:212
  • webroot/rsrc/js/application/diff/DiffChangesetList.js:2819 · webroot/rsrc/js/core/behavior-oncopy.js:158 — 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:2819
  • webroot/rsrc/js/application/repository/repository-crossreference.js:59 · webroot/rsrc/js/application/repository/repository-crossreference.js:328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webroot/rsrc/js/application/repository/repository-crossreference.js:59
  • webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:810 · webroot/rsrc/js/application/projects/behavior-project-boards.js:37 — the two spans are one implementation copied and then locally edited — 67 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:810
  • webroot/rsrc/js/application/projects/WorkboardController.js:153 · webroot/rsrc/js/application/projects/WorkboardController.js:178 — the two spans are one implementation copied and then locally edited — 81 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. — webroot/rsrc/js/application/projects/WorkboardController.js:153
  • webroot/rsrc/js/application/diff/DiffPathView.js:191 · webroot/rsrc/js/application/fact/Chart.js:228 · webroot/rsrc/js/phuix/PHUIXActionView.js:180 · webroot/rsrc/js/phuix/PHUIXButtonView.js:87 · +2 more site(s) not listed — the 6 copies are spread across 5 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. — webroot/rsrc/js/application/diff/DiffPathView.js:191
  • webroot/rsrc/js/application/policy/behavior-policy-control.js:45 · webroot/rsrc/js/application/policy/behavior-policy-control.js:61 — 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. — webroot/rsrc/js/application/policy/behavior-policy-control.js:45
  • webroot/rsrc/js/application/projects/behavior-project-boards.js:22 · webroot/rsrc/js/phui/behavior-phui-dropdown-menu.js:9 — the two spans are one implementation copied and then locally edited — 91 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — webroot/rsrc/js/application/projects/behavior-project-boards.js:22
  • webroot/rsrc/js/application/diff/DiffChangesetList.js:2066 · webroot/rsrc/js/application/diff/DiffChangesetList.js:2083 · webroot/rsrc/js/application/diff/DiffChangesetList.js:2100 — 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. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `install(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything. — webroot/rsrc/js/application/diff/DiffChangesetList.js:2066
  • webroot/rsrc/js/application/diff/DiffPathView.js:194 · webroot/rsrc/js/application/trigger/TriggerRule.js:119 · webroot/rsrc/js/core/HovercardList.js:92 · webroot/rsrc/js/phuix/PHUIXActionView.js:183 · +3 more site(s) not listed — the 7 copies are spread across 6 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. — webroot/rsrc/js/application/diff/DiffPathView.js:194
  • webroot/rsrc/js/core/DragAndDropFileUpload.js:237 · webroot/rsrc/js/core/DragAndDropFileUpload.js:368 — 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. — webroot/rsrc/js/core/DragAndDropFileUpload.js:237
  • webroot/rsrc/js/application/projects/WorkboardController.js:103 · webroot/rsrc/js/phuix/PHUIXFormationColumnView.js:46 — the two spans are one implementation copied and then locally edited — 72 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — webroot/rsrc/js/application/projects/WorkboardController.js:103
  • webroot/rsrc/js/phuix/PHUIXButtonView.js:33 · webroot/rsrc/js/phuix/PHUIXIconView.js:21 — the two spans are one implementation copied and then locally edited — 68 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — webroot/rsrc/js/phuix/PHUIXButtonView.js:33
  • webroot/rsrc/js/application/diff/DiffChangeset.js:1035 · webroot/rsrc/js/application/diff/DiffInline.js:745 — 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. — webroot/rsrc/js/application/diff/DiffChangeset.js:1035
  • webroot/rsrc/js/application/diff/DiffInline.js:1115 · webroot/rsrc/js/application/files/behavior-document-engine.js:12 — the two spans are one implementation copied and then locally edited — 58 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — webroot/rsrc/js/application/diff/DiffInline.js:1115
  • webroot/rsrc/js/application/drydock/drydock-live-operation-status.js:9 · webroot/rsrc/js/phui/behavior-phui-timer-control.js:8 — the two spans are one implementation copied and then locally edited — 52 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — webroot/rsrc/js/application/drydock/drydock-live-operation-status.js:9
  • webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:172 · webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:172
  • webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:359 · webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:359
  • webroot/rsrc/js/application/diff/DiffChangeset.js:866 · webroot/rsrc/js/application/diff/DiffChangesetList.js:1986 · webroot/rsrc/js/application/diff/DiffChangesetList.js:2020 — the 3 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. — webroot/rsrc/js/application/diff/DiffChangeset.js:866
  • webroot/rsrc/js/application/diff/DiffChangesetList.js:467 · webroot/rsrc/js/application/diff/DiffChangesetList.js:611 — 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:467
  • webroot/rsrc/js/application/herald/HeraldRuleEditor.js:373 · webroot/rsrc/js/phuix/PHUIXFormControl.js:350 — the two spans are one implementation copied and then locally edited — 85 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — webroot/rsrc/js/application/herald/HeraldRuleEditor.js:373
  • webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:117 · webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:197 · webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:246 — the 3 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. — webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:117
  • webroot/rsrc/js/application/projects/behavior-reorder-columns.js:10 · webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:10 · webroot/rsrc/js/application/search/behavior-reorder-queries.js:10 · webroot/rsrc/js/core/behavior-reorder-applications.js:10 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webroot/rsrc/js/application/projects/behavior-reorder-columns.js:10
  • webroot/rsrc/js/core/behavior-refresh-csrf.js:121 · webroot/rsrc/js/core/behavior-refresh-csrf.js:137 — the two spans are one implementation copied and then locally edited — 54 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. — webroot/rsrc/js/core/behavior-refresh-csrf.js:121
  • webroot/rsrc/js/application/config/behavior-reorder-fields.js:40 · webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:19 · webroot/rsrc/js/application/search/behavior-reorder-queries.js:19 · webroot/rsrc/js/core/behavior-reorder-applications.js:19 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webroot/rsrc/js/application/config/behavior-reorder-fields.js:40
  • webroot/rsrc/js/application/diff/DiffChangesetList.js:337 · webroot/rsrc/js/application/diff/DiffChangesetList.js:418 · webroot/rsrc/js/application/diff/DiffChangesetList.js:470 · webroot/rsrc/js/application/diff/DiffChangesetList.js:614 — 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:337
  • webroot/rsrc/js/application/transactions/behavior-comment-actions.js:243 · webroot/rsrc/js/application/transactions/behavior-transaction-comment-form.js:33 — 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. — webroot/rsrc/js/application/transactions/behavior-comment-actions.js:243
  • webroot/rsrc/js/application/uiexample/gesture-example.js:67 · webroot/rsrc/js/application/uiexample/gesture-example.js:76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webroot/rsrc/js/application/uiexample/gesture-example.js:67
  • support/aphlict/server/aphlict_server.js:184 · webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:200 · webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:249 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — support/aphlict/server/aphlict_server.js:184
  • webroot/rsrc/js/application/diff/DiffChangesetList.js:1887 · webroot/rsrc/js/application/diff/DiffChangesetList.js:1896 — 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:1887
  • webroot/rsrc/js/application/diffusion/behavior-audit-preview.js:21 · webroot/rsrc/js/core/behavior-remarkup-preview.js:30 — 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. — webroot/rsrc/js/application/diffusion/behavior-audit-preview.js:21
  • webroot/rsrc/js/application/files/behavior-icon-composer.js:25 · webroot/rsrc/js/application/files/behavior-icon-composer.js:33 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webroot/rsrc/js/application/files/behavior-icon-composer.js:25

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity7.4 / 10Strong✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • _update has cyclomatic complexity 30 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. — webroot/rsrc/js/phuix/PHUIXAutocomplete.js:428
  • assist has cyclomatic complexity 29 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188
  • updateCard has cyclomatic complexity 26 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webroot/rsrc/js/application/projects/WorkboardBoard.js:601
  • _onjumpkey has cyclomatic complexity 24 and cognitive complexity 44; 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:650
  • (anonymous) has cyclomatic complexity 23 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. — webroot/rsrc/js/application/diffusion/behavior-commit-graph.js:8
  • redraw has cyclomatic complexity 21 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. — webroot/rsrc/js/application/diff/DiffTreeView.js:87
  • _getFragmentLocation has cyclomatic complexity 19 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:2643
  • getSelectableItems has cyclomatic complexity 18 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. — webroot/rsrc/js/application/diff/DiffChangeset.js:435
  • _getInlinesByType has cyclomatic complexity 17 and cognitive complexity 44; 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:1968
  • _newHoverMap has cyclomatic complexity 16 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:1539
  • seek_anchor has cyclomatic complexity 16 and cognitive complexity 25; 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. — webroot/rsrc/js/core/behavior-watch-anchor.js:34
  • _onresults has cyclomatic complexity 16 and cognitive complexity 24; 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. — webroot/rsrc/js/phuix/PHUIXAutocomplete.js:230
  • getNewValue has cyclomatic complexity 16 and cognitive complexity 22; 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. — webroot/rsrc/js/core/behavior-time-typeahead.js:82
  • _redrawBanner has cyclomatic complexity 15 and cognitive complexity 23; 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. — webroot/rsrc/js/application/diff/DiffChangesetList.js:1817
  • _onmove has cyclomatic complexity 15 and cognitive complexity 23; 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. — webroot/rsrc/js/core/DraggableList.js:486
  • (anonymous) has cyclomatic complexity 15 and cognitive complexity 19; 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. — webroot/rsrc/js/application/projects/behavior-project-boards.js:13
  • openSearch has cyclomatic complexity 15 and cognitive complexity 16; 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. — webroot/rsrc/js/application/repository/repository-crossreference.js:123
  • _redrawFrame has cyclomatic complexity 14 and cognitive complexity 21; 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. — webroot/rsrc/js/application/projects/WorkboardColumn.js:394
  • onstartselect has cyclomatic complexity 14 and cognitive complexity 16; 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. — webroot/rsrc/js/core/behavior-oncopy.js:11

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files8.3 / 10Strong✓ 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.

  • webroot/rsrc/js/application/diff/DiffChangesetList.js has 2282 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/application/diff/DiffChangesetList.js:1
  • webroot/rsrc/js/application/diff/DiffInline.js has 943 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/application/diff/DiffInline.js:1
  • webroot/rsrc/js/application/diff/DiffChangeset.js has 883 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/application/diff/DiffChangeset.js:1
  • webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:1
  • webroot/rsrc/js/core/DraggableList.js has 681 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/core/DraggableList.js:1
  • webroot/rsrc/js/phuix/PHUIXAutocomplete.js has 645 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/phuix/PHUIXAutocomplete.js:1
  • webroot/rsrc/js/application/projects/WorkboardBoard.js has 621 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/application/projects/WorkboardBoard.js:1
  • webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

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

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

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

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

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

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

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

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

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

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

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

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

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.

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

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state5.3 / 10Adequate✓ Tool-verified

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

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

  • `phabricator_read_config_file` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 49, put back at line 61) and the `display_errors` ini setting (changed at line 55, put back at line 62) — 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. — conf/__init_conf__.php:3
  • `parseLocalTime` 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 54, put back at line 59) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — src/infrastructure/time/PhabricatorTime.php:51

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`.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

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

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

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

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

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

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

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

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.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.2 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×36) — resources/sql/autopatches/20190412.dashboard.01.panels.php:37, resources/sql/autopatches/20161005.cal.01.rrules.php:32, resources/sql/autopatches/20161004.cal.01.noepoch.php:110, …
  • `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/aphront/response/AphrontUnhandledExceptionResponse.php:127
  • 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. (×3) — src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:597, src/applications/files/storage/PhabricatorFile.php:430, src/applications/files/transform/PhabricatorFileTransform.php:22

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

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

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

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

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

What to do

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

Reference — by lens

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

LensScoreRatingImpact
Code Health42%Weak — gated by R1, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture93%ExemplaryStrongest area.
Maturity47%Weak — gated by M1, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness17%Critical — gated by D13, P1, P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security27%Weak — gated by D28Capped 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 — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.

  • 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 — 70 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 web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's PHP imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — 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).
  • AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
  • 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 — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no data at rest for these controls to protect.
  • 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.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone_number, …) or stored credential in a Laravel migration, an Eloquent model's $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not included — no .php test runner
  • D12 Dependency Hygiene — Dependency hygiene not measured — no supported dependency manifest was read
  • D14 License Compliance — No dependency manifest found — no declared dependency closure to grade for licences
  • 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.
  • D20 ADR Quality — Repository kind not determined
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. 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
  • 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 (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — 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.
  • D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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 (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • 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 distribution not scored — polyglot repository, one half's tests are uncountable
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • 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
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • 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 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 (183 production file(s)) has no JavaScript/TypeScript test, but it is 4.51% of this repository's production source and the other 95.49% carries 19,066 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
  • R7 Dead Code — Not measured — no application, tooling or test entry point was detected, so no file can be shown to be reachable or unreachable. Declare an entry (package.json main/module/exports, src/index.*, or an index.html script) to enable reachability.
  • 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.

Critical — 20 finding(s)
D28 · Secrets (history) · High secret · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
Serious — 3677 finding(s)
D17 · Explicit Debt · TodoComment · ×513
  • TodoComment scripts/ssh/ssh-auth.php:12 — // TODO: For now, this is using "parseParital()", not "parse()". This allows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/aphront/AphrontRequest.php:376 — // TODO: Clean this up, see T1921. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/aphront/AphrontRequest.php:608 — // TODO: This is effectively a test for whether we're running in a unit — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/aphront/response/AphrontResponse.php:330 — // TODO: Javelin supports implicity conversion of '__html' objects to — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/aphront/response/AphrontHTTPProxyResponse.php:41 — // TODO: AphrontResponse needs to support streaming responses. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/aphront/response/AphrontHTTPProxyResponse.php:51 — // TODO: This should read only the headers. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/aphront/response/AphrontHTTPProxyResponse.php:56 — // TODO: This is grossly inefficient for large requests. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/almanac/editor/AlmanacInterfaceEditEngine.php:143 — // TODO: Some day, this should be a datasource. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/almanac/typeahead/AlmanacServiceDatasource.php:26 — // TODO: When service classes are restricted, it might be nice to customize — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/audit/editor/PhabricatorAuditEditor.php:41 — // TODO: These will get modernized eventually, but that can happen one — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/audit/editor/PhabricatorAuditEditor.php:569 — // TODO: It would be nice to show pusher here too, but that information — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/audit/editor/PhabricatorAuditEditor.php:790 — // TODO: They should, and then we should simplify this. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/audit/view/PhabricatorAuditTransactionView.php:17 — // TODO: This shares a lot of code with Differential and Pholio and should — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/audit/view/PhabricatorAuditTransactionView.php:88 — // TODO: Migrate these away? They probably do not exist on normal — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/adapter/PhutilJIRAAuthAdapter.php:8 — // TODO: JIRA tokens expire (after 5 years) and we could surface and store — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/application/PhabricatorAuthApplication.php:35 — // TODO: Special case this, or split the auth and auth administration — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/controller/PhabricatorAuthRegisterController.php:46 — // TODO: This is a routine error if you click "Login" on an external — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/controller/PhabricatorAuthRegisterController.php:494 — // TODO: See T3340. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/controller/PhabricatorAuthOldOAuthRedirectController.php:20 — // TODO: Most OAuth providers are OK with changing the redirect URI, but — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/controller/PhabricatorAuthFinishController.php:69 — // TODO: It might be nice to add options like "bind this session to my IP" — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php:37 — // TODO: Send the user email about the new account link. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/controller/config/PhabricatorAuthEditController.php:49 — // TODO: When we have multi-auth providers, support them here. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/controller/config/PhabricatorAuthDisableController.php:61 — // TODO: We could tailor this a bit more. In particular, we could — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/engine/PhabricatorAuthSessionEngine.php:59 — // TODO: A workflow key should become required in order to issue an MFA — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/applications/auth/engine/PhabricatorAuthSessionEngine.php:131 — // TODO: Implement these (T4310). — 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.
  • + 488 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×285
  • MethodTooLong: PhabricatorUSEnglishTranslation.getTranslations src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php:10 — MethodTooLong — getTranslations runs 1109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1009 over it, 11.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: PhabricatorAuthRegisterController.handleRequest src/applications/auth/controller/PhabricatorAuthRegisterController.php:10 — MethodTooLong — handleRequest runs 450 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 350 over it, 4.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DifferentialRevisionViewController.handleRequest src/applications/differential/controller/DifferentialRevisionViewController.php:43 — MethodTooLong — handleRequest runs 442 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 342 over it, 4.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PhabricatorManiphestConfigOptions.getOptions src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php:22 — MethodTooLong — getOptions runs 391 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 291 over it, 3.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PhabricatorBuiltinPatchList.getOldPatches src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php:47 — MethodTooLong — getOldPatches runs 387 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 287 over it, 3.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DiffusionCommitController.handleRequest src/applications/diffusion/controller/DiffusionCommitController.php:17 — MethodTooLong — handleRequest runs 367 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 267 over it, 3.67× 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: PHUIObjectItemView.getTagContent src/view/phui/PHUIObjectItemView.php:383 — MethodTooLong — getTagContent runs 343 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 243 over it, 3.43× 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: PhabricatorApplicationTransaction.getTitle src/applications/transactions/storage/PhabricatorApplicationTransaction.php:943 — MethodTooLong — getTitle runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× 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: DiffusionRepositoryEditEngine.buildCustomEditFields src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php:207 — MethodTooLong — buildCustomEditFields runs 305 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 205 over it, 3.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PhabricatorAuthEditController.handleRequest src/applications/auth/controller/config/PhabricatorAuthEditController.php:6 — MethodTooLong — handleRequest runs 302 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 202 over it, 3.02× 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: PhabricatorMySQLSetupCheck.executeRefChecks src/applications/config/check/PhabricatorMySQLSetupCheck.php:22 — MethodTooLong — executeRefChecks runs 300 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× 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: PholioMockEditController.handleRequest src/applications/pholio/controller/PholioMockEditController.php:5 — MethodTooLong — handleRequest runs 292 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× 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: HarbormasterBuildLogRenderController.handleRequest src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:10 — MethodTooLong — handleRequest runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90× 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: PhabricatorExtraConfigSetupCheck.getAncientConfig src/applications/config/check/PhabricatorExtraConfigSetupCheck.php:207 — MethodTooLong — getAncientConfig runs 288 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 188 over it, 2.88× 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: PhrictionDocumentController.handleRequest src/applications/phriction/controller/PhrictionDocumentController.php:13 — MethodTooLong — handleRequest runs 286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 186 over it, 2.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PHUIDiffInlineCommentDetailView.render src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php:78 — MethodTooLong — render runs 286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 186 over it, 2.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PhrictionEditController.handleRequest src/applications/phriction/controller/PhrictionEditController.php:6 — MethodTooLong — handleRequest runs 282 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 182 over it, 2.82× 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: DiffusionRepositoryBasicsManagementPanel.buildRepositoryStatus src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:336 — MethodTooLong — buildRepositoryStatus runs 279 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 179 over it, 2.79× 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: PhabricatorStorageManagementWorkflow.doAdjustSchemata src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:159 — MethodTooLong — doAdjustSchemata runs 275 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× 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: PhabricatorTypeaheadModularDatasourceController.handleRequest src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php:10 — MethodTooLong — handleRequest runs 273 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 173 over it, 2.73× 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: PassphraseCredentialEditController.handleRequest src/applications/passphrase/controller/PassphraseCredentialEditController.php:5 — MethodTooLong — handleRequest runs 269 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 169 over it, 2.69× 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: PhabricatorProjectBoardViewController.handleRequest src/applications/project/controller/PhabricatorProjectBoardViewController.php:10 — MethodTooLong — handleRequest runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PhabricatorMainMenuView.renderNotificationMenu src/view/page/menu/PhabricatorMainMenuView.php:365 — MethodTooLong — renderNotificationMenu runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.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: DifferentialChangesetParser.render src/applications/differential/parser/DifferentialChangesetParser.php:749 — MethodTooLong — render runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PhabricatorMetaMTAConfigOptions.getOptions src/applications/config/option/PhabricatorMetaMTAConfigOptions.php:22 — MethodTooLong — getOptions runs 242 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 142 over it, 2.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 260 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×112
  • TooManyMethods: PhabricatorApplicationTransactionEditor src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:40 — TooManyMethods — 192 methods. The bar is 30 methods; this is 162 over it, 6.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: PhabricatorRepository src/applications/repository/storage/PhabricatorRepository.php:8 — TooManyMethods — 165 methods. The bar is 30 methods; this is 135 over it, 5.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: PhabricatorEditEngine src/applications/transactions/editengine/PhabricatorEditEngine.php:15 — TooManyMethods — 132 methods. The bar is 30 methods; this is 102 over it, 4.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: PhabricatorEditField src/applications/transactions/editfield/PhabricatorEditField.php:3 — TooManyMethods — 118 methods. The bar is 30 methods; this is 88 over it, 3.93× 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: PhabricatorCustomField src/infrastructure/customfield/field/PhabricatorCustomField.php:19 — TooManyMethods — 109 methods. The bar is 30 methods; this is 79 over it, 3.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorMetaMTAMail src/applications/metamta/storage/PhabricatorMetaMTAMail.php:6 — TooManyMethods — 106 methods. The bar is 30 methods; this is 76 over it, 3.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorFile src/applications/files/storage/PhabricatorFile.php:23 — TooManyMethods — 101 methods. The bar is 30 methods; this is 71 over it, 3.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorApplicationTransaction src/applications/transactions/storage/PhabricatorApplicationTransaction.php:3 — TooManyMethods — 101 methods. The bar is 30 methods; this is 71 over it, 3.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorUser src/applications/people/storage/PhabricatorUser.php:11 — TooManyMethods — 98 methods. The bar is 30 methods; this is 68 over it, 3.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: PhabricatorCursorPagedPolicyAwareQuery src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:16 — TooManyMethods — 94 methods. The bar is 30 methods; this is 64 over it, 3.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: PhabricatorCalendarEvent src/applications/calendar/storage/PhabricatorCalendarEvent.php:3 — TooManyMethods — 93 methods. The bar is 30 methods; this is 63 over it, 3.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: DifferentialRevision src/applications/differential/storage/DifferentialRevision.php:3 — TooManyMethods — 93 methods. The bar is 30 methods; this is 63 over it, 3.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: HeraldAdapter src/applications/herald/adapter/HeraldAdapter.php:3 — TooManyMethods — 91 methods. The bar is 30 methods; this is 61 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DifferentialChangesetRenderer src/applications/differential/render/DifferentialChangesetRenderer.php:3 — TooManyMethods — 90 methods. The bar is 30 methods; this is 60 over it, 3.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorApplicationSearchEngine src/applications/search/engine/PhabricatorApplicationSearchEngine.php:17 — TooManyMethods — 89 methods. The bar is 30 methods; this is 59 over it, 2.97× 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: PhabricatorRepositoryCommit src/applications/repository/storage/PhabricatorRepositoryCommit.php:3 — TooManyMethods — 86 methods. The bar is 30 methods; this is 56 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LiskDAO src/infrastructure/storage/lisk/LiskDAO.php:165 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorProject src/applications/project/storage/PhabricatorProject.php:3 — TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorModularTransactionType src/applications/transactions/storage/PhabricatorModularTransactionType.php:3 — TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorInlineComment src/infrastructure/diff/interface/PhabricatorInlineComment.php:3 — TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DifferentialChangesetParser src/applications/differential/parser/DifferentialChangesetParser.php:3 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DifferentialChangeset src/applications/differential/storage/DifferentialChangeset.php:3 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhutilCalendarRecurrenceRule src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:3 — 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: PhabricatorDatabaseRef src/infrastructure/cluster/PhabricatorDatabaseRef.php:3 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PhabricatorStandardCustomField src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php:3 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 87 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×99
  • Low cohesion: DifferentialChangesetRenderer (LCOM4 25) src/applications/differential/render/DifferentialChangesetRenderer.php:3 — DifferentialChangesetRenderer's methods fall into 25 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 25 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: PhabricatorUser (LCOM4 23) src/applications/people/storage/PhabricatorUser.php:11 — PhabricatorUser's methods fall into 23 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 23 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: HeraldAdapter (LCOM4 17) src/applications/herald/adapter/HeraldAdapter.php:3 — HeraldAdapter's methods fall into 17 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 17 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: DifferentialTransactionEditor (LCOM4 16) src/applications/differential/editor/DifferentialTransactionEditor.php:3 — DifferentialTransactionEditor's methods fall into 16 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 16 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: PhabricatorSetupIssue (LCOM4 15) src/applications/config/issue/PhabricatorSetupIssue.php:3 — PhabricatorSetupIssue's methods fall into 15 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 15 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: DifferentialChangeset (LCOM4 15) src/applications/differential/storage/DifferentialChangeset.php:3 — DifferentialChangeset's methods fall into 15 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 15 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: PhabricatorRepository (LCOM4 15) src/applications/repository/storage/PhabricatorRepository.php:8 — PhabricatorRepository's methods fall into 15 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 15 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: PhabricatorDatabaseRef (LCOM4 14) src/infrastructure/cluster/PhabricatorDatabaseRef.php:3 — PhabricatorDatabaseRef's methods fall into 14 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 14 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: AphrontCalendarEventView (LCOM4 13) src/applications/calendar/view/AphrontCalendarEventView.php:3 — AphrontCalendarEventView's methods fall into 13 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 13 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: HeraldRule (LCOM4 13) src/applications/herald/storage/HeraldRule.php:3 — HeraldRule's methods fall into 13 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 13 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: ManiphestTransactionEditor (LCOM4 13) src/applications/maniphest/editor/ManiphestTransactionEditor.php:3 — ManiphestTransactionEditor's methods fall into 13 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 13 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: PhabricatorAuthSessionEngine (LCOM4 12) src/applications/auth/engine/PhabricatorAuthSessionEngine.php:12 — PhabricatorAuthSessionEngine's methods fall into 12 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 12 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: PhutilCalendarEventNode (LCOM4 12) src/applications/calendar/parser/data/PhutilCalendarEventNode.php:3 — PhutilCalendarEventNode's methods fall into 12 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 12 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: HarbormasterBuildTarget (LCOM4 12) src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php:3 — HarbormasterBuildTarget's methods fall into 12 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 12 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: PhabricatorEditField (LCOM4 12) src/applications/transactions/editfield/PhabricatorEditField.php:3 — PhabricatorEditField's methods fall into 12 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 12 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: PhabricatorConfigOption (LCOM4 11) src/applications/config/option/PhabricatorConfigOption.php:3 — PhabricatorConfigOption's methods fall into 11 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 11 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: ManiphestTaskSearchEngine (LCOM4 11) src/applications/maniphest/query/ManiphestTaskSearchEngine.php:3 — ManiphestTaskSearchEngine's methods fall into 11 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 11 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: PhameBlog (LCOM4 11) src/applications/phame/storage/PhameBlog.php:3 — PhameBlog's methods fall into 11 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 11 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: DivinerLiveSymbol (LCOM4 10) src/applications/diviner/storage/DivinerLiveSymbol.php:3 — DivinerLiveSymbol'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: PhabricatorApplicationTransaction (LCOM4 10) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:3 — PhabricatorApplicationTransaction'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: DifferentialDiff (LCOM4 9) src/applications/differential/storage/DifferentialDiff.php:3 — DifferentialDiff'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: LegalpadDocument (LCOM4 9) src/applications/legalpad/storage/LegalpadDocument.php:3 — LegalpadDocument'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: PhabricatorTypeaheadDatasource (LCOM4 9) src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php:6 — PhabricatorTypeaheadDatasource'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: PhabricatorCacheSpec (LCOM4 8) src/applications/cache/spec/PhabricatorCacheSpec.php:3 — PhabricatorCacheSpec'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: DifferentialReviewer (LCOM4 8) src/applications/differential/storage/DifferentialReviewer.php:3 — DifferentialReviewer'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.
  • + 74 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×98
  • ClassTooLong: PhabricatorApplicationTransactionEditor src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:40 — ClassTooLong — 3239 significant lines (blank, comment-only and punctuation-only lines excluded), 192 methods. The bar is 400 significant lines; this is 2839 over it, 8.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorCursorPagedPolicyAwareQuery src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:16 — ClassTooLong — 1852 significant lines (blank, comment-only and punctuation-only lines excluded), 94 methods. The bar is 400 significant lines; this is 1452 over it, 4.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorRepository src/applications/repository/storage/PhabricatorRepository.php:8 — ClassTooLong — 1657 significant lines (blank, comment-only and punctuation-only lines excluded), 165 methods. The bar is 400 significant lines; this is 1257 over it, 4.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorEditEngine src/applications/transactions/editengine/PhabricatorEditEngine.php:15 — ClassTooLong — 1565 significant lines (blank, comment-only and punctuation-only lines excluded), 132 methods. The bar is 400 significant lines; this is 1165 over it, 3.91× 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: PhabricatorApplicationTransaction src/applications/transactions/storage/PhabricatorApplicationTransaction.php:3 — ClassTooLong — 1373 significant lines (blank, comment-only and punctuation-only lines excluded), 101 methods. The bar is 400 significant lines; this is 973 over it, 3.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhutilCalendarRecurrenceRule src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:3 — ClassTooLong — 1188 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 788 over it, 2.97× 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: DifferentialChangesetParser src/applications/differential/parser/DifferentialChangesetParser.php:3 — ClassTooLong — 1153 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 400 significant lines; this is 753 over it, 2.88× 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: PhabricatorUSEnglishTranslation src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php:3 — ClassTooLong — 1113 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 713 over it, 2.78× 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: PhabricatorFile src/applications/files/storage/PhabricatorFile.php:23 — ClassTooLong — 1022 significant lines (blank, comment-only and punctuation-only lines excluded), 101 methods. The bar is 400 significant lines; this is 622 over it, 2.56× 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: DifferentialTransactionEditor src/applications/differential/editor/DifferentialTransactionEditor.php:3 — ClassTooLong — 1014 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 400 significant lines; this is 614 over it, 2.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DifferentialRevisionViewController src/applications/differential/controller/DifferentialRevisionViewController.php:3 — ClassTooLong — 993 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 593 over it, 2.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorProfileMenuEngine src/applications/search/engine/PhabricatorProfileMenuEngine.php:3 — ClassTooLong — 888 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 488 over it, 2.22× 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: PhabricatorApplicationSearchEngine src/applications/search/engine/PhabricatorApplicationSearchEngine.php:17 — ClassTooLong — 865 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 400 significant lines; this is 465 over it, 2.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: DiffusionCommitHookEngine src/applications/diffusion/engine/DiffusionCommitHookEngine.php:11 — ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 453 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorCalendarEvent src/applications/calendar/storage/PhabricatorCalendarEvent.php:3 — ClassTooLong — 852 significant lines (blank, comment-only and punctuation-only lines excluded), 93 methods. The bar is 400 significant lines; this is 452 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorStorageManagementWorkflow src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:3 — ClassTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 437 over it, 2.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DiffusionServeController src/applications/diffusion/controller/DiffusionServeController.php:3 — ClassTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 411 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DiffusionCommitController src/applications/diffusion/controller/DiffusionCommitController.php:3 — ClassTooLong — 806 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 406 over it, 2.02× 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: HeraldAdapter src/applications/herald/adapter/HeraldAdapter.php:3 — ClassTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded), 91 methods. The bar is 400 significant lines; this is 354 over it, 1.89× 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: PhabricatorProjectBoardViewController src/applications/project/controller/PhabricatorProjectBoardViewController.php:3 — ClassTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 347 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DiffusionBrowseController src/applications/diffusion/controller/DiffusionBrowseController.php:3 — ClassTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 335 over it, 1.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorApplicationSearchController src/applications/search/controller/PhabricatorApplicationSearchController.php:3 — ClassTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 332 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PhabricatorUser src/applications/people/storage/PhabricatorUser.php:11 — ClassTooLong — 716 significant lines (blank, comment-only and punctuation-only lines excluded), 98 methods. The bar is 400 significant lines; this is 316 over it, 1.79× 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: ManiphestTaskQuery src/applications/maniphest/query/ManiphestTaskQuery.php:7 — ClassTooLong — 693 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 293 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.
  • ClassTooLong: PhabricatorCustomField src/infrastructure/customfield/field/PhabricatorCustomField.php:19 — ClassTooLong — 688 significant lines (blank, comment-only and punctuation-only lines excluded), 109 methods. The bar is 400 significant lines; this is 288 over it, 1.72× 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.
  • + 73 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×63
  • FileTooLong: editor/PhabricatorApplicationTransactionEditor.php src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php — FileTooLong — 3240 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorApplicationTransactionEditor (40-5747). The bar is 500 significant lines; this is 2740 over it, 6.48× 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: policy/PhabricatorCursorPagedPolicyAwareQuery.php src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php — FileTooLong — 1853 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorCursorPagedPolicyAwareQuery (16-3283). The bar is 500 significant lines; this is 1353 over it, 3.71× 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: diff/DiffChangesetList.js webroot/rsrc/js/application/diff/DiffChangesetList.js — FileTooLong — 1689 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 189 over it, 1.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: storage/PhabricatorRepository.php src/applications/repository/storage/PhabricatorRepository.php — FileTooLong — 1658 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorRepository (8-2886). The bar is 500 significant lines; this is 1158 over it, 3.32× 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: editengine/PhabricatorEditEngine.php src/applications/transactions/editengine/PhabricatorEditEngine.php — FileTooLong — 1566 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorEditEngine (15-2753). The bar is 500 significant lines; this is 1066 over it, 3.13× 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: storage/PhabricatorApplicationTransaction.php src/applications/transactions/storage/PhabricatorApplicationTransaction.php — FileTooLong — 1374 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorApplicationTransaction (3-2036). The bar is 500 significant lines; this is 874 over it, 2.75× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: data/PhutilCalendarRecurrenceRule.php src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php — FileTooLong — 1189 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhutilCalendarRecurrenceRule (3-1820). The bar is 500 significant lines; this is 689 over it, 2.38× 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: parser/DifferentialChangesetParser.php src/applications/differential/parser/DifferentialChangesetParser.php — FileTooLong — 1154 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DifferentialChangesetParser (3-1975). The bar is 500 significant lines; this is 654 over it, 2.31× 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: translation/PhabricatorUSEnglishTranslation.php src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php — FileTooLong — 1114 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorUSEnglishTranslation (3-1816). The bar is 500 significant lines; this is 614 over it, 2.23× 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: storage/PhabricatorFile.php src/applications/files/storage/PhabricatorFile.php — FileTooLong — 1023 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorFile (23-1764). The bar is 500 significant lines; this is 523 over it, 2.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: editor/DifferentialTransactionEditor.php src/applications/differential/editor/DifferentialTransactionEditor.php — FileTooLong — 1015 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DifferentialTransactionEditor (3-1690). The bar is 500 significant lines; this is 515 over it, 2.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: controller/DifferentialRevisionViewController.php src/applications/differential/controller/DifferentialRevisionViewController.php — FileTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DifferentialRevisionViewController (3-1454). The bar is 500 significant lines; this is 494 over it, 1.99× 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: engine/PhabricatorProfileMenuEngine.php src/applications/search/engine/PhabricatorProfileMenuEngine.php — FileTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorProfileMenuEngine (3-1361). The bar is 500 significant lines; this is 389 over it, 1.78× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: engine/PhabricatorApplicationSearchEngine.php src/applications/search/engine/PhabricatorApplicationSearchEngine.php — FileTooLong — 866 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorApplicationSearchEngine (17-1636). The bar is 500 significant lines; this is 366 over it, 1.73× 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: engine/DiffusionCommitHookEngine.php src/applications/diffusion/engine/DiffusionCommitHookEngine.php — FileTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DiffusionCommitHookEngine (11-1473). The bar is 500 significant lines; this is 354 over it, 1.71× 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: storage/PhabricatorCalendarEvent.php src/applications/calendar/storage/PhabricatorCalendarEvent.php — FileTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorCalendarEvent (3-1446). The bar is 500 significant lines; this is 353 over it, 1.71× 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: workflow/PhabricatorStorageManagementWorkflow.php src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php — FileTooLong — 838 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorStorageManagementWorkflow (3-1289). The bar is 500 significant lines; this is 338 over it, 1.68× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: controller/DiffusionServeController.php src/applications/diffusion/controller/DiffusionServeController.php — FileTooLong — 812 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DiffusionServeController (3-1330). The bar is 500 significant lines; this is 312 over it, 1.62× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: controller/DiffusionCommitController.php src/applications/diffusion/controller/DiffusionCommitController.php — FileTooLong — 807 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DiffusionCommitController (3-1172). The bar is 500 significant lines; this is 307 over it, 1.61× 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: adapter/HeraldAdapter.php src/applications/herald/adapter/HeraldAdapter.php — FileTooLong — 755 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: HeraldAdapter (3-1224). The bar is 500 significant lines; this is 255 over it, 1.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: controller/PhabricatorProjectBoardViewController.php src/applications/project/controller/PhabricatorProjectBoardViewController.php — FileTooLong — 748 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorProjectBoardViewController (3-1040). The bar is 500 significant lines; this is 248 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: controller/DiffusionBrowseController.php src/applications/diffusion/controller/DiffusionBrowseController.php — FileTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: DiffusionBrowseController (3-1054). The bar is 500 significant lines; this is 236 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: controller/PhabricatorApplicationSearchController.php src/applications/search/controller/PhabricatorApplicationSearchController.php — FileTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorApplicationSearchController (3-1101). 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: storage/PhabricatorUser.php src/applications/people/storage/PhabricatorUser.php — FileTooLong — 717 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PhabricatorUser (11-1463). The bar is 500 significant lines; this is 217 over it, 1.43× 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: query/ManiphestTaskQuery.php src/applications/maniphest/query/ManiphestTaskQuery.php — FileTooLong — 694 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ManiphestTaskQuery (7-1054). The bar is 500 significant lines; this is 194 over it, 1.39× 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.
  • + 38 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×49
  • Duplicated block (11 lines × 2) src/applications/almanac/controller/AlmanacBindingEditController.php:78 — src/applications/almanac/controller/AlmanacBindingEditController.php:78-88 | src/applications/phortune/controller/merchant/PhortuneMerchantAddManagerController.php:41-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/controller/AlmanacBindingEditController.php:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/almanac/controller/AlmanacBindingEditController.php:77` calls `getURI` and `src/applications/phortune/controller/merchant/PhortuneMerchantAddManagerController.php:39` 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 × 2) src/applications/almanac/controller/AlmanacDeviceViewController.php:16 — src/applications/almanac/controller/AlmanacDeviceViewController.php:16-26 | src/applications/almanac/controller/AlmanacServiceViewController.php:16-26 — before extracting anything, compare `src/applications/almanac/controller/AlmanacDeviceViewController.php` and `src/applications/almanac/controller/AlmanacServiceViewController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `src/applications/almanac/controller/AlmanacServiceViewController.php:27` calls `buildPropertySection` and `src/applications/almanac/controller/AlmanacDeviceViewController.php:28` 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 × 2) src/applications/aphlict/management/PhabricatorAphlictManagementNotifyWorkflow.php:59 — src/applications/aphlict/management/PhabricatorAphlictManagementNotifyWorkflow.php:59-69 | src/applications/notification/controller/PhabricatorNotificationTestController.php:20-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/aphlict/management/PhabricatorAphlictManagementNotifyWorkflow.php:57` calls `newContentSource` and `src/applications/notification/controller/PhabricatorNotificationTestController.php:18` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:81 — src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:81-91 | src/applications/auth/controller/PhabricatorAuthSSHKeyGenerateController.php:54-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php:91 — src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php:91-101 | src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:143-153 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) src/applications/auth/engine/PhabricatorAuthInviteEngine.php:133 — src/applications/auth/engine/PhabricatorAuthInviteEngine.php:133-143 | src/applications/auth/engine/PhabricatorAuthInviteEngine.php:149-159 — both copies are in the same file, so extract the 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) src/applications/auth/query/PhabricatorAuthInviteQuery.php:39 — src/applications/auth/query/PhabricatorAuthInviteQuery.php:39-49 | src/applications/diffusion/query/DiffusionSymbolQuery.php:152-162 — 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) src/applications/badges/controller/PhabricatorBadgesAwardController.php:38 — src/applications/badges/controller/PhabricatorBadgesAwardController.php:38-48 | src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php:36-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) src/applications/badges/controller/PhabricatorBadgesProfileController.php:59 — src/applications/badges/controller/PhabricatorBadgesProfileController.php:59-69 | src/applications/phortune/controller/merchant/PhortuneMerchantProfileController.php:34-44 — 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) src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php:37 — src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php:37-47 | src/applications/badges/xaction/PhabricatorBadgesBadgeRevokeTransaction.php:40-50 — 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 (11 lines × 2) src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:592 — src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:592-602 | src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:607-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:592` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:606` calls `getDataType` and `src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:591` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/applications/differential/controller/DifferentialRevisionViewController.php:702 — src/applications/differential/controller/DifferentialRevisionViewController.php:702-712 | src/applications/macro/controller/PhabricatorMacroViewController.php:127-137 — 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) src/applications/differential/customfield/DifferentialLintField.php:89 — src/applications/differential/customfield/DifferentialLintField.php:89-99 | src/applications/differential/customfield/DifferentialUnitField.php:78-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:109 — src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:109-119 | src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:253-263 — both copies are in the same file, so extract the 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) src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:177 — src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:177-187 | src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:216-226 — both copies are in the same file, so extract the 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) src/applications/differential/query/DifferentialRevisionSearchEngine.php:361 — src/applications/differential/query/DifferentialRevisionSearchEngine.php:361-371 | src/applications/maniphest/query/ManiphestTaskSearchEngine.php:531-541 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/query/DifferentialRevisionSearchEngine.php:361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/maniphest/query/ManiphestTaskSearchEngine.php:528` calls `getOwnerPHID`, `getCloserPHID` and `src/applications/differential/query/DifferentialRevisionSearchEngine.php:359` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:42 — src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:42-52 | src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php:43-53 — before extracting anything, compare `src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php` and `src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.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. 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) src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:30 — src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:30-40 | src/applications/diffusion/controller/DiffusionRepositoryEditPublishingController.php:30-40 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php` and `src/applications/diffusion/controller/DiffusionRepositoryEditPublishingController.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 `src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.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 (11 lines × 2) src/applications/diffusion/editor/DiffusionURIEditor.php:299 — src/applications/diffusion/editor/DiffusionURIEditor.php:299-309 | src/applications/diffusion/editor/DiffusionURIEditor.php:412-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/editor/DiffusionURIEditor.php:299` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:21 — src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:21-31 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php:21-31 — before extracting anything, compare `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/applications/fact/controller/PhabricatorFactObjectController.php:125 — src/applications/fact/controller/PhabricatorFactObjectController.php:125-135 | src/applications/owners/controller/PhabricatorOwnersPathsController.php:95-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) src/applications/files/controller/PhabricatorFileUICurtainListController.php:41 — src/applications/files/controller/PhabricatorFileUICurtainListController.php:41-51 | src/applications/subscriptions/view/SubscriptionListDialogBuilder.php:66-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/files/controller/PhabricatorFileUICurtainListController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/files/controller/PhabricatorFileUICurtainListController.php:38` calls `getFilePHID` and `src/applications/subscriptions/view/SubscriptionListDialogBuilder.php:65` 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) src/applications/files/controller/PhabricatorFileViewController.php:185 — src/applications/files/controller/PhabricatorFileViewController.php:185-195 | src/applications/maniphest/controller/ManiphestTaskDetailController.php:358-368 — 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) src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php:320 — src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php:320-330 | src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php:402-412 — both copies are in the same file, so extract the 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 (11 lines × 2) src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:11 — src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:11-21 | src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php:11-21 — 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.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×42
  • Duplicated block (14 lines × 2) src/applications/almanac/query/AlmanacBindingQuery.php:53 — src/applications/almanac/query/AlmanacBindingQuery.php:53-66 | src/applications/almanac/query/AlmanacInterfaceQuery.php:46-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.
  • Duplicated block (14 lines × 2) src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:275 — src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:275-288 | src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:315-328 — both copies are in the same file, so extract the 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 (14 lines × 2) src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php:32 — src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php:32-45 | src/applications/auth/controller/PhabricatorAuthTerminateSessionController.php:36-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/PhabricatorAuthRevokeTokenController.php:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/applications/auth/controller/config/PhabricatorAuthDisableController.php:12 — src/applications/auth/controller/config/PhabricatorAuthDisableController.php:12-25 | src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:11-24 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/auth/controller/config/PhabricatorAuthDisableController.php:12` calls `getURIData` and `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:11` 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 (14 lines × 2) src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.php:11 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.php:11-24 | src/applications/drydock/controller/DrydockBlueprintDisableController.php:11-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) REDACTED:111 — REDACTED:111-124 | src/applications/auth/provider/PhabricatorPasswordAuthProvider.php:227-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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 (14 lines × 2) src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php:34 — src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php:34-47 | src/applications/project/controller/PhabricatorProjectMembersRemoveController.php:53-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:10 — src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:10-23 | src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:10-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:53 — src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:53-66 | src/applications/calendar/controller/PhabricatorCalendarImportViewController.php:61-74 — before extracting anything, compare `src/applications/calendar/controller/PhabricatorCalendarExportViewController.php` and `src/applications/calendar/controller/PhabricatorCalendarImportViewController.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. If that is what happened, the fix is to keep one copy and have the 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) src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php:128 — src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php:128-141 | src/applications/maniphest/xaction/ManiphestTaskAttachTransaction.php:33-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) src/applications/calendar/xaction/PhabricatorCalendarImportICSFileTransaction.php:38 — src/applications/calendar/xaction/PhabricatorCalendarImportICSFileTransaction.php:38-51 | src/applications/calendar/xaction/PhabricatorCalendarImportICSURITransaction.php:30-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php:27 — src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php:27-40 | src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php:21-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:17 — src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:17-30 | src/applications/phortune/xaction/PhortuneAccountNameTransaction.php:17-30 — 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 (14 lines × 2) src/applications/countdown/editor/PhabricatorCountdownEditor.php:55 — src/applications/countdown/editor/PhabricatorCountdownEditor.php:55-68 | src/applications/slowvote/editor/PhabricatorSlowvoteEditor.php:58-71 — 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 lines × 2) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelViewController.php:111 — src/applications/dashboard/controller/panel/PhabricatorDashboardPanelViewController.php:111-124 | src/applications/project/controller/PhabricatorProjectMembersViewController.php:159-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelViewController.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 (14 lines × 2) src/applications/differential/controller/DifferentialChangesetViewController.php:310 — src/applications/differential/controller/DifferentialChangesetViewController.php:310-323 | src/applications/ponder/controller/PonderAnswerHistoryController.php:34-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 × 2) src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php:32 — src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php:32-45 | src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php:38-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:267 — src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:267-280 | src/applications/diffusion/controller/DiffusionRepositoryURIViewController.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.
  • Duplicated block (14 lines × 2) src/applications/diffusion/herald/DiffusionCommitAuthorProjectsHeraldField.php:13 — src/applications/diffusion/herald/DiffusionCommitAuthorProjectsHeraldField.php:13-26 | src/applications/diffusion/herald/DiffusionPreCommitContentAuthorProjectsHeraldField.php:13-26 — 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 (14 lines × 2) src/applications/diffusion/herald/DiffusionCommitCommitterProjectsHeraldField.php:13 — src/applications/diffusion/herald/DiffusionCommitCommitterProjectsHeraldField.php:13-26 | src/applications/diffusion/herald/DiffusionPreCommitContentCommitterProjectsHeraldField.php:13-26 — 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 (14 lines × 2) src/applications/diffusion/herald/DiffusionCommitRevisionAcceptingReviewersHeraldField.php:19 — src/applications/diffusion/herald/DiffusionCommitRevisionAcceptingReviewersHeraldField.php:19-32 | src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptingReviewersHeraldField.php:19-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. 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 × 2) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:549 — src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:549-562 | src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:580-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:549` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14 lines × 2) src/applications/drydock/query/DrydockAuthorizationQuery.php:98 — src/applications/drydock/query/DrydockAuthorizationQuery.php:98-111 | src/applications/drydock/query/DrydockRepositoryOperationQuery.php:103-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/query/DrydockAuthorizationQuery.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 (14 lines × 2) src/applications/harbormaster/query/HarbormasterBuildQuery.php:64 — src/applications/harbormaster/query/HarbormasterBuildQuery.php:64-77 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:71-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/query/HarbormasterBuildQuery.php:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/applications/herald/controller/HeraldWebhookKeyController.php:7 — src/applications/herald/controller/HeraldWebhookKeyController.php:7-20 | src/applications/herald/controller/HeraldWebhookTestController.php:7-20 — 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.
  • + 17 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×40
  • Duplicated block (9 lines × 2) src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:274 — src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:274-282 | src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:433-441 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:274` it does not close everything it opens, so those exact lines 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) src/applications/audit/query/PhabricatorCommitSearchEngine.php:169 — src/applications/audit/query/PhabricatorCommitSearchEngine.php:169-177 | src/applications/maniphest/query/ManiphestTaskSearchEngine.php:292-300 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/maniphest/query/ManiphestTaskSearchEngine.php:300` calls `pht` and `src/applications/audit/query/PhabricatorCommitSearchEngine.php:177` 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 (9 lines × 2) src/applications/auth/controller/PhabricatorAuthSetPasswordController.php:108 — src/applications/auth/controller/PhabricatorAuthSetPasswordController.php:108-116 | src/applications/herald/controller/HeraldDisableController.php:46-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:76 — src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:76-84 | src/applications/passphrase/controller/PassphraseCredentialViewController.php:124-132 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) src/applications/auth/engine/PhabricatorAuthInviteEngine.php:84 — src/applications/auth/engine/PhabricatorAuthInviteEngine.php:84-92 | src/applications/auth/engine/PhabricatorAuthInviteEngine.php:94-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/applications/auth/factor/PhabricatorSMSAuthFactor.php:262 — src/applications/auth/factor/PhabricatorSMSAuthFactor.php:262-270 | src/applications/auth/factor/PhabricatorTOTPAuthFactor.php:188-196 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/factor/PhabricatorSMSAuthFactor.php:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/auth/factor/PhabricatorTOTPAuthFactor.php:197` calls `setAutofocus` and `src/applications/auth/factor/PhabricatorSMSAuthFactor.php:271` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) src/applications/conduit/controller/PhabricatorConduitAPIController.php:566 — src/applications/conduit/controller/PhabricatorConduitAPIController.php:566-574 | src/applications/files/controller/PhabricatorFileTransformListController.php:118-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) src/applications/daemon/controller/PhabricatorDaemonConsoleController.php:222 — src/applications/daemon/controller/PhabricatorDaemonConsoleController.php:222-230 | src/applications/daemon/controller/PhabricatorDaemonLogListController.php:21-29 — 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) src/applications/diffusion/controller/DiffusionRepositoryListController.php:10 — src/applications/diffusion/controller/DiffusionRepositoryListController.php:10-18 | src/applications/feed/controller/PhabricatorFeedListController.php:11-19 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) src/applications/drydock/management/DrydockManagementLeaseWorkflow.php:219 — src/applications/drydock/management/DrydockManagementLeaseWorkflow.php:219-227 | src/applications/drydock/view/DrydockLogListView.php:92-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/management/DrydockManagementLeaseWorkflow.php:219` it does not close everything it opens, so those exact lines 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) src/applications/fund/phortune/FundBackerProduct.php:87 — src/applications/fund/phortune/FundBackerProduct.php:87-95 | src/applications/fund/phortune/FundBackerProduct.php:125-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/applications/maniphest/query/ManiphestTaskSearchEngine.php:405 — src/applications/maniphest/query/ManiphestTaskSearchEngine.php:405-413 | src/applications/repository/query/PhabricatorRepositorySearchEngine.php:252-260 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/maniphest/query/ManiphestTaskSearchEngine.php:405` it does not close everything it opens, so those exact lines 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) src/applications/packages/editor/PhabricatorPackagesPackageEditEngine.php:87 — src/applications/packages/editor/PhabricatorPackagesPackageEditEngine.php:87-95 | src/applications/packages/editor/PhabricatorPackagesPublisherEditEngine.php:79-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/packages/editor/PhabricatorPackagesPackageEditEngine.php:87` it does not close everything it opens, so those exact lines 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) src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php:34 — src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php:34-42 | src/applications/paste/conduit/PasteQueryConduitAPIMethod.php:42-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php:34` it does not close everything it opens, so those exact lines 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) src/applications/slowvote/view/SlowvoteEmbedView.php:197 — src/applications/slowvote/view/SlowvoteEmbedView.php:197-205 | src/applications/slowvote/view/SlowvoteEmbedView.php:292-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.
  • Duplicated block (9 lines × 2) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1280 — src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1280-1288 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1453-1461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1280` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1462` calls `renderHandleLink` and `src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1289` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2627 — src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2627-2635 | src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2876-2884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2627` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) src/applications/badges/xaction/PhabricatorBadgesBadgeIconTransaction.php:36 — src/applications/badges/xaction/PhabricatorBadgesBadgeIconTransaction.php:36-44 | src/applications/calendar/xaction/PhabricatorCalendarEventIconTransaction.php:36-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/applications/differential/customfield/DifferentialBlameRevisionField.php:83 — src/applications/differential/customfield/DifferentialBlameRevisionField.php:83-91 | src/applications/differential/customfield/DifferentialRevertPlanField.php:103-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php:66 — src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php:66-74 | src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:128-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.
  • Duplicated block (9 lines × 2) src/applications/maniphest/constants/ManiphestTaskPriority.php:190 — src/applications/maniphest/constants/ManiphestTaskPriority.php:190-198 | src/applications/maniphest/constants/ManiphestTaskStatus.php:247-255 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/applications/pholio/xaction/PholioImageDescriptionTransaction.php:47 — src/applications/pholio/xaction/PholioImageDescriptionTransaction.php:47-55 | src/applications/pholio/xaction/PholioImageNameTransaction.php:50-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/applications/search/engineextension/PhabricatorLiskSearchEngineExtension.php:21 — src/applications/search/engineextension/PhabricatorLiskSearchEngineExtension.php:21-29 | src/infrastructure/export/engine/PhabricatorLiskExportEngineExtension.php:9-17 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/infrastructure/markup/blockrule/PhutilRemarkupQuotesBlockRule.php:7 — src/infrastructure/markup/blockrule/PhutilRemarkupQuotesBlockRule.php:7-15 | src/infrastructure/markup/blockrule/PhutilRemarkupReplyBlockRule.php:11-19 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) src/applications/auth/garbagecollector/PhabricatorAuthSessionGarbageCollector.php:17 — src/applications/auth/garbagecollector/PhabricatorAuthSessionGarbageCollector.php:17-25 | src/applications/auth/garbagecollector/PhabricatorAuthTemporaryTokenGarbageCollector.php:17-25 — 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×38
  • Duplicated block (13 lines × 2) src/applications/almanac/controller/AlmanacDeviceViewController.php:20 — src/applications/almanac/controller/AlmanacDeviceViewController.php:20-32 | src/applications/almanac/controller/AlmanacNamespaceViewController.php:18-30 — before extracting anything, compare `src/applications/almanac/controller/AlmanacDeviceViewController.php` and `src/applications/almanac/controller/AlmanacNamespaceViewController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) src/applications/almanac/controller/AlmanacNamespaceViewController.php:15 — src/applications/almanac/controller/AlmanacNamespaceViewController.php:15-27 | src/applications/almanac/controller/AlmanacNetworkViewController.php:15-27 — before extracting anything, compare `src/applications/almanac/controller/AlmanacNamespaceViewController.php` and `src/applications/almanac/controller/AlmanacNetworkViewController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) src/applications/auth/provider/PhabricatorJIRAAuthProvider.php:215 — src/applications/auth/provider/PhabricatorJIRAAuthProvider.php:215-227 | src/applications/auth/provider/PhabricatorPhabricatorAuthProvider.php:173-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/provider/PhabricatorJIRAAuthProvider.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 (13 lines × 2) src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:33 — src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:33-45 | src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:41-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/applications/calendar/controller/PhabricatorCalendarImportViewController.php:239 — src/applications/calendar/controller/PhabricatorCalendarImportViewController.php:239-251 | src/applications/calendar/controller/PhabricatorCalendarImportViewController.php:279-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) src/applications/config/schema/PhabricatorConfigSchemaQuery.php:279 — src/applications/config/schema/PhabricatorConfigSchemaQuery.php:279-292 | src/applications/config/schema/PhabricatorConfigSchemaQuery.php:299-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/applications/conpherence/xaction/ConpherenceThreadParticipantsTransaction.php:72 — src/applications/conpherence/xaction/ConpherenceThreadParticipantsTransaction.php:72-84 | src/applications/pholio/xaction/PholioImageFileTransaction.php:59-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/xaction/ConpherenceThreadParticipantsTransaction.php:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:130 — src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:130-142 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:207-219 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.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 (13 lines × 2) src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:112 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:112-124 | src/applications/search/controller/PhabricatorApplicationSearchController.php:1079-1091 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/applications/dashboard/paneltype/PhabricatorDashboardChartPanelType.php:60 — src/applications/dashboard/paneltype/PhabricatorDashboardChartPanelType.php:60-72 | src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php:176-188 — 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 (13 lines × 2) src/applications/differential/render/DifferentialChangesetRenderer.php:680 — src/applications/differential/render/DifferentialChangesetRenderer.php:680-692 | src/applications/differential/render/DifferentialChangesetRenderer.php:696-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/render/DifferentialChangesetRenderer.php:680` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:769 — src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:769-781 | src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:802-814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:769` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:108 — src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:108-120 | src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:142-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:155` calls `renderObject` and `src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:121` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) src/applications/files/builtin/PhabricatorFilesComposeIconBuiltinFile.php:100 — src/applications/files/builtin/PhabricatorFilesComposeIconBuiltinFile.php:100-112 | src/applications/files/builtin/PhabricatorFilesComposeIconBuiltinFile.php:116-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/applications/files/builtin/PhabricatorFilesOnDiskBuiltinFile.php:44 — src/applications/files/builtin/PhabricatorFilesOnDiskBuiltinFile.php:44-56 | src/applications/files/builtin/PhabricatorFilesOnDiskBuiltinFile.php:60-72 — both copies are in the same file, so extract the 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 (13 lines × 2) src/applications/files/controller/PhabricatorFileUICurtainAttachController.php:10 — src/applications/files/controller/PhabricatorFileUICurtainAttachController.php:10-22 | src/applications/files/controller/PhabricatorFileUICurtainListController.php:13-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/files/controller/PhabricatorFileUICurtainAttachController.php:9` calls `getURIData` and `src/applications/files/controller/PhabricatorFileUICurtainListController.php:11` 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 (13 lines × 2) src/applications/herald/xaction/HeraldWebhookStatusTransaction.php:51 — src/applications/herald/xaction/HeraldWebhookStatusTransaction.php:51-64 | src/applications/project/xaction/column/PhabricatorProjectColumnStatusTransaction.php:49-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) src/applications/nuance/controller/NuanceConsoleController.php:41 — src/applications/nuance/controller/NuanceConsoleController.php:41-53 | src/applications/phortune/controller/product/PhortuneProductListController.php:52-65 — 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 (13 lines × 2) src/applications/owners/storage/PhabricatorOwnersPackage.php:763 — src/applications/owners/storage/PhabricatorOwnersPackage.php:763-775 | src/applications/owners/storage/PhabricatorOwnersPackage.php:780-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:41 — src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:41-53 | src/applications/phortune/xaction/PhortuneMerchantInvoiceEmailTransaction.php:40-52 — before extracting anything, compare `src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php` and `src/applications/phortune/xaction/PhortuneMerchantInvoiceEmailTransaction.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 `src/applications/paste/xaction/PhabricatorPasteTitleTransaction.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) src/applications/people/storage/PhabricatorUserEmail.php:253 — src/applications/people/storage/PhabricatorUserEmail.php:253-265 | src/applications/people/storage/PhabricatorUserEmail.php:288-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 `src/applications/people/storage/PhabricatorUserEmail.php:253` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) src/applications/phlux/controller/PhluxViewController.php:63 — src/applications/phlux/controller/PhluxViewController.php:63-75 | src/applications/pholio/controller/PholioMockViewController.php:117-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phlux/controller/PhluxViewController.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.
  • Duplicated block (13 lines × 2) src/applications/phortune/controller/account/PhortuneAccountEmailAddressesController.php:40 — src/applications/phortune/controller/account/PhortuneAccountEmailAddressesController.php:40-52 | src/applications/phortune/controller/account/PhortuneAccountManagersController.php:41-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) src/applications/phortune/controller/merchant/PhortuneMerchantOverviewController.php:15 — src/applications/phortune/controller/merchant/PhortuneMerchantOverviewController.php:15-27 | src/applications/phortune/controller/merchant/PhortuneMerchantProvidersController.php:16-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/phortune/controller/merchant/PhortuneMerchantProvidersController.php:15` calls `addTextCrumb`, `pht` and `src/applications/phortune/controller/merchant/PhortuneMerchantOverviewController.php:14` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php:73 — src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php:73-85 | src/infrastructure/daemon/workers/management/PhabricatorWorkerTriggerManagementFireWorkflow.php:49-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×37
  • Duplicated block (15 lines × 2) src/applications/almanac/controller/AlmanacDeviceViewController.php:127 — src/applications/almanac/controller/AlmanacDeviceViewController.php:127-141 | src/applications/almanac/controller/AlmanacServiceViewController.php:134-148 — before extracting anything, compare `src/applications/almanac/controller/AlmanacDeviceViewController.php` and `src/applications/almanac/controller/AlmanacServiceViewController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (15 lines × 2) src/applications/almanac/controller/AlmanacServiceViewController.php:53 — src/applications/almanac/controller/AlmanacServiceViewController.php:53-69 | src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php:55-69 — 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 (15 lines × 2) src/applications/almanac/query/AlmanacPropertyQuery.php:71 — src/applications/almanac/query/AlmanacPropertyQuery.php:71-85 | src/applications/conduit/query/PhabricatorConduitTokenQuery.php:42-56 — 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 (15 lines × 2) src/applications/audit/storage/PhabricatorAuditTransaction.php:122 — src/applications/audit/storage/PhabricatorAuditTransaction.php:122-136 | src/applications/audit/storage/PhabricatorAuditTransaction.php:143-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 (15 lines × 2) src/applications/auth/controller/PhabricatorAuthSetPasswordController.php:121 — src/applications/auth/controller/PhabricatorAuthSetPasswordController.php:121-135 | src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php:172-186 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/PhabricatorAuthSetPasswordController.php:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:111 — src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:111-125 | src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php:96-110 — before extracting anything, compare `src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php` and `src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:107` calls `requireActor` and `src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php:92` 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) src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php:46 — src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php:46-60 | src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php:46-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/applications/badges/controller/PhabricatorBadgesArchiveController.php:7 — src/applications/badges/controller/PhabricatorBadgesArchiveController.php:7-21 | src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php:7-21 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php:23` calls `getStr` and `src/applications/badges/controller/PhabricatorBadgesArchiveController.php:23` 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) src/applications/calendar/controller/PhabricatorCalendarImportReloadController.php:10 — src/applications/calendar/controller/PhabricatorCalendarImportReloadController.php:10-24 | src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:10-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarImportReloadController.php:10` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:616 — src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:616-630 | src/applications/xhprof/query/PhabricatorXHProfSampleSearchEngine.php:103-117 — 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 (15 lines × 2) src/applications/calendar/xaction/PhabricatorCalendarEventFrequencyTransaction.php:53 — src/applications/calendar/xaction/PhabricatorCalendarEventFrequencyTransaction.php:53-70 | src/applications/project/xaction/column/PhabricatorProjectColumnStatusTransaction.php:41-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/xaction/PhabricatorCalendarEventFrequencyTransaction.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 (15 lines × 2) src/applications/config/controller/services/PhabricatorConfigServicesController.php:12 — src/applications/config/controller/services/PhabricatorConfigServicesController.php:12-26 | src/applications/config/controller/services/PhabricatorConfigServicesController.php:37-51 — both copies are in the same file, so extract the 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 (15 lines × 2) src/applications/diffusion/controller/DiffusionDocumentController.php:28 — src/applications/diffusion/controller/DiffusionDocumentController.php:28-42 | src/applications/files/controller/PhabricatorFileDocumentController.php:19-33 — 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 (15 lines × 2) src/applications/diffusion/query/DiffusionCommitHintQuery.php:60 — src/applications/diffusion/query/DiffusionCommitHintQuery.php:60-74 | src/applications/repository/query/PhabricatorRepositoryGitLFSRefQuery.php:30-44 — 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 (15 lines × 2) src/applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php:87 — src/applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php:87-101 | src/applications/project/typeahead/PhabricatorProjectMembersDatasource.php:79-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/applications/diviner/atom/DivinerAtom.php:391 — src/applications/diviner/atom/DivinerAtom.php:391-405 | src/applications/diviner/atom/DivinerAtom.php:422-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diviner/atom/DivinerAtom.php:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) src/applications/maniphest/query/ManiphestTaskQuery.php:325 — src/applications/maniphest/query/ManiphestTaskQuery.php:325-339 | src/applications/ponder/query/PonderQuestionQuery.php:108-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) src/applications/maniphest/search/ManiphestTaskFulltextEngine.php:14 — src/applications/maniphest/search/ManiphestTaskFulltextEngine.php:14-28 | src/applications/pholio/search/PholioMockFulltextEngine.php:14-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 `src/applications/maniphest/search/ManiphestTaskFulltextEngine.php:14` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/applications/nuance/github/NuanceGitHubRawEvent.php:297 — src/applications/nuance/github/NuanceGitHubRawEvent.php:297-311 | src/applications/nuance/github/NuanceGitHubRawEvent.php:318-332 — both copies are in the same file, so extract the 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) src/applications/people/controller/PhabricatorPeopleProfileManageController.php:137 — src/applications/people/controller/PhabricatorPeopleProfileManageController.php:137-151 | src/applications/people/controller/PhabricatorPeopleProfileManageController.php:188-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:65 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:65-79 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:81-95 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodCreateController.php:315 — src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodCreateController.php:315-329 | src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodEditController.php:80-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodDisableController.php:7 — src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodDisableController.php:7-21 | src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodEditController.php:7-21 — 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 (15 lines × 2) src/applications/phriction/controller/PhrictionDeleteController.php:7 — src/applications/phriction/controller/PhrictionDeleteController.php:7-21 | src/applications/phriction/controller/PhrictionPublishController.php:9-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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 (15 lines × 2) src/applications/project/chart/PhabricatorProjectActivityChartEngine.php:15 — src/applications/project/chart/PhabricatorProjectActivityChartEngine.php:15-29 | src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php:15-29 — 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.
  • + 12 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×37
  • Swallowed exception (caught, then discarded) resources/sql/autopatches/20190412.dashboard.01.panels.php:37 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) resources/sql/autopatches/20161005.cal.01.rrules.php:32 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) resources/sql/autopatches/20161004.cal.01.noepoch.php:110 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) resources/sql/autopatches/20160601.user.02.copyprefs.php:23 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) resources/sql/autopatches/20160225.almanac.3.stype.php:16 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/aphront/response/AphrontUnhandledExceptionResponse.php:125 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/aphront/response/AphrontUnhandledExceptionResponse.php:127 — `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/aphront/response/AphrontResponse.php:135 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/auth/provider/PhabricatorOAuth2AuthProvider.php:251 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/auth/view/PhabricatorAuthSSHKeyTableView.php:23 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:296 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:302 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/config/check/PhabricatorSetupCheck.php:129 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:76 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/config/custom/PhabricatorCustomLogoConfigType.php:83 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/config/type/PhabricatorClassConfigType.php:26 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/console/controller/DarkConsoleDataController.php:70 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/differential/customfield/DifferentialCustomField.php:77 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/differential/mail/DifferentialInlineCommentMailView.php:269 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/differential/xaction/DifferentialRevisionTransactionType.php:67 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/differential/xaction/DifferentialRevisionActionTransaction.php:14 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/diffusion/controller/DiffusionController.php:413 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php:187 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/diffusion/xaction/DiffusionCommitActionTransaction.php:14 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php:94 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×34
  • Duplicated block (12 lines × 2) src/applications/almanac/controller/AlmanacPropertyDeleteController.php:49 — src/applications/almanac/controller/AlmanacPropertyDeleteController.php:49-60 | src/applications/calendar/controller/PhabricatorCalendarEventJoinController.php:53-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/controller/AlmanacPropertyDeleteController.php:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/applications/auth/conduit/PhabricatorAuthQueryPublicKeysConduitAPIMethod.php:34 — src/applications/auth/conduit/PhabricatorAuthQueryPublicKeysConduitAPIMethod.php:34-45 | src/applications/harbormaster/conduit/HarbormasterQueryBuildablesConduitAPIMethod.php:34-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/conduit/PhabricatorAuthQueryPublicKeysConduitAPIMethod.php:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/applications/auth/controller/config/PhabricatorAuthProviderController.php:13 — src/applications/auth/controller/config/PhabricatorAuthProviderController.php:13-24 | src/applications/auth/controller/config/PhabricatorAuthProviderController.php:34-45 — both copies are in the same file, so extract the 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 (12 lines × 2) src/applications/auth/factor/PhabricatorAuthFactor.php:323 — src/applications/auth/factor/PhabricatorAuthFactor.php:323-334 | src/applications/auth/factor/PhabricatorAuthFactor.php:355-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:22 — src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:22-33 | src/applications/config/controller/settings/PhabricatorConfigSettingsHistoryController.php:32-43 — 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 (12 lines × 2) src/applications/daemon/controller/PhabricatorDaemonLogViewController.php:68 — src/applications/daemon/controller/PhabricatorDaemonLogViewController.php:68-79 | src/applications/phortune/controller/product/PhortuneProductViewController.php:40-51 — 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) src/applications/diffusion/controller/DiffusionController.php:519 — src/applications/diffusion/controller/DiffusionController.php:519-530 | src/applications/diffusion/controller/DiffusionController.php:532-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/diffusion/controller/DiffusionController.php:532` calls `isSVN` and `src/applications/diffusion/controller/DiffusionController.php:545` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) src/applications/drydock/controller/DrydockRepositoryOperationStatusController.php:11 — src/applications/drydock/controller/DrydockRepositoryOperationStatusController.php:11-22 | src/applications/drydock/controller/DrydockRepositoryOperationViewController.php:11-22 — 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) src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php:96 — src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php:96-107 | src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php:29-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php:62 — src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php:62-73 | src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php:210-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/applications/harbormaster/controller/HarbormasterPlanBehaviorController.php:43 — src/applications/harbormaster/controller/HarbormasterPlanBehaviorController.php:43-54 | src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:36-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/controller/HarbormasterPlanBehaviorController.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 (12 lines × 2) src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:31 — src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:31-42 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:95-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php:136 — src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php:136-147 | src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php:135-146 — 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) src/applications/herald/query/HeraldRuleQuery.php:175 — src/applications/herald/query/HeraldRuleQuery.php:175-186 | src/applications/project/query/PhabricatorProjectColumnQuery.php:97-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/herald/query/HeraldRuleQuery.php:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/applications/maniphest/controller/ManiphestReportController.php:537 — src/applications/maniphest/controller/ManiphestReportController.php:537-548 | src/applications/maniphest/controller/ManiphestReportController.php:550-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/applications/maniphest/typeahead/ManiphestTaskSubtypeDatasource.php:31 — src/applications/maniphest/typeahead/ManiphestTaskSubtypeDatasource.php:31-42 | src/applications/project/typeahead/PhabricatorProjectSubtypeDatasource.php:31-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) src/applications/meta/controller/PhabricatorApplicationDetailViewController.php:163 — src/applications/meta/controller/PhabricatorApplicationDetailViewController.php:163-174 | src/applications/owners/controller/PhabricatorOwnersDetailController.php:249-260 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) src/applications/nuance/controller/NuanceItemManageController.php:6 — src/applications/nuance/controller/NuanceItemManageController.php:6-17 | src/applications/nuance/controller/NuanceItemViewController.php:6-17 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/nuance/controller/NuanceItemViewController.php:18` calls `getDisplayName` and `src/applications/nuance/controller/NuanceItemManageController.php:19` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) src/applications/nuance/management/NuanceManagementWorkflow.php:16 — src/applications/nuance/management/NuanceManagementWorkflow.php:16-27 | src/applications/nuance/management/NuanceManagementWorkflow.php:77-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/nuance/management/NuanceManagementWorkflow.php:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/applications/phame/controller/blog/PhameBlogManageController.php:163 — src/applications/phame/controller/blog/PhameBlogManageController.php:163-174 | src/applications/phame/controller/blog/PhameBlogViewController.php:126-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 `src/applications/phame/controller/blog/PhameBlogManageController.php:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/applications/phortune/controller/account/PhortuneAccountAddManagerController.php:37 — src/applications/phortune/controller/account/PhortuneAccountAddManagerController.php:37-48 | src/applications/phortune/controller/merchant/PhortuneMerchantAddManagerController.php:35-46 — before extracting anything, compare `src/applications/phortune/controller/account/PhortuneAccountAddManagerController.php` and `src/applications/phortune/controller/merchant/PhortuneMerchantAddManagerController.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/controller/account/PhortuneAccountAddManagerController.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 (12 lines × 2) src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:84 — src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:84-95 | src/applications/phortune/controller/merchant/PhortuneMerchantOverviewController.php:122-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/project/controller/PhabricatorProjectProfileController.php:20 — src/applications/project/controller/PhabricatorProjectProfileController.php:20-31 | src/applications/project/view/PhabricatorProjectCardView.php:49-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) src/applications/repository/xaction/PhabricatorRepositoryEncodingTransaction.php:25 — src/applications/repository/xaction/PhabricatorRepositoryEncodingTransaction.php:25-36 | src/applications/repository/xaction/PhabricatorRepositorySlugTransaction.php:32-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/repository/xaction/PhabricatorRepositoryEncodingTransaction.php:25` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:736 — src/applications/transactions/storage/PhabricatorApplicationTransaction.php:736-747 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:804-815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/transactions/storage/PhabricatorApplicationTransaction.php:736` it begins part-way through the construct above it, so those 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.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×29
  • Duplicated block (16 lines × 2) src/applications/almanac/management/AlmanacManagementTrustKeyWorkflow.php:21 — src/applications/almanac/management/AlmanacManagementTrustKeyWorkflow.php:21-36 | src/applications/almanac/management/AlmanacManagementUntrustKeyWorkflow.php:21-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16 lines × 2) src/applications/almanac/typeahead/AlmanacServiceDatasource.php:39 — src/applications/almanac/typeahead/AlmanacServiceDatasource.php:39-54 | src/applications/metamta/typeahead/PhabricatorMetaMTAApplicationEmailDatasource.php:34-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 `src/applications/almanac/typeahead/AlmanacServiceDatasource.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. 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) src/applications/almanac/xaction/AlmanacBindingServiceTransaction.php:20 — src/applications/almanac/xaction/AlmanacBindingServiceTransaction.php:20-35 | src/applications/almanac/xaction/AlmanacInterfaceDeviceTransaction.php:28-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/xaction/AlmanacBindingServiceTransaction.php:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php:34 — src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php:34-49 | src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php:51-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:10 — src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:10-25 | src/applications/calendar/controller/PhabricatorCalendarImportViewController.php:10-25 — before extracting anything, compare `src/applications/calendar/controller/PhabricatorCalendarExportViewController.php` and `src/applications/calendar/controller/PhabricatorCalendarImportViewController.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:10` it does not close everything it opens, so those exact lines 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) src/applications/conduit/controller/PhabricatorConduitTokenEditController.php:8 — src/applications/conduit/controller/PhabricatorConduitTokenEditController.php:8-23 | src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php:9-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conduit/controller/PhabricatorConduitTokenEditController.php:8` it does not close everything it opens, so those 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, `src/applications/conduit/controller/PhabricatorConduitTokenTerminateController.php:8` calls `getStr` and `src/applications/conduit/controller/PhabricatorConduitTokenEditController.php:7` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:117 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:117-132 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:202-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:134` calls `appendRemarkupInstructions`, `pht` and `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:219` 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 (16 lines × 2) src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:11 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:11-26 | src/applications/paste/controller/PhabricatorPasteArchiveController.php:11-26 — before extracting anything, compare `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php` and `src/applications/paste/controller/PhabricatorPasteArchiveController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:11` it does not close everything it opens, so those exact lines 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) src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:130 — src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:130-145 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:137-152 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` and `src/applications/project/controller/PhabricatorProjectEditPictureController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.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 (16 lines × 2) src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php:18 — src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php:18-33 | src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php:18-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php:34 — src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php:34-49 | src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php:37-52 — 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 (16 lines × 2) src/applications/diviner/workflow/DivinerAtomizeWorkflow.php:45 — src/applications/diviner/workflow/DivinerAtomizeWorkflow.php:45-60 | src/applications/diviner/workflow/DivinerGenerateWorkflow.php:180-195 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16 lines × 2) src/applications/drydock/query/DrydockLeaseQuery.php:90 — src/applications/drydock/query/DrydockLeaseQuery.php:90-105 | src/applications/drydock/query/DrydockResourceQuery.php:75-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/drydock/typeahead/DrydockLeaseDatasource.php:19 — src/applications/drydock/typeahead/DrydockLeaseDatasource.php:19-34 | src/applications/drydock/typeahead/DrydockResourceDatasource.php:19-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/fund/controller/FundInitiativeViewController.php:118 — src/applications/fund/controller/FundInitiativeViewController.php:118-133 | src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:100-115 — 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 (16 lines × 2) src/applications/harbormaster/controller/HarbormasterPlanViewController.php:236 — src/applications/harbormaster/controller/HarbormasterPlanViewController.php:236-251 | src/applications/harbormaster/controller/HarbormasterStepViewController.php:119-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/harbormaster/controller/HarbormasterPlanViewController.php:253` calls `isDisabled` and `src/applications/harbormaster/controller/HarbormasterStepViewController.php:136` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php:35 — src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php:35-50 | src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php:50-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php:35` 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) src/applications/pholio/controller/PholioMockEditController.php:312 — src/applications/pholio/controller/PholioMockEditController.php:312-327 | src/applications/phriction/controller/PhrictionEditController.php:254-269 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/pholio/controller/PholioMockEditController.php:312` 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) src/applications/phortune/controller/account/PhortuneAccountListController.php:45 — src/applications/phortune/controller/account/PhortuneAccountListController.php:45-60 | src/applications/phortune/controller/account/PhortuneAccountListController.php:77-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/controller/account/PhortuneAccountListController.php:45` it begins part-way through the construct above it, so those exact lines 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) src/applications/phortune/controller/cart/PhortuneCartViewController.php:50 — src/applications/phortune/controller/cart/PhortuneCartViewController.php:50-65 | src/applications/phortune/controller/external/PhortuneExternalOrderController.php:25-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/controller/cart/PhortuneCartViewController.php:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/phortune/controller/cart/PhortuneCartViewController.php:49` calls `setResumeURI` and `src/applications/phortune/controller/external/PhortuneExternalOrderController.php:24` 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 (16 lines × 2) src/applications/phortune/controller/merchant/PhortuneMerchantOrderListController.php:13 — src/applications/phortune/controller/merchant/PhortuneMerchantOrderListController.php:13-28 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionListController.php:11-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/controller/merchant/PhortuneMerchantOrderListController.php:13` it does not close everything it opens, so those 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) src/applications/phortune/storage/PhortuneCart.php:186 — src/applications/phortune/storage/PhortuneCart.php:186-201 | src/applications/phortune/storage/PhortuneCart.php:280-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php:37 — src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php:37-52 | src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php:41-56 — before extracting anything, compare `src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php` and `src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/order/PhabricatorProjectColumnAuthorOrder.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 (16 lines × 2) src/applications/project/query/PhabricatorProjectQuery.php:816 — src/applications/project/query/PhabricatorProjectQuery.php:816-831 | src/applications/project/query/PhabricatorProjectQuery.php:853-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/applications/search/controller/PhabricatorSearchDeleteController.php:7 — src/applications/search/controller/PhabricatorSearchDeleteController.php:7-22 | src/applications/search/controller/PhabricatorSearchEditController.php:7-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/search/controller/PhabricatorSearchDeleteController.php:7` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/search/controller/PhabricatorSearchDeleteController.php:24` calls `newv`, `getEngineClassName`, `array` and `src/applications/search/controller/PhabricatorSearchEditController.php:24` 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×29
  • Duplicated block (7 lines × 2) src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:218 — src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:218-225 | src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:323-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:323` it begins part-way through the construct above it, so those 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 × 2) src/applications/differential/parser/DifferentialHunkParser.php:644 — src/applications/differential/parser/DifferentialHunkParser.php:644-650 | src/applications/differential/parser/DifferentialHunkParser.php:653-659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/parser/DifferentialHunkParser.php:644` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:268 — src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:268-274 | src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:364-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/applications/diffusion/controller/DiffusionRepositoryListController.php:20 — src/applications/diffusion/controller/DiffusionRepositoryListController.php:20-26 | src/applications/feed/controller/PhabricatorFeedListController.php:13-19 — 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) src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:265 — src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:265-271 | src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php:75-81 — 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) src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:285 — src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:285-291 | src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php:87-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/applications/project/typeahead/PhabricatorProjectLogicalOrNotDatasource.php:93 — src/applications/project/typeahead/PhabricatorProjectLogicalOrNotDatasource.php:93-99 | src/applications/project/typeahead/PhabricatorProjectLogicalOrNotDatasource.php:101-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/typeahead/PhabricatorProjectLogicalOrNotDatasource.php:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php:615 — src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php:615-621 | src/view/phui/PHUITimelineView.php:284-290 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php:615` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/infrastructure/env/PhabricatorEnv.php:286 — src/infrastructure/env/PhabricatorEnv.php:286-292 | src/infrastructure/env/PhabricatorEnv.php:296-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/applications/differential/customfield/DifferentialBlameRevisionField.php:71 — src/applications/differential/customfield/DifferentialBlameRevisionField.php:71-77 | src/applications/differential/customfield/DifferentialRevertPlanField.php:91-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) src/applications/differential/customfield/DifferentialCustomField.php:30 — src/applications/differential/customfield/DifferentialCustomField.php:30-36 | src/applications/differential/field/DifferentialCommitMessageField.php:117-123 — 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) src/applications/drydock/customfield/DrydockBlueprintCoreCustomField.php:36 — src/applications/drydock/customfield/DrydockBlueprintCoreCustomField.php:36-42 | src/applications/harbormaster/customfield/HarbormasterBuildStepCoreCustomField.php:66-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 (7 lines × 2) src/applications/drydock/storage/DrydockLease.php:161 — src/applications/drydock/storage/DrydockLease.php:161-167 | src/applications/drydock/storage/DrydockResource.php:98-104 — before extracting anything, compare `src/applications/drydock/storage/DrydockLease.php` and `src/applications/drydock/storage/DrydockResource.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/applications/harbormaster/query/HarbormasterArtifactSearchEngine.php:39 — src/applications/harbormaster/query/HarbormasterArtifactSearchEngine.php:39-45 | src/applications/harbormaster/query/HarbormasterBuildLogSearchEngine.php:39-45 — 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 (7 lines × 2) src/applications/nuance/phid/NuanceQueuePHIDType.php:32 — src/applications/nuance/phid/NuanceQueuePHIDType.php:32-38 | src/applications/nuance/phid/NuanceSourcePHIDType.php:32-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) src/applications/nuance/storage/NuanceItem.php:129 — src/applications/nuance/storage/NuanceItem.php:129-135 | src/applications/tokens/storage/PhabricatorTokenGiven.php:79-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) src/applications/people/icon/PhabricatorPeopleIconSet.php:27 — src/applications/people/icon/PhabricatorPeopleIconSet.php:27-35 | src/applications/project/icon/PhabricatorProjectIconSet.php:150-156 — 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) src/applications/phame/controller/PhameHomeController.php:10 — src/applications/phame/controller/PhameHomeController.php:10-16 | src/applications/phame/controller/blog/PhameBlogListController.php:17-23 — 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 (7 lines × 2) src/applications/settings/setting/PhabricatorSetting.php:122 — src/applications/settings/setting/PhabricatorSetting.php:122-128 | src/applications/settings/storage/PhabricatorUserPreferences.php:157-163 — 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) src/aphront/site/PhabricatorShortSite.php:35 — src/aphront/site/PhabricatorShortSite.php:35-41 | src/applications/phame/site/PhameBlogSite.php:68-74 — 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 (7 lines × 2) src/applications/almanac/constants/AlmanacDeviceStatus.php:66 — src/applications/almanac/constants/AlmanacDeviceStatus.php:66-72 | src/applications/maniphest/constants/ManiphestTaskStatus.php:130-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.
  • Duplicated block (7 lines × 2) src/applications/auth/controller/message/PhabricatorAuthMessageViewController.php:88 — src/applications/auth/controller/message/PhabricatorAuthMessageViewController.php:88-94 | src/applications/people/controller/PhabricatorPeopleLogViewController.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. 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) src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php:18 — src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php:18-24 | src/applications/calendar/xaction/PhabricatorCalendarEventStartDateTransaction.php:18-24 — 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 (7 lines × 2) src/applications/conpherence/controller/ConpherenceRoomListController.php:10 — src/applications/conpherence/controller/ConpherenceRoomListController.php:10-18 | src/applications/spaces/controller/PhabricatorSpacesListController.php:11-17 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) src/applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php:17 — src/applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php:17-23 | src/applications/diffusion/herald/DiffusionPreCommitContentRevisionReviewersHeraldField.php:17-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×28
  • Duplicated block (8 lines × 2) src/applications/almanac/query/AlmanacBindingQuery.php:69 — src/applications/almanac/query/AlmanacBindingQuery.php:69-76 | src/applications/almanac/query/AlmanacInterfaceQuery.php:54-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/query/AlmanacBindingQuery.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 (8 lines × 2) src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php:64 — src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php:64-71 | src/applications/calendar/query/PhabricatorCalendarImportSearchEngine.php:61-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:203 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:203-210 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:103-112 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/phame/controller/post/PhamePostHeaderPictureController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/controller/ConpherenceRoomPictureController.php:203` 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 × 2) src/applications/conpherence/controller/ConpherenceRoomPreferencesController.php:67 — src/applications/conpherence/controller/ConpherenceRoomPreferencesController.php:67-74 | src/applications/conpherence/controller/ConpherenceUpdateController.php:414-422 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/conpherence/controller/ConpherenceRoomPreferencesController.php:64` calls `idx` and `src/applications/conpherence/controller/ConpherenceUpdateController.php:413` 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 × 2) src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:77 — src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php:77-84 | src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php:46-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) src/applications/differential/render/DifferentialChangesetRenderer.php:504 — src/applications/differential/render/DifferentialChangesetRenderer.php:504-511 | src/applications/differential/render/DifferentialChangesetRenderer.php:515-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/render/DifferentialChangesetRenderer.php:504` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:66 — src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:66-73 | src/applications/drydock/controller/DrydockBlueprintViewController.php:23-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) src/applications/harbormaster/controller/HarbormasterBuildableListController.php:12 — src/applications/harbormaster/controller/HarbormasterBuildableListController.php:12-19 | src/applications/harbormaster/controller/HarbormasterBuildableListController.php:21-28 — both copies are in the same file, so extract the 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) src/applications/legalpad/controller/LegalpadDocumentSignatureViewController.php:57 — src/applications/legalpad/controller/LegalpadDocumentSignatureViewController.php:57-64 | src/applications/legalpad/controller/LegalpadDocumentSignatureViewController.php:70-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/legalpad/controller/LegalpadDocumentSignatureViewController.php:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 2) src/applications/repository/storage/PhabricatorRepositoryURITransaction.php:56 — src/applications/repository/storage/PhabricatorRepositoryURITransaction.php:56-63 | src/applications/repository/storage/PhabricatorRepositoryURITransaction.php:66-73 — both copies are in the same file, so extract the 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 (8 lines × 2) src/applications/badges/xaction/PhabricatorBadgesBadgeIconTransaction.php:25 — src/applications/badges/xaction/PhabricatorBadgesBadgeIconTransaction.php:25-32 | src/applications/calendar/xaction/PhabricatorCalendarEventIconTransaction.php:25-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) src/applications/dashboard/install/PhabricatorDashboardPortalInstallWorkflow.php:29 — src/applications/dashboard/install/PhabricatorDashboardPortalInstallWorkflow.php:29-36 | src/applications/dashboard/install/PhabricatorDashboardProjectInstallWorkflow.php:29-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/differential/typeahead/DifferentialRevisionClosedStatusDatasource.php:54 — src/applications/differential/typeahead/DifferentialRevisionClosedStatusDatasource.php:54-61 | src/applications/maniphest/typeahead/ManiphestTaskClosedStatusDatasource.php:54-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) src/applications/differential/typeahead/DifferentialRevisionOpenStatusDatasource.php:54 — src/applications/differential/typeahead/DifferentialRevisionOpenStatusDatasource.php:54-61 | src/applications/maniphest/typeahead/ManiphestTaskOpenStatusDatasource.php:54-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php:181 — src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php:181-188 | src/applications/harbormaster/storage/configuration/HarbormasterBuildStep.php:90-97 — 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 (8 lines × 2) src/applications/nuance/controller/NuanceQueueViewController.php:44 — src/applications/nuance/controller/NuanceQueueViewController.php:44-51 | src/applications/nuance/controller/NuanceSourceViewController.php:54-61 — before extracting anything, compare `src/applications/nuance/controller/NuanceQueueViewController.php` and `src/applications/nuance/controller/NuanceSourceViewController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) src/applications/pholio/editor/PholioMockEditor.php:24 — src/applications/pholio/editor/PholioMockEditor.php:24-31 | src/applications/phriction/editor/PhrictionTransactionEditor.php:101-108 — 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 (8 lines × 2) src/infrastructure/export/format/PhabricatorCSVExportFormat.php:32 — src/infrastructure/export/format/PhabricatorCSVExportFormat.php:32-39 | src/infrastructure/export/format/PhabricatorTextExportFormat.php:32-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) src/view/AphrontDialogView.php:120 — src/view/AphrontDialogView.php:120-127 | src/view/form/PHUIFormInsetView.php:34-41 — 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) src/applications/auth/revoker/PhabricatorAuthConduitTokenRevoker.php:22 — src/applications/auth/revoker/PhabricatorAuthConduitTokenRevoker.php:22-30 | src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:516-523 — 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 (8 lines × 2) src/applications/dashboard/controller/PhabricatorDashboardListController.php:11 — src/applications/dashboard/controller/PhabricatorDashboardListController.php:11-18 | src/applications/flag/controller/PhabricatorFlagListController.php:10-18 — 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 (8 lines × 2) src/applications/dashboard/controller/portal/PhabricatorDashboardPortalViewController.php:43 — src/applications/dashboard/controller/portal/PhabricatorDashboardPortalViewController.php:43-50 | src/applications/phame/controller/post/PhamePostEditController.php:64-73 — 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 (8 lines × 2) src/applications/differential/storage/DifferentialChangeset.php:179 — src/applications/differential/storage/DifferentialChangeset.php:179-186 | src/applications/differential/storage/DifferentialDiff.php:127-134 — 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 (8 lines × 2) src/applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php:17 — src/applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php:17-24 | src/applications/diffusion/herald/DiffusionPreCommitContentRevisionSubscribersHeraldField.php:17-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) src/applications/drydock/query/DrydockAuthorizationSearchEngine.php:30 — src/applications/drydock/query/DrydockAuthorizationSearchEngine.php:30-37 | src/applications/drydock/query/DrydockResourceSearchEngine.php:26-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×25
  • Duplicated block (10 lines × 2) src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:121 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:121-130 | src/applications/passphrase/controller/PassphraseCredentialViewController.php:135-144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/applications/conduit/query/PhabricatorConduitMethodQuery.php:129 — src/applications/conduit/query/PhabricatorConduitMethodQuery.php:129-139 | src/applications/project/query/PhabricatorProjectColumnQuery.php:99-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conduit/query/PhabricatorConduitMethodQuery.php:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/applications/diffusion/herald/HeraldCommitAdapter.php:48 — src/applications/diffusion/herald/HeraldCommitAdapter.php:48-57 | src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:33-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/herald/HeraldCommitAdapter.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) src/applications/diffusion/symbol/DiffusionPythonExternalSymbolsSource.php:19 — src/applications/diffusion/symbol/DiffusionPythonExternalSymbolsSource.php:19-28 | src/applications/diffusion/symbol/DiffusionPythonExternalSymbolsSource.php:29-38 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/symbol/DiffusionPythonExternalSymbolsSource.php:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/applications/files/query/PhabricatorFileChunkQuery.php:55 — src/applications/files/query/PhabricatorFileChunkQuery.php:55-64 | src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php:158-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/files/query/PhabricatorFileChunkQuery.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 (10 lines × 2) src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php:100 — src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php:100-109 | src/applications/macro/controller/PhabricatorMacroMemeDialogController.php:55-64 — 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) src/applications/macro/query/PhabricatorMacroQuery.php:211 — src/applications/macro/query/PhabricatorMacroQuery.php:211-220 | src/applications/paste/query/PhabricatorPasteQuery.php:198-207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/macro/query/PhabricatorMacroQuery.php:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/applications/maniphest/controller/ManiphestTaskGraphController.php:11 — src/applications/maniphest/controller/ManiphestTaskGraphController.php:11-20 | src/applications/maniphest/controller/ManiphestTaskSubtaskController.php:7-16 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) src/applications/packages/typeahead/PhabricatorPackagesPackageDatasource.php:23 — src/applications/packages/typeahead/PhabricatorPackagesPackageDatasource.php:23-32 | src/applications/packages/typeahead/PhabricatorPackagesPublisherDatasource.php:23-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. 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) src/applications/phriction/controller/PhrictionDocumentController.php:72 — src/applications/phriction/controller/PhrictionDocumentController.php:72-81 | src/applications/phriction/controller/PhrictionEditController.php:29-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phriction/controller/PhrictionDocumentController.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. 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) src/infrastructure/edges/editor/PhabricatorEdgeEditor.php:255 — src/infrastructure/edges/editor/PhabricatorEdgeEditor.php:255-264 | src/infrastructure/edges/editor/PhabricatorEdgeEditor.php:299-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/edges/editor/PhabricatorEdgeEditor.php:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/infrastructure/daemon/workers/action/PhabricatorTriggerAction.php:15 — src/infrastructure/daemon/workers/action/PhabricatorTriggerAction.php:15-24 | src/infrastructure/daemon/workers/clock/PhabricatorTriggerClock.php:19-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 `src/infrastructure/daemon/workers/action/PhabricatorTriggerAction.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 (10 lines × 2) src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php:24 — src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php:24-33 | src/applications/badges/xaction/PhabricatorBadgesBadgeRevokeTransaction.php:27-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/dashboard/query/PhabricatorDashboardPortalSearchEngine.php:40 — src/applications/dashboard/query/PhabricatorDashboardPortalSearchEngine.php:40-49 | src/applications/differential/query/DifferentialDiffSearchEngine.php:52-62 — 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 (10 lines × 2) src/applications/differential/customfield/DifferentialSummaryField.php:70 — src/applications/differential/customfield/DifferentialSummaryField.php:70-79 | src/applications/differential/customfield/DifferentialTestPlanField.php:74-83 — 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) src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php:46 — src/applications/harbormaster/xaction/build/HarbormasterBuildMessageAbortTransaction.php:46-55 | src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.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. 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) src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php:13 — src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php:13-22 | src/applications/repository/xaction/PhabricatorRepositoryTouchLimitTransaction.php:13-22 — before extracting anything, compare `src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php` and `src/applications/repository/xaction/PhabricatorRepositoryTouchLimitTransaction.php` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the 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 (10 lines × 2) src/applications/search/engine/PhabricatorApplicationSearchEngine.php:864 — src/applications/search/engine/PhabricatorApplicationSearchEngine.php:864-873 | src/applications/search/field/PhabricatorSearchField.php:412-421 — 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 (10 lines × 2) src/aphront/site/PhabricatorPlatformSite.php:41 — src/aphront/site/PhabricatorPlatformSite.php:41-50 | src/aphront/site/PhabricatorResourceSite.php:29-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/auth/query/PhabricatorExternalAccountQuery.php:215 — src/applications/auth/query/PhabricatorExternalAccountQuery.php:215-224 | src/applications/project/query/PhabricatorProjectTriggerQuery.php:73-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. 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) src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php:31 — src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php:31-40 | src/applications/auth/revoker/PhabricatorAuthTemporaryTokenRevoker.php:34-43 — 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) src/applications/differential/field/DifferentialTagsCommitMessageField.php:37 — src/applications/differential/field/DifferentialTagsCommitMessageField.php:37-46 | src/applications/differential/field/DifferentialTasksCommitMessageField.php:37-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/drydock/phid/DrydockBlueprintPHIDType.php:36 — src/applications/drydock/phid/DrydockBlueprintPHIDType.php:36-45 | src/applications/harbormaster/phid/HarbormasterBuildStepPHIDType.php:32-42 — 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) src/applications/packages/editor/PhabricatorPackagesPublisherEditor.php:33 — src/applications/packages/editor/PhabricatorPackagesPublisherEditor.php:33-42 | src/applications/phortune/editor/PhortuneAccountEmailEditor.php:23-33 — 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) src/applications/people/controller/PhabricatorPeopleInviteListController.php:16 — src/applications/people/controller/PhabricatorPeopleInviteListController.php:16-25 | src/applications/people/controller/PhabricatorPeopleLogsController.php:16-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×22
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/almanac/controller/AlmanacDeviceViewController.php:11 — src/applications/almanac/controller/AlmanacDeviceViewController.php:11-81 | src/applications/almanac/controller/AlmanacNamespaceViewController.php:11-54 | src/applications/almanac/controller/AlmanacNetworkViewController.php:11-54 | src/applications/almanac/controller/AlmanacServiceViewController.php:11-69 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/almanac/phid/AlmanacDevicePHIDType.php:32 — src/applications/almanac/phid/AlmanacDevicePHIDType.php:32-41 | src/applications/almanac/phid/AlmanacNamespacePHIDType.php:32-41 | src/applications/almanac/phid/AlmanacNetworkPHIDType.php:32-41 | src/applications/almanac/phid/AlmanacServicePHIDType.php:32-41 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:25 — src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:25-76 | src/applications/almanac/xaction/AlmanacNamespaceNameTransaction.php:34-88 | src/applications/almanac/xaction/AlmanacNetworkNameTransaction.php:34-72 | src/applications/almanac/xaction/AlmanacServiceNameTransaction.php:34-85 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/auth/query/PhabricatorAuthInviteQuery.php:63 — src/applications/auth/query/PhabricatorAuthInviteQuery.php:63-107 | src/applications/phortune/query/PhortunePaymentProviderConfigQuery.php:63-88 | src/applications/phortune/query/PhortuneProductQuery.php:81-113 | src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php:172-216 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:17 — src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:17-36 | src/applications/calendar/xaction/PhabricatorCalendarImportNameTransaction.php:17-36 | src/applications/repository/xaction/PhabricatorRepositoryCallsignTransaction.php:25-44 | src/applications/repository/xaction/PhabricatorRepositoryStagingURITransaction.php:17-37 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:176 — src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:176-272 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:69-112 | src/applications/project/controller/PhabricatorProjectManageController.php:76-128 | src/applications/spaces/controller/PhabricatorSpacesViewController.php:96-133 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:7 — src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:7-33 | src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php:7-35 | src/applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php:7-43 | REDACTED:7-33 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/console/controller/DarkConsoleController.php:48 — src/applications/console/controller/DarkConsoleController.php:48-72 | src/applications/policy/controller/PhabricatorPolicyEditController.php:266-344 | src/applications/search/controller/PhabricatorApplicationSearchController.php:978-996 | src/applications/settings/panel/PhabricatorSettingsPanel.php:291-302 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/differential/typeahead/DifferentialBlockingReviewerDatasource.php:104 — src/applications/differential/typeahead/DifferentialBlockingReviewerDatasource.php:104-125 | src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:91-112 | src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php:120-146 | src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php:114-135 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/diffusion/engineextension/DiffusionDatasourceEngineExtension.php:14 — src/applications/diffusion/engineextension/DiffusionDatasourceEngineExtension.php:14-79 | src/applications/phriction/engineextension/PhrictionDatasourceEngineExtension.php:13-54 | src/applications/project/engineextension/ProjectDatasourceEngineExtension.php:13-55 | src/applications/search/engineextension/PhabricatorFerretSearchEngineExtension.php:30-51 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:27 — src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:27-124 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:21-82 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php:21-105 | src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php:22-120 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/drydock/controller/DrydockBlueprintViewController.php:145 — src/applications/drydock/controller/DrydockBlueprintViewController.php:145-180 | src/applications/drydock/controller/DrydockBlueprintViewController.php:184-246 | src/applications/drydock/controller/DrydockController.php:98-110 | src/applications/drydock/controller/DrydockResourceViewController.php:173-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) src/applications/files/controller/PhabricatorFileTransformListController.php:11 — src/applications/files/controller/PhabricatorFileTransformListController.php:11-144 | src/applications/macro/controller/PhabricatorMacroAudioController.php:6-162 | src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php:15-231 | src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:211-292 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/files/controller/PhabricatorFileViewController.php:10 — src/applications/files/controller/PhabricatorFileViewController.php:10-93 | src/applications/harbormaster/controller/HarbormasterPlanViewController.php:10-89 | src/applications/legalpad/controller/LegalpadDocumentManageController.php:6-78 | src/applications/phurl/controller/PhabricatorPhurlURLViewController.php:11-62 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/harbormaster/controller/HarbormasterPlanViewController.php:456 — src/applications/harbormaster/controller/HarbormasterPlanViewController.php:456-497 | src/applications/harbormaster/controller/HarbormasterPlanViewController.php:501-544 | src/applications/herald/controller/HeraldWebhookViewController.php:201-235 | src/applications/owners/controller/PhabricatorOwnersDetailController.php:364-411 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php:25 — src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php:25-68 | src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php:24-57 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php:18-73 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:163-531 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/passphrase/controller/PassphraseCredentialConduitController.php:7 — src/applications/passphrase/controller/PassphraseCredentialConduitController.php:7-87 | src/applications/passphrase/controller/PassphraseCredentialDestroyController.php:7-57 | src/applications/passphrase/controller/PassphraseCredentialLockController.php:7-71 | src/applications/passphrase/controller/PassphraseCredentialPublicController.php:7-47 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/people/editor/PhabricatorUserEditor.php:222 — src/applications/people/editor/PhabricatorUserEditor.php:222-261 | src/applications/people/editor/PhabricatorUserEditor.php:271-334 | src/applications/people/editor/PhabricatorUserEditor.php:350-394 | src/applications/people/editor/PhabricatorUserEditor.php:404-447 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:60 — src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:60-123 | src/applications/phortune/controller/account/PhortuneAccountManagersController.php:41-85 | src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:99-148 | src/applications/phortune/controller/merchant/PhortuneMerchantManagersController.php:38-87 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/phriction/conduit/PhrictionCreateConduitAPIMethod.php:27 — src/applications/phriction/conduit/PhrictionCreateConduitAPIMethod.php:27-70 | src/applications/phriction/conduit/PhrictionEditConduitAPIMethod.php:27-74 | src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php:40-64 | src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php:40-54 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/uiexample/examples/PHUIBoxExample.php:15 — src/applications/uiexample/examples/PHUIBoxExample.php:15-120 | src/applications/uiexample/examples/PHUIButtonExample.php:16-225 | src/applications/uiexample/examples/PHUILeftRightExample.php:14-70 | src/applications/uiexample/examples/PHUIListExample.php:16-298 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/applications/uiexample/examples/PHUIColorPalletteExample.php:19 — src/applications/uiexample/examples/PHUIColorPalletteExample.php:19-127 | src/applications/uiexample/examples/PHUIIconExample.php:30-247 | src/applications/uiexample/examples/PHUIImageMaskExample.php:14-85 | src/applications/uiexample/examples/PHUITagExample.php:16-229 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×21
  • Duplicated block (17 lines × 2) src/applications/almanac/controller/AlmanacBindingViewController.php:63 — src/applications/almanac/controller/AlmanacBindingViewController.php:63-79 | src/applications/meta/controller/PhabricatorApplicationDetailViewController.php:63-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) src/applications/auth/controller/contact/PhabricatorAuthContactNumberPrimaryController.php:8 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberPrimaryController.php:8-24 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberTestController.php:8-24 — 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) src/applications/auth/provider/PhabricatorJIRAAuthProvider.php:123 — src/applications/auth/provider/PhabricatorJIRAAuthProvider.php:123-139 | src/applications/auth/provider/PhabricatorPhabricatorAuthProvider.php:107-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/provider/PhabricatorJIRAAuthProvider.php:123` it does not close everything it opens, so those exact lines 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) src/applications/calendar/typeahead/PhabricatorCalendarInviteeDatasource.php:31 — src/applications/calendar/typeahead/PhabricatorCalendarInviteeDatasource.php:31-47 | src/applications/differential/typeahead/DifferentialResponsibleDatasource.php:32-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/typeahead/PhabricatorCalendarInviteeDatasource.php:31` it does not close everything it opens, so those exact lines 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) src/applications/differential/customfield/DifferentialCustomField.php:47 — src/applications/differential/customfield/DifferentialCustomField.php:47-63 | src/applications/differential/field/DifferentialCommitMessageField.php:133-149 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/differential/field/DifferentialCommitMessageField.php:131` calls `getViewer`, `loadHandles` and `src/applications/differential/customfield/DifferentialCustomField.php:45` 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 (17 lines × 2) src/applications/differential/xaction/DifferentialRevisionAbandonTransaction.php:60 — src/applications/differential/xaction/DifferentialRevisionAbandonTransaction.php:60-76 | src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php:74-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/xaction/DifferentialRevisionAbandonTransaction.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 (17 lines × 2) src/applications/differential/xaction/DifferentialRevisionBuildableTransaction.php:43 — src/applications/differential/xaction/DifferentialRevisionBuildableTransaction.php:43-59 | src/applications/diffusion/xaction/DiffusionCommitBuildableTransaction.php:39-55 — before extracting anything, compare `src/applications/differential/xaction/DifferentialRevisionBuildableTransaction.php` and `src/applications/diffusion/xaction/DiffusionCommitBuildableTransaction.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 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 (17 lines × 2) src/applications/diffusion/controller/DiffusionBranchTableController.php:87 — src/applications/diffusion/controller/DiffusionBranchTableController.php:87-103 | src/applications/diffusion/controller/DiffusionBrowseController.php:79-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) src/applications/drydock/storage/DrydockLease.php:471 — src/applications/drydock/storage/DrydockLease.php:471-487 | src/applications/drydock/storage/DrydockResource.php:258-274 — before extracting anything, compare `src/applications/drydock/storage/DrydockLease.php` and `src/applications/drydock/storage/DrydockResource.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php:154 — src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php:154-170 | src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php:188-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php:154` calls `addHeader` and `src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php:188` 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 (17 lines × 2) src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:50 — src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:50-66 | src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:120-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:137` calls `renderObject` and `src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:67` 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 (17 lines × 2) src/applications/packages/xaction/package/PhabricatorPackagesPackagePublisherTransaction.php:21 — src/applications/packages/xaction/package/PhabricatorPackagesPackagePublisherTransaction.php:21-37 | src/applications/packages/xaction/version/PhabricatorPackagesVersionPackageTransaction.php:20-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/packages/xaction/package/PhabricatorPackagesPackagePublisherTransaction.php:21` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) src/applications/people/controller/PhabricatorPeopleProfileViewController.php:92 — src/applications/people/controller/PhabricatorPeopleProfileViewController.php:92-108 | src/applications/project/controller/PhabricatorProjectProfileController.php:162-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:370 — src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:370-386 | src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:387-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:51 — src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:51-67 | src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementRetryWorkflow.php:44-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementRetryWorkflow.php:62` calls `unarchiveTask` and `src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:69` 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 (17 lines × 2) src/infrastructure/env/PhabricatorEnv.php:738 — src/infrastructure/env/PhabricatorEnv.php:738-754 | src/infrastructure/env/PhabricatorEnv.php:805-821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) src/applications/almanac/xaction/AlmanacBindingDisableTransaction.php:9 — src/applications/almanac/xaction/AlmanacBindingDisableTransaction.php:9-25 | src/applications/herald/xaction/HeraldRuleDisableTransaction.php:9-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/xaction/AlmanacBindingDisableTransaction.php:9` 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) src/applications/calendar/xaction/PhabricatorCalendarExportDisableTransaction.php:9 — src/applications/calendar/xaction/PhabricatorCalendarExportDisableTransaction.php:9-25 | src/applications/calendar/xaction/PhabricatorCalendarImportDisableTransaction.php:9-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/xaction/PhabricatorCalendarExportDisableTransaction.php:9` 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) src/applications/maniphest/editor/ManiphestTaskEditEngineLock.php:9 — src/applications/maniphest/editor/ManiphestTaskEditEngineLock.php:9-25 | src/applications/phame/editor/PhamePostEditEngineLock.php:9-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/maniphest/editor/ManiphestTaskEditEngineLock.php:9` 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 (17 lines × 2) src/applications/search/relationship/DiffusionCommitRelationshipSource.php:7 — src/applications/search/relationship/DiffusionCommitRelationshipSource.php:7-23 | src/applications/search/relationship/PholioMockRelationshipSource.php:7-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/search/relationship/DiffusionCommitRelationshipSource.php:7` 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) src/applications/packages/storage/PhabricatorPackagesPackage.php:82 — src/applications/packages/storage/PhabricatorPackagesPackage.php:82-98 | src/applications/packages/storage/PhabricatorPackagesPublisher.php:58-74 — 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.
D3 · God Classes · FunctionTooLong · ×19
  • FunctionTooLong: behavior-pholio-mock-view.JX.behavior("pholio-mock-view") webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:16 — FunctionTooLong — JX.behavior("pholio-mock-view") runs 517 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 417 over it, 5.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-document-engine.JX.behavior("document-engine") webroot/rsrc/js/application/files/behavior-document-engine.js:8 — FunctionTooLong — JX.behavior("document-engine") runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× 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: behavior-fancy-datepicker.JX.behavior("fancy-datepicker") webroot/rsrc/js/core/behavior-fancy-datepicker.js:10 — FunctionTooLong — JX.behavior("fancy-datepicker") runs 282 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 182 over it, 2.82× 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: behavior-menu.JX.behavior("conpherence-menu") REDACTED:17 — FunctionTooLong — JX.behavior("conpherence-menu") runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× 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: behavior-phabricator-remarkup-assist.JX.behavior("phabricator-remarkup-assist") webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:14 — FunctionTooLong — JX.behavior("phabricator-remarkup-assist") runs 255 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× 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: behavior-dark-console.JX.behavior("dark-console") webroot/rsrc/js/core/darkconsole/behavior-dark-console.js:13 — FunctionTooLong — JX.behavior("dark-console") runs 254 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× 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: behavior-lightbox-attachments.JX.behavior("lightbox-attachments") webroot/rsrc/js/core/behavior-lightbox-attachments.js:12 — FunctionTooLong — JX.behavior("lightbox-attachments") runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.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.
  • FunctionTooLong: behavior-day-view.JX.behavior("day-view") webroot/rsrc/js/application/calendar/behavior-day-view.js:5 — FunctionTooLong — JX.behavior("day-view") runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-durable-column.JX.behavior("durable-column") webroot/rsrc/js/application/conpherence/behavior-durable-column.js:13 — FunctionTooLong — JX.behavior("durable-column") runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: repository-crossreference.JX.behavior("repository-crossreference") webroot/rsrc/js/application/repository/repository-crossreference.js:9 — FunctionTooLong — JX.behavior("repository-crossreference") runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-pholio-mock-edit.JX.behavior("pholio-mock-edit") webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:12 — FunctionTooLong — JX.behavior("pholio-mock-edit") runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-object-selector.JX.behavior("phabricator-object-selector") webroot/rsrc/js/core/behavior-object-selector.js:9 — FunctionTooLong — JX.behavior("phabricator-object-selector") runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× 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: behavior-comment-actions.JX.behavior("comment-actions") webroot/rsrc/js/application/transactions/behavior-comment-actions.js:12 — FunctionTooLong — JX.behavior("comment-actions") runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: behavior-oncopy.JX.behavior("phabricator-oncopy") webroot/rsrc/js/core/behavior-oncopy.js:7 — FunctionTooLong — JX.behavior("phabricator-oncopy") runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-aphlict-dropdown.JX.behavior("aphlict-dropdown") webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js:14 — FunctionTooLong — JX.behavior("aphlict-dropdown") runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-search-typeahead.JX.behavior("phabricator-search-typeahead") webroot/rsrc/js/core/behavior-search-typeahead.js:14 — FunctionTooLong — JX.behavior("phabricator-search-typeahead") runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-policy-rule-editor.JX.behavior("policy-rule-editor") webroot/rsrc/js/application/policy/behavior-policy-rule-editor.js:10 — FunctionTooLong — JX.behavior("policy-rule-editor") 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.
  • FunctionTooLong: behavior-line-linker.JX.behavior("phabricator-line-linker") webroot/rsrc/js/core/behavior-line-linker.js:10 — FunctionTooLong — JX.behavior("phabricator-line-linker") runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: behavior-project-boards.JX.behavior("project-boards") webroot/rsrc/js/application/projects/behavior-project-boards.js:13 — FunctionTooLong — JX.behavior("project-boards") runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×17
  • Duplicated block (20 lines × 2) src/applications/almanac/xaction/AlmanacDeviceStatusTransaction.php:39 — src/applications/almanac/xaction/AlmanacDeviceStatusTransaction.php:39-58 | src/applications/dashboard/xaction/dashboard/PhabricatorDashboardLayoutTransaction.php:32-51 — 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 (20 lines × 2) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:58 — src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:58-77 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:79-98 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) src/applications/dashboard/install/PhabricatorDashboardPortalInstallWorkflow.php:39 — src/applications/dashboard/install/PhabricatorDashboardPortalInstallWorkflow.php:39-58 | src/applications/dashboard/install/PhabricatorDashboardProjectInstallWorkflow.php:40-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 `src/applications/dashboard/install/PhabricatorDashboardPortalInstallWorkflow.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. 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 × 2) src/applications/herald/adapter/HeraldAdapter.php:334 — src/applications/herald/adapter/HeraldAdapter.php:334-353 | src/applications/herald/adapter/HeraldAdapter.php:723-742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/herald/adapter/HeraldAdapter.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 (20 lines × 2) src/applications/packages/xaction/package/PhabricatorPackagesPackagePublisherTransaction.php:40 — src/applications/packages/xaction/package/PhabricatorPackagesPackagePublisherTransaction.php:40-59 | src/applications/packages/xaction/version/PhabricatorPackagesVersionPackageTransaction.php:39-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 × 2) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:103 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:103-122 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:204-223 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.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 (20 lines × 2) src/applications/phame/query/PhameBlogQuery.php:51 — src/applications/phame/query/PhameBlogQuery.php:51-70 | src/applications/project/query/PhabricatorProjectQuery.php:486-505 — 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 (20 lines × 2) src/applications/pholio/controller/PholioMockArchiveController.php:39 — src/applications/pholio/controller/PholioMockArchiveController.php:39-58 | src/applications/slowvote/controller/PhabricatorSlowvoteCloseController.php:40-59 — before extracting anything, compare `src/applications/pholio/controller/PholioMockArchiveController.php` and `src/applications/slowvote/controller/PhabricatorSlowvoteCloseController.php` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/pholio/controller/PholioMockArchiveController.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 (20 lines × 2) src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php:112 — src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php:112-131 | src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php:148-167 — before extracting anything, compare `src/applications/project/order/PhabricatorProjectColumnAuthorOrder.php` and `src/applications/project/order/PhabricatorProjectColumnOwnerOrder.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (20 lines × 2) src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php:55 — src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php:55-74 | src/applications/repository/xaction/PhabricatorRepositoryTouchLimitTransaction.php:54-73 — before extracting anything, compare `src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php` and `src/applications/repository/xaction/PhabricatorRepositoryTouchLimitTransaction.php` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the 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 (20 lines × 2) src/applications/repository/xaction/PhabricatorRepositoryDefaultBranchTransaction.php:17 — src/applications/repository/xaction/PhabricatorRepositoryDefaultBranchTransaction.php:17-36 | src/applications/repository/xaction/PhabricatorRepositorySVNSubpathTransaction.php:17-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 × 2) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementDelayWorkflow.php:46 — src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementDelayWorkflow.php:46-65 | src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementFreeWorkflow.php:19-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementDelayWorkflow.php:46` it does not close everything it opens, so those 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 (20 lines × 2) src/infrastructure/export/engine/PhabricatorProjectsExportEngineExtension.php:24 — src/infrastructure/export/engine/PhabricatorProjectsExportEngineExtension.php:24-43 | src/infrastructure/export/engine/PhabricatorSubscriptionsExportEngineExtension.php:24-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/export/engine/PhabricatorProjectsExportEngineExtension.php:24` it does not close everything it opens, so those exact lines 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) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:569 — src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:569-588 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:603-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 `src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.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 (20 lines × 2) src/applications/differential/herald/DifferentialDiffAuthorProjectsHeraldField.php:9 — src/applications/differential/herald/DifferentialDiffAuthorProjectsHeraldField.php:9-28 | src/applications/differential/herald/DifferentialRevisionAuthorProjectsHeraldField.php:9-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/herald/DifferentialDiffAuthorProjectsHeraldField.php:9` 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 (20 lines × 2) src/applications/differential/herald/DifferentialDiffRepositoryProjectsHeraldField.php:9 — src/applications/differential/herald/DifferentialDiffRepositoryProjectsHeraldField.php:9-28 | src/applications/differential/herald/DifferentialRevisionRepositoryProjectsHeraldField.php:9-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/herald/DifferentialDiffRepositoryProjectsHeraldField.php:9` 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 (20 lines × 2) src/applications/diffusion/remarkup/DiffusionRepositoryByIDRemarkupRule.php:7 — src/applications/diffusion/remarkup/DiffusionRepositoryByIDRemarkupRule.php:7-26 | src/applications/diffusion/remarkup/DiffusionRepositoryRemarkupRule.php:7-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/remarkup/DiffusionRepositoryByIDRemarkupRule.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×16
  • Duplicated block (22 lines × 2) src/applications/almanac/xaction/AlmanacServiceTypeTransaction.php:32 — src/applications/almanac/xaction/AlmanacServiceTypeTransaction.php:32-53 | src/applications/drydock/xaction/DrydockBlueprintTypeTransaction.php:33-54 — 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 (22 lines × 2) src/applications/audit/storage/PhabricatorAuditTransaction.php:202 — src/applications/audit/storage/PhabricatorAuditTransaction.php:202-223 | src/applications/audit/storage/PhabricatorAuditTransaction.php:336-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/audit/storage/PhabricatorAuditTransaction.php:202` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/audit/storage/PhabricatorAuditTransaction.php:200` calls `renderHandleLink`, `getObjectPHID` and `src/applications/audit/storage/PhabricatorAuditTransaction.php:334` 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) src/applications/auth/xaction/PhabricatorAuthFactorProviderDuoCredentialTransaction.php:28 — src/applications/auth/xaction/PhabricatorAuthFactorProviderDuoCredentialTransaction.php:28-49 | src/applications/auth/xaction/PhabricatorAuthFactorProviderDuoHostnameTransaction.php:27-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/xaction/PhabricatorAuthFactorProviderDuoCredentialTransaction.php:28` it does not close everything it opens, so those 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, `src/applications/auth/xaction/PhabricatorAuthFactorProviderDuoCredentialTransaction.php:27` calls `getActor` and `src/applications/auth/xaction/PhabricatorAuthFactorProviderDuoHostnameTransaction.php:26` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (22 lines × 2) src/applications/config/check/PhabricatorMySQLSetupCheck.php:202 — src/applications/config/check/PhabricatorMySQLSetupCheck.php:202-223 | src/applications/config/check/PhabricatorMySQLSetupCheck.php:268-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 `src/applications/config/check/PhabricatorMySQLSetupCheck.php:202` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/config/check/PhabricatorMySQLSetupCheck.php:289` calls `phutil_tag`, `array` and `src/applications/config/check/PhabricatorMySQLSetupCheck.php:223` 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 (22 lines × 2) src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:83 — src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:83-104 | src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php:74-95 — before extracting anything, compare `src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.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. 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 (22 lines × 2) src/applications/drydock/management/DrydockManagementUpdateLeaseWorkflow.php:33 — src/applications/drydock/management/DrydockManagementUpdateLeaseWorkflow.php:33-54 | src/applications/drydock/management/DrydockManagementUpdateResourceWorkflow.php:33-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (22 lines × 2) src/applications/files/controller/PhabricatorFileDetachController.php:15 — src/applications/files/controller/PhabricatorFileDetachController.php:15-36 | src/applications/files/controller/PhabricatorFileUICurtainAttachController.php:26-47 — before extracting anything, compare `src/applications/files/controller/PhabricatorFileDetachController.php` and `src/applications/files/controller/PhabricatorFileUICurtainAttachController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (22 lines × 2) src/applications/files/management/PhabricatorFilesManagementCycleWorkflow.php:94 — src/applications/files/management/PhabricatorFilesManagementCycleWorkflow.php:94-115 | src/applications/files/management/PhabricatorFilesManagementEncodeWorkflow.php:116-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 `src/applications/files/management/PhabricatorFilesManagementCycleWorkflow.php:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (22 lines × 2) src/applications/harbormaster/query/HarbormasterBuildArtifactQuery.php:44 — src/applications/harbormaster/query/HarbormasterBuildArtifactQuery.php:44-65 | src/applications/harbormaster/query/HarbormasterBuildLogQuery.php:31-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (22 lines × 2) src/applications/maniphest/controller/ManiphestTaskDetailController.php:89 — src/applications/maniphest/controller/ManiphestTaskDetailController.php:89-110 | src/applications/maniphest/controller/ManiphestTaskGraphController.php:34-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 `src/applications/maniphest/controller/ManiphestTaskDetailController.php:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/maniphest/controller/ManiphestTaskGraphController.php:33` calls `setIsStandalone` and `src/applications/maniphest/controller/ManiphestTaskDetailController.php:88` 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) src/applications/pholio/query/PholioMockQuery.php:81 — src/applications/pholio/query/PholioMockQuery.php:81-102 | src/applications/slowvote/query/PhabricatorSlowvoteQuery.php:126-147 — before extracting anything, compare `src/applications/pholio/query/PholioMockQuery.php` and `src/applications/slowvote/query/PhabricatorSlowvoteQuery.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 lines × 2) src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:78 — src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:78-99 | src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:125-146 — 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 (22 lines × 2) src/applications/phortune/query/PhortuneAccountQuery.php:88 — src/applications/phortune/query/PhortuneAccountQuery.php:88-109 | src/applications/phortune/query/PhortuneMerchantQuery.php:82-103 — before extracting anything, compare `src/applications/phortune/query/PhortuneAccountQuery.php` and `src/applications/phortune/query/PhortuneMerchantQuery.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (22 lines × 2) src/applications/phame/xaction/PhameBlogHeaderImageTransaction.php:10 — src/applications/phame/xaction/PhameBlogHeaderImageTransaction.php:10-31 | src/applications/phame/xaction/PhamePostHeaderImageTransaction.php:9-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/xaction/PhameBlogHeaderImageTransaction.php:10` 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 lines × 2) src/applications/phame/xaction/PhameBlogProfileImageTransaction.php:10 — src/applications/phame/xaction/PhameBlogProfileImageTransaction.php:10-31 | src/applications/phortune/xaction/PhortuneMerchantPictureTransaction.php:9-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/xaction/PhameBlogProfileImageTransaction.php:10` 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 (22 lines × 2) src/applications/passphrase/xaction/PassphraseCredentialLookedAtTransaction.php:9 — src/applications/passphrase/xaction/PassphraseCredentialLookedAtTransaction.php:9-36 | src/applications/pholio/xaction/PholioMockInlineTransaction.php:9-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/passphrase/xaction/PassphraseCredentialLookedAtTransaction.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×15
  • Duplicated block (19 lines × 2) src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:28 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:28-46 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:32-50 — before extracting anything, compare `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php` and `src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) REDACTED:102 — REDACTED:102-120 | src/applications/auth/provider/PhabricatorOAuth2AuthProvider.php:82-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 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 (19 lines × 2) src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:103 — src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:103-121 | src/applications/calendar/controller/PhabricatorCalendarImportViewController.php:117-135 — before extracting anything, compare `src/applications/calendar/controller/PhabricatorCalendarExportViewController.php` and `src/applications/calendar/controller/PhabricatorCalendarImportViewController.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarExportViewController.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 (19 lines × 2) src/applications/conduit/query/PhabricatorConduitLogQuery.php:86 — src/applications/conduit/query/PhabricatorConduitLogQuery.php:86-104 | src/applications/diffusion/query/DiffusionCommitQuery.php:675-693 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conduit/query/PhabricatorConduitLogQuery.php:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php:155 — src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php:155-173 | src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php:116-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/query/PhabricatorDashboardSearchEngine.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. 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 × 2) src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:521 — src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:521-539 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:554-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) src/applications/differential/xaction/DifferentialRevisionBuildableTransaction.php:63 — src/applications/differential/xaction/DifferentialRevisionBuildableTransaction.php:63-81 | src/applications/diffusion/xaction/DiffusionCommitBuildableTransaction.php:59-77 — before extracting anything, compare `src/applications/differential/xaction/DifferentialRevisionBuildableTransaction.php` and `src/applications/diffusion/xaction/DiffusionCommitBuildableTransaction.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 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 (19 lines × 2) src/applications/diffusion/herald/DiffusionCommitWrongBuildsHeraldField.php:21 — src/applications/diffusion/herald/DiffusionCommitWrongBuildsHeraldField.php:21-39 | src/applications/diffusion/herald/DiffusionPreCommitContentWrongBuildsHeraldField.php:21-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/herald/DiffusionCommitWrongBuildsHeraldField.php:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:63 — src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:63-81 | src/applications/phortune/controller/merchant/PhortuneMerchantOverviewController.php:110-128 — 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) src/applications/project/controller/PhabricatorProjectArchiveController.php:26 — src/applications/project/controller/PhabricatorProjectArchiveController.php:26-44 | src/applications/project/controller/PhabricatorProjectColumnHideController.php:59-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 both call sites, so a change lands once.
  • Duplicated block (19 lines × 2) src/applications/project/controller/PhabricatorProjectUpdateController.php:60 — src/applications/project/controller/PhabricatorProjectUpdateController.php:60-78 | src/applications/project/controller/PhabricatorProjectWatchController.php:57-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/controller/PhabricatorProjectUpdateController.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 × 2) src/applications/config/option/PhabricatorClusterConfigOptions.php:7 — src/applications/config/option/PhabricatorClusterConfigOptions.php:7-25 | src/applications/config/option/PhabricatorNotificationConfigOptions.php:7-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/option/PhabricatorClusterConfigOptions.php:7` 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 (19 lines × 2) src/applications/dashboard/editor/PhabricatorDashboardPanelTransactionEditor.php:7 — src/applications/dashboard/editor/PhabricatorDashboardPanelTransactionEditor.php:7-25 | src/applications/dashboard/editor/PhabricatorDashboardTransactionEditor.php:7-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/editor/PhabricatorDashboardPanelTransactionEditor.php:7` 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) src/applications/differential/herald/DifferentialDiffRepositoryHeraldField.php:9 — src/applications/differential/herald/DifferentialDiffRepositoryHeraldField.php:9-27 | src/applications/differential/herald/DifferentialRevisionRepositoryHeraldField.php:9-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/herald/DifferentialDiffRepositoryHeraldField.php:9` 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) src/applications/herald/controller/HeraldTestConsoleController.php:133 — src/applications/herald/controller/HeraldTestConsoleController.php:133-151 | src/applications/herald/management/HeraldTestManagementWorkflow.php:50-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×14
  • Duplicated block (18 lines × 2) src/applications/auth/provider/PhabricatorAsanaAuthProvider.php:54 — src/applications/auth/provider/PhabricatorAsanaAuthProvider.php:54-71 | src/applications/auth/provider/PhabricatorJIRAAuthProvider.php:337-354 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/provider/PhabricatorAsanaAuthProvider.php:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:105 — src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:105-122 | src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:125-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/applications/drydock/controller/DrydockLeaseViewController.php:24 — src/applications/drydock/controller/DrydockLeaseViewController.php:24-41 | src/applications/drydock/controller/DrydockResourceViewController.php:26-43 — before extracting anything, compare `src/applications/drydock/controller/DrydockLeaseViewController.php` and `src/applications/drydock/controller/DrydockResourceViewController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/applications/herald/controller/HeraldWebhookViewController.php:146 — src/applications/herald/controller/HeraldWebhookViewController.php:146-163 | src/applications/phortune/controller/cart/PhortuneCartViewController.php:152-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/herald/controller/HeraldWebhookViewController.php:146` 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) src/applications/meta/controller/PhabricatorApplicationEditController.php:58 — src/applications/meta/controller/PhabricatorApplicationEditController.php:58-75 | src/applications/meta/controller/PhabricatorApplicationUninstallController.php:54-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 `src/applications/meta/controller/PhabricatorApplicationEditController.php:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:40 — src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:40-57 | src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php:37-54 — before extracting anything, compare `src/applications/packages/controller/PhabricatorPackagesPackageViewController.php` and `src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (18 lines × 2) src/applications/people/controller/PhabricatorPeopleProfileEditController.php:7 — src/applications/people/controller/PhabricatorPeopleProfileEditController.php:7-24 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:7-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) src/applications/phame/controller/blog/PhameBlogArchiveController.php:48 — src/applications/phame/controller/blog/PhameBlogArchiveController.php:48-65 | src/applications/project/controller/PhabricatorProjectArchiveController.php:49-66 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogArchiveController.php` and `src/applications/project/controller/PhabricatorProjectArchiveController.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.
  • Duplicated block (18 lines × 2) src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:11 — src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:11-28 | src/applications/phortune/controller/account/PhortuneAccountOverviewController.php:11-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) src/applications/phortune/controller/account/PhortuneAccountEmailRotateController.php:11 — src/applications/phortune/controller/account/PhortuneAccountEmailRotateController.php:11-28 | src/applications/phortune/controller/account/PhortuneAccountEmailStatusController.php:11-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) src/applications/phortune/controller/account/PhortuneAccountEmailStatusController.php:37 — src/applications/phortune/controller/account/PhortuneAccountEmailStatusController.php:37-54 | src/applications/phortune/controller/account/PhortuneAccountEmailStatusController.php:61-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/controller/account/PhortuneAccountEmailStatusController.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. 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) src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1531 — src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1531-1548 | src/applications/transactions/editengine/PhabricatorEditEngine.php:2550-2567 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1531` it begins part-way through the construct above it, so those 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 (18 lines × 2) src/applications/conduit/parametertype/ConduitPHIDListParameterType.php:7 — src/applications/conduit/parametertype/ConduitPHIDListParameterType.php:7-24 | src/applications/conduit/parametertype/ConduitStringListParameterType.php:7-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conduit/parametertype/ConduitPHIDListParameterType.php:7` 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) src/applications/auth/provider/PhabricatorGitHubAuthProvider.php:11 — src/applications/auth/provider/PhabricatorGitHubAuthProvider.php:11-28 | src/applications/auth/provider/PhabricatorWordPressAuthProvider.php:11-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×14
  • Duplicated block (6 lines × 2) src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:678 — src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:678-683 | src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:773-778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:678` it begins part-way through the construct above it, so those 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) src/applications/maniphest/query/ManiphestTaskSearchEngine.php:447 — src/applications/maniphest/query/ManiphestTaskSearchEngine.php:447-452 | src/applications/paste/query/PhabricatorPasteSearchEngine.php:213-218 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/maniphest/query/ManiphestTaskSearchEngine.php:447` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/applications/conpherence/editor/ConpherenceEditor.php:222 — src/applications/conpherence/editor/ConpherenceEditor.php:222-227 | src/applications/fund/editor/FundInitiativeEditor.php:60-66 — 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) src/applications/differential/customfield/DifferentialAuditorsField.php:23 — src/applications/differential/customfield/DifferentialAuditorsField.php:23-28 | src/applications/differential/customfield/DifferentialJIRAIssuesField.php:29-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/applications/fund/editor/FundInitiativeEditor.php:23 — src/applications/fund/editor/FundInitiativeEditor.php:23-28 | src/applications/paste/editor/PhabricatorPasteEditor.php:29-35 — 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) src/applications/fund/xaction/FundInitiativeDescriptionTransaction.php:17 — src/applications/fund/xaction/FundInitiativeDescriptionTransaction.php:17-22 | src/applications/fund/xaction/FundInitiativeRisksTransaction.php:17-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) src/view/phui/calendar/PHUICalendarDayView.php:44 — src/view/phui/calendar/PHUICalendarDayView.php:44-49 | src/view/phui/calendar/PHUICalendarMonthView.php:45-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) src/applications/badges/editor/PhabricatorBadgesEditor.php:88 — src/applications/badges/editor/PhabricatorBadgesEditor.php:88-93 | src/applications/herald/editor/HeraldRuleEditor.php:57-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php:9 — src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php:9-14 | src/applications/calendar/xaction/PhabricatorCalendarEventStartDateTransaction.php:9-14 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) src/applications/fund/phortune/FundBackerCart.php:34 — src/applications/fund/phortune/FundBackerCart.php:34-39 | src/applications/phortune/cart/PhortuneSubscriptionCart.php:35-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) src/applications/metamta/editor/PhabricatorMetaMTAApplicationEmailEditor.php:43 — src/applications/metamta/editor/PhabricatorMetaMTAApplicationEmailEditor.php:43-49 | src/applications/phlux/editor/PhluxVariableEditor.php:39-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) src/applications/pholio/xaction/PholioImageDescriptionTransaction.php:27 — src/applications/pholio/xaction/PholioImageDescriptionTransaction.php:27-32 | src/applications/pholio/xaction/PholioImageSequenceTransaction.php:27-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. 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) src/applications/transactions/view/PhabricatorApplicationTransactionView.php:354 — src/applications/transactions/view/PhabricatorApplicationTransactionView.php:354-359 | src/infrastructure/cluster/PhabricatorDatabaseRef.php:651-656 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) src/infrastructure/customfield/engineextension/PhabricatorCustomFieldSearchEngineExtension.php:56 — src/infrastructure/customfield/engineextension/PhabricatorCustomFieldSearchEngineExtension.php:56-61 | src/infrastructure/export/engine/PhabricatorCustomFieldExportEngineExtension.php:78-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×13
  • Duplicated block (13 lines × 3) src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:43 — src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:43-55 | src/applications/project/xaction/column/PhabricatorProjectColumnNameTransaction.php:54-66 | src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.php:43-55 — before extracting anything, compare `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php` and `src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:39` calls `validateTransactions`, `array` and `src/applications/project/xaction/column/PhabricatorProjectColumnNameTransaction.php:51` 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 (13 lines × 3) src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:108 — src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:108-120 | src/applications/calendar/controller/PhabricatorCalendarImportViewController.php:122-134 | src/applications/fund/controller/FundInitiativeViewController.php:136-148 — before extracting anything, compare `src/applications/calendar/controller/PhabricatorCalendarExportViewController.php` and `src/applications/calendar/controller/PhabricatorCalendarImportViewController.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:108` it begins part-way through the construct above it, so those exact lines 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) src/applications/chatlog/query/PhabricatorChatLogChannelQuery.php:21 — src/applications/chatlog/query/PhabricatorChatLogChannelQuery.php:21-33 | src/applications/chatlog/query/PhabricatorChatLogQuery.php:21-33 | src/applications/legalpad/query/LegalpadDocumentSignatureQuery.php:51-63 — 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 `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 × 3) src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:8 — src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:8-20 | src/applications/diffusion/controller/DiffusionRepositoryEditPublishingController.php:8-20 | src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php:8-20 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php` and `src/applications/diffusion/controller/DiffusionRepositoryEditPublishingController.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 `src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:8` it does not close everything it opens, so those exact lines 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) src/applications/diffusion/controller/DiffusionRepositoryURICredentialController.php:8 — src/applications/diffusion/controller/DiffusionRepositoryURICredentialController.php:8-20 | src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:8-20 | src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:8-20 — 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 lines × 3) src/applications/diffusion/engineextension/DiffusionDatasourceEngineExtension.php:32 — src/applications/diffusion/engineextension/DiffusionDatasourceEngineExtension.php:32-44 | src/applications/phriction/engineextension/PhrictionDatasourceEngineExtension.php:26-38 | src/applications/project/engineextension/ProjectDatasourceEngineExtension.php:26-38 — 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 (13 lines × 3) src/applications/drydock/controller/DrydockLogController.php:99 — src/applications/drydock/controller/DrydockLogController.php:99-111 | src/applications/drydock/controller/DrydockLogController.php:113-125 | src/applications/drydock/controller/DrydockLogController.php:127-139 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/controller/DrydockLogController.php:99` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 3) src/applications/herald/controller/HeraldDisableController.php:47 — src/applications/herald/controller/HeraldDisableController.php:47-59 | src/applications/phame/controller/blog/PhameBlogArchiveController.php:49-61 | src/applications/project/controller/PhabricatorProjectArchiveController.php:50-62 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogArchiveController.php` and `src/applications/project/controller/PhabricatorProjectArchiveController.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 `src/applications/herald/controller/HeraldDisableController.php:47` it begins part-way through the construct above it, so those exact lines 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) src/applications/owners/xaction/PhabricatorOwnersPackageAuthorityTransaction.php:41 — src/applications/owners/xaction/PhabricatorOwnersPackageAuthorityTransaction.php:41-53 | src/applications/owners/xaction/PhabricatorOwnersPackageAutoreviewTransaction.php:41-53 | src/applications/owners/xaction/PhabricatorOwnersPackageDominionTransaction.php:41-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 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 (13 lines × 3) src/applications/phame/xaction/PhameBlogFullDomainTransaction.php:24 — src/applications/phame/xaction/PhameBlogFullDomainTransaction.php:24-36 | src/applications/phame/xaction/PhameBlogParentDomainTransaction.php:17-29 | src/applications/phame/xaction/PhameBlogParentSiteTransaction.php:17-29 — before extracting anything, compare `src/applications/phame/xaction/PhameBlogParentDomainTransaction.php` and `src/applications/phame/xaction/PhameBlogParentSiteTransaction.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. If that is what happened, the fix is to keep one copy and have the 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 × 3) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementCancelWorkflow.php:18 — src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementCancelWorkflow.php:18-31 | src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:33-45 | src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementPriorityWorkflow.php:44-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementCancelWorkflow.php:18` it does not close everything it opens, so those exact lines 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) src/applications/almanac/xaction/AlmanacBindingSetPropertyTransaction.php:9 — src/applications/almanac/xaction/AlmanacBindingSetPropertyTransaction.php:9-21 | src/applications/almanac/xaction/AlmanacDeviceSetPropertyTransaction.php:9-21 | src/applications/almanac/xaction/AlmanacServiceSetPropertyTransaction.php:9-21 — 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 `src/applications/almanac/xaction/AlmanacBindingSetPropertyTransaction.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 3) src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:79 — src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:79-91 | src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php:61-73 | src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobSearchEngine.php:59-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×13
  • Duplicated block (5 lines × 2) src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php:81 — src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php:81-85 | src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php:123-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.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.
  • Duplicated block (5 lines × 2) src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php:70 — src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php:70-74 | src/applications/differential/typeahead/DifferentialResponsibleViewerFunctionDatasource.php:70-74 — before extracting anything, compare `src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php` and `src/applications/differential/typeahead/DifferentialResponsibleViewerFunctionDatasource.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) src/applications/files/editor/PhabricatorFileEditor.php:46 — src/applications/files/editor/PhabricatorFileEditor.php:46-50 | src/applications/phurl/editor/PhabricatorPhurlURLEditor.php:67-71 — 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 (5 lines × 2) src/applications/fund/editor/FundInitiativeEditor.php:49 — src/applications/fund/editor/FundInitiativeEditor.php:49-53 | src/applications/pholio/editor/PholioMockEditor.php:46-50 — 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 (5 lines × 2) src/applications/legalpad/policyrule/PhabricatorLegalpadSignaturePolicyRule.php:65 — src/applications/legalpad/policyrule/PhabricatorLegalpadSignaturePolicyRule.php:65-69 | src/applications/project/policyrule/PhabricatorProjectsBasePolicyRule.php:58-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) src/applications/nuance/xaction/NuanceItemOwnerTransaction.php:20 — src/applications/nuance/xaction/NuanceItemOwnerTransaction.php:20-24 | src/applications/nuance/xaction/NuanceItemQueueTransaction.php:17-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) src/applications/repository/storage/PhabricatorRepositoryPushLog.php:170 — src/applications/repository/storage/PhabricatorRepositoryPushLog.php:170-174 | src/applications/repository/storage/PhabricatorRepositoryRefCursor.php:61-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `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) src/applications/settings/panel/PhabricatorSettingsPanel.php:74 — src/applications/settings/panel/PhabricatorSettingsPanel.php:74-78 | src/applications/settings/panelgroup/PhabricatorSettingsPanelGroup.php:24-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. 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) src/applications/auth/adapter/PhutilTwitchAuthAdapter.php:69 — src/applications/auth/adapter/PhutilTwitchAuthAdapter.php:69-73 | src/applications/auth/adapter/PhutilWordPressAuthAdapter.php:66-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) src/applications/conduit/parametertype/ConduitProjectListParameterType.php:7 — src/applications/conduit/parametertype/ConduitProjectListParameterType.php:7-11 | src/applications/conduit/parametertype/ConduitUserListParameterType.php:7-11 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php:26 — src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php:26-30 | src/applications/phortune/editor/PhortuneCartEditor.php:220-224 — 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 (5 lines × 2) src/applications/differential/storage/DifferentialChangeset.php:439 — src/applications/differential/storage/DifferentialChangeset.php:439-445 | src/applications/differential/storage/DifferentialDiff.php:341-345 — 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 (5 lines × 2) src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php:90 — src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php:90-94 | src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3678-3684 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×12
  • Duplicated block (21 lines × 2) src/applications/almanac/query/AlmanacNamespaceQuery.php:39 — src/applications/almanac/query/AlmanacNamespaceQuery.php:39-59 | src/applications/almanac/query/AlmanacNetworkQuery.php:39-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 `src/applications/almanac/query/AlmanacNamespaceQuery.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. 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) src/applications/audit/storage/PhabricatorAuditTransaction.php:227 — src/applications/audit/storage/PhabricatorAuditTransaction.php:227-247 | src/applications/audit/storage/PhabricatorAuditTransaction.php:250-270 — both copies are in the same file, so extract the 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 (21 lines × 2) src/applications/calendar/controller/PhabricatorCalendarImportDeleteController.php:41 — src/applications/calendar/controller/PhabricatorCalendarImportDeleteController.php:41-61 | src/applications/calendar/controller/PhabricatorCalendarImportReloadController.php:29-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarImportDeleteController.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.
  • Duplicated block (21 lines × 2) src/applications/config/check/PhabricatorMySQLSetupCheck.php:157 — src/applications/config/check/PhabricatorMySQLSetupCheck.php:157-177 | src/applications/config/check/PhabricatorMySQLSetupCheck.php:205-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/check/PhabricatorMySQLSetupCheck.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.
  • Duplicated block (21 lines × 2) src/applications/differential/conduit/DifferentialConduitAPIMethod.php:130 — src/applications/differential/conduit/DifferentialConduitAPIMethod.php:130-150 | src/infrastructure/customfield/engineextension/PhabricatorCustomFieldSearchEngineExtension.php:86-106 — 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 (21 lines × 2) src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:31 — src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:31-51 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:54-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. 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, `src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:77` calls `phutil_tag`, `array`, `getOldFile` and `src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:54` 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) src/applications/diffusion/controller/DiffusionCommitBranchesController.php:20 — src/applications/diffusion/controller/DiffusionCommitBranchesController.php:20-41 | src/applications/diffusion/controller/DiffusionCommitTagsController.php:20-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionCommitBranchesController.php:20` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) src/applications/herald/controller/HeraldRuleController.php:186 — src/applications/herald/controller/HeraldRuleController.php:186-206 | src/applications/herald/controller/HeraldRuleController.php:207-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:107 — src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:107-127 | src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php:104-124 — before extracting anything, compare `src/applications/packages/controller/PhabricatorPackagesPackageViewController.php` and `src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (21 lines × 2) src/applications/phriction/controller/PhrictionDocumentController.php:139 — src/applications/phriction/controller/PhrictionDocumentController.php:139-159 | src/applications/phriction/controller/PhrictionHistoryController.php:116-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phriction/controller/PhrictionDocumentController.php:139` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (21 lines × 2) src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php:211 — src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php:211-231 | src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php:234-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) src/applications/files/management/PhabricatorFilesManagementEncodeWorkflow.php:7 — src/applications/files/management/PhabricatorFilesManagementEncodeWorkflow.php:7-32 | src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php:7-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×12
  • Duplicated block (15 lines × 3) src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.php:7 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.php:7-21 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberPrimaryController.php:7-21 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberTestController.php:7-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The 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, `src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.php:23` calls `getURIData` and `src/applications/auth/controller/contact/PhabricatorAuthContactNumberPrimaryController.php:23` 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 × 3) src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:11 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:11-25 | src/applications/paste/controller/PhabricatorPasteArchiveController.php:11-25 | src/applications/slowvote/controller/PhabricatorSlowvoteCloseController.php:11-25 — before extracting anything, compare `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php` and `src/applications/paste/controller/PhabricatorPasteArchiveController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:11` it does not close everything it opens, so those exact lines 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) src/applications/drydock/query/DrydockBlueprintSearchEngine.php:124 — src/applications/drydock/query/DrydockBlueprintSearchEngine.php:124-138 | src/applications/fund/query/FundInitiativeSearchEngine.php:137-151 | src/applications/ponder/query/PonderQuestionSearchEngine.php:166-180 — 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 `src/applications/drydock/query/DrydockBlueprintSearchEngine.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.
  • Duplicated block (15 lines × 3) src/applications/harbormaster/controller/HarbormasterPlanViewController.php:477 — src/applications/harbormaster/controller/HarbormasterPlanViewController.php:477-491 | src/applications/harbormaster/controller/HarbormasterPlanViewController.php:524-538 | src/applications/owners/controller/PhabricatorOwnersDetailController.php:390-404 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/controller/HarbormasterPlanViewController.php:477` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/owners/controller/PhabricatorOwnersDetailController.php:405` calls `setHeaderIcon`, `id`, `PhabricatorHeraldApplication` and `src/applications/harbormaster/controller/HarbormasterPlanViewController.php:539` 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) src/applications/harbormaster/storage/HarbormasterBuildable.php:404 — src/applications/harbormaster/storage/HarbormasterBuildable.php:404-418 | src/applications/harbormaster/storage/build/HarbormasterBuild.php:511-525 | src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php:407-421 — 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 (15 lines × 3) src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:84 — src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:84-98 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:74-88 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:85-99 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` and `src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/blog/PhameBlogProfilePictureController.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 (15 lines × 3) src/applications/phame/xaction/PhameBlogFullDomainTransaction.php:40 — src/applications/phame/xaction/PhameBlogFullDomainTransaction.php:40-54 | src/applications/phame/xaction/PhameBlogParentDomainTransaction.php:33-47 | src/applications/phame/xaction/PhameBlogParentSiteTransaction.php:33-47 — before extracting anything, compare `src/applications/phame/xaction/PhameBlogParentDomainTransaction.php` and `src/applications/phame/xaction/PhameBlogParentSiteTransaction.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. If that is what happened, the fix is to keep one copy and have the 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 (15 lines × 3) src/applications/phortune/controller/account/PhortuneAccountOrderListController.php:20 — src/applications/phortune/controller/account/PhortuneAccountOrderListController.php:20-34 | src/applications/phortune/controller/merchant/PhortuneMerchantOrderListController.php:20-34 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionListController.php:18-32 — 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 (15 lines × 3) src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:34 — src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:34-48 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationReorderController.php:35-49 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationSubtypeController.php:39-53 — before extracting anything, compare `src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php` and `src/applications/transactions/controller/PhabricatorEditEngineConfigurationReorderController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:50` calls `getEngine` and `src/applications/transactions/controller/PhabricatorEditEngineConfigurationSubtypeController.php:55` 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 × 3) src/applications/auth/provider/PhabricatorDisqusAuthProvider.php:11 — src/applications/auth/provider/PhabricatorDisqusAuthProvider.php:11-25 | src/applications/auth/provider/PhabricatorSlackAuthProvider.php:11-25 | src/applications/auth/provider/PhabricatorTwitchAuthProvider.php:11-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The 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 × 3) src/applications/badges/query/PhabricatorBadgesSearchEngine.php:70 — src/applications/badges/query/PhabricatorBadgesSearchEngine.php:70-84 | src/applications/herald/query/HeraldWebhookSearchEngine.php:53-68 | src/applications/phriction/query/PhrictionDocumentSearchEngine.php:77-91 — 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 (15 lines × 3) src/applications/drydock/query/DrydockLeaseSearchEngine.php:91 — src/applications/drydock/query/DrydockLeaseSearchEngine.php:91-107 | src/applications/drydock/query/DrydockResourceSearchEngine.php:83-98 | src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php:62-76 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×12
  • Duplicated block (11 lines × 3) src/applications/almanac/controller/AlmanacServiceEditController.php:85 — src/applications/almanac/controller/AlmanacServiceEditController.php:85-95 | src/applications/calendar/controller/PhabricatorCalendarImportEditController.php:65-75 | src/applications/nuance/controller/NuanceSourceEditController.php:53-63 — before extracting anything, compare `src/applications/almanac/controller/AlmanacServiceEditController.php` and `src/applications/calendar/controller/PhabricatorCalendarImportEditController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (11 lines × 3) src/applications/almanac/typeahead/AlmanacServiceDatasource.php:38 — src/applications/almanac/typeahead/AlmanacServiceDatasource.php:38-48 | src/applications/harbormaster/controller/HarbormasterBuildViewController.php:643-653 | src/applications/metamta/typeahead/PhabricatorMetaMTAApplicationEmailDatasource.php:33-43 — 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 `src/applications/almanac/typeahead/AlmanacServiceDatasource.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.
  • Duplicated block (11 lines × 3) src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:116 — src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:116-127 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:170-180 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:217-227 — 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 (11 lines × 3) src/applications/drydock/typeahead/DrydockBlueprintDatasource.php:23 — src/applications/drydock/typeahead/DrydockBlueprintDatasource.php:23-33 | src/applications/drydock/typeahead/DrydockLeaseDatasource.php:19-29 | src/applications/drydock/typeahead/DrydockResourceDatasource.php:19-29 — 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 `src/applications/drydock/typeahead/DrydockBlueprintDatasource.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.
  • Duplicated block (11 lines × 3) src/applications/people/controller/PhabricatorPeopleDeleteController.php:8 — src/applications/people/controller/PhabricatorPeopleDeleteController.php:8-18 | src/applications/people/controller/PhabricatorPeopleEmpowerController.php:8-18 | src/applications/people/controller/PhabricatorPeopleRenameController.php:13-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (11 lines × 3) src/applications/phortune/query/PhortuneCartSearchEngine.php:67 — src/applications/phortune/query/PhortuneCartSearchEngine.php:67-77 | src/applications/phortune/query/PhortuneChargeSearchEngine.php:43-53 | src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php:76-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/query/PhortuneCartSearchEngine.php:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/phortune/query/PhortuneCartSearchEngine.php:65` calls `withMerchantPHIDs`, `array`, `getPHID` and `src/applications/phortune/query/PhortuneChargeSearchEngine.php:42` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultCreateController.php:27 — src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultCreateController.php:27-37 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationDisableController.php:27-37 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationIsEditController.php:26-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultCreateController.php:27` it begins part-way through the construct above it, so those 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 × 3) src/applications/metamta/storage/PhabricatorMetaMTAMail.php:1093 — src/applications/metamta/storage/PhabricatorMetaMTAMail.php:1093-1103 | src/applications/tokens/conduit/TokenConduitAPIMethod.php:14-25 | src/applications/tokens/conduit/TokenConduitAPIMethod.php:29-41 — 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. 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) src/applications/dashboard/xaction/dashboard/PhabricatorDashboardStatusTransaction.php:17 — src/applications/dashboard/xaction/dashboard/PhabricatorDashboardStatusTransaction.php:17-28 | src/applications/phame/xaction/PhameBlogStatusTransaction.php:17-27 | src/applications/project/xaction/column/PhabricatorProjectColumnStatusTransaction.php:26-37 — 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 (11 lines × 3) src/applications/harbormaster/constants/HarbormasterBuildStatus.php:274 — src/applications/harbormaster/constants/HarbormasterBuildStatus.php:274-286 | src/applications/harbormaster/constants/HarbormasterBuildableStatus.php:96-106 | src/applications/herald/storage/HeraldWebhook.php:91-102 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (11 lines × 3) src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php:37 — src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php:37-47 | src/applications/packages/query/PhabricatorPackagesPackageSearchEngine.php:23-33 | src/applications/packages/query/PhabricatorPackagesVersionSearchEngine.php:23-33 — 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 `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) src/applications/uiexample/examples/PHUIObjectItemListExample.php:56 — src/applications/uiexample/examples/PHUIObjectItemListExample.php:56-66 | src/applications/uiexample/examples/PHUIObjectItemListExample.php:128-139 | src/applications/uiexample/examples/PHUIObjectItemListExample.php:158-169 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/uiexample/examples/PHUIObjectItemListExample.php:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×11
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/applications/almanac/query/AlmanacDeviceSearchEngine.php:100 — src/applications/almanac/query/AlmanacDeviceSearchEngine.php:100-137 | src/applications/almanac/query/AlmanacServiceSearchEngine.php:93-116 | src/applications/auth/query/PhabricatorAuthSSHKeySearchEngine.php:80-103 | src/applications/nuance/query/NuanceQueueSearchEngine.php:56-74 | src/applications/nuance/query/NuanceSourceSearchEngine.php:65-86 — 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) src/applications/badges/controller/PhabricatorBadgesCommentController.php:7 — src/applications/badges/controller/PhabricatorBadgesCommentController.php:7-61 | src/applications/pholio/controller/PholioMockCommentController.php:6-78 | src/applications/ponder/controller/PonderAnswerCommentController.php:6-60 | src/applications/ponder/controller/PonderQuestionCommentController.php:6-56 | src/applications/slowvote/controller/PhabricatorSlowvoteCommentController.php:7-61 — 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) src/applications/conpherence/query/ConpherenceThreadQuery.php:80 — src/applications/conpherence/query/ConpherenceThreadQuery.php:80-134 | src/applications/phame/query/PhameBlogQuery.php:83-134 | src/applications/phame/query/PhamePostQuery.php:55-99 | src/applications/phortune/query/PhortuneMerchantQuery.php:36-76 | src/applications/repository/query/PhabricatorRepositoryQuery.php:348-409 — 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) src/applications/countdown/controller/PhabricatorCountdownViewController.php:110 — src/applications/countdown/controller/PhabricatorCountdownViewController.php:110-130 | src/applications/passphrase/controller/PassphraseCredentialViewController.php:65-89 | src/applications/paste/controller/PhabricatorPasteViewController.php:153-173 | src/applications/ponder/controller/PonderQuestionViewController.php:182-202 | src/applications/slowvote/controller/PhabricatorSlowvotePollController.php:121-141 — 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) src/applications/differential/constants/DifferentialConstantsModule.php:25 — src/applications/differential/constants/DifferentialConstantsModule.php:25-108 | src/applications/differential/constants/DifferentialConstantsModule.php:112-142 | src/applications/differential/constants/DifferentialConstantsModule.php:146-176 | src/applications/herald/controller/HeraldTranscriptController.php:517-582 | src/applications/herald/controller/HeraldTranscriptController.php:587-677 — 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) src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php:47 — src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php:47-84 | src/applications/diffusion/management/DiffusionRepositoryLimitsManagementPanel.php:46-66 | src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php:44-64 | src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php:40-60 | src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php:42-62 — 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) src/applications/files/controller/PhabricatorFileDetachController.php:7 — src/applications/files/controller/PhabricatorFileDetachController.php:7-117 | src/applications/files/controller/PhabricatorFileUICurtainAttachController.php:7-130 | src/applications/files/controller/PhabricatorFileUICurtainListController.php:11-58 | src/applications/policy/controller/PhabricatorPolicyExplainController.php:11-75 | src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php:11-71 — 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) src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:17 — src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:17-36 | src/applications/phortune/xaction/PhortuneAccountBillingNameTransaction.php:17-36 | src/applications/phortune/xaction/PhortuneMerchantInvoiceEmailTransaction.php:17-35 | src/applications/phortune/xaction/paymentmethod/PhortunePaymentMethodNameTransaction.php:17-36 | src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.php:17-36 — 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) src/applications/phortune/controller/account/PhortuneAccountChargesController.php:40 — src/applications/phortune/controller/account/PhortuneAccountChargesController.php:40-67 | src/applications/phortune/controller/account/PhortuneAccountProfileController.php:103-138 | src/applications/phortune/controller/account/PhortuneAccountSubscriptionViewController.php:110-153 | src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php:41-76 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionsController.php:39-65 — 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) src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php:7 — src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php:7-99 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php:11-79 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php:7-59 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php:7-76 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php:7-92 — 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) src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:7 — src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:7-125 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:7-54 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationReorderController.php:7-123 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationSaveController.php:7-52 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationSubtypeController.php:7-58 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×11
  • Duplicated block (13–14 lines × 2) src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:105 — src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:105-118 | src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:57-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarEventViewController.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) src/applications/calendar/notifications/PhabricatorCalendarNotificationEngine.php:143 — src/applications/calendar/notifications/PhabricatorCalendarNotificationEngine.php:143-155 | src/infrastructure/customfield/storage/PhabricatorCustomFieldStorage.php:68-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/notifications/PhabricatorCalendarNotificationEngine.php:143` it does not close everything it opens, so those exact lines 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) src/applications/differential/controller/DifferentialChangesetViewController.php:123 — src/applications/differential/controller/DifferentialChangesetViewController.php:123-135 | src/applications/differential/controller/DifferentialController.php:173-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13–14 lines × 2) src/applications/differential/management/PhabricatorDifferentialMigrateHunkWorkflow.php:43 — src/applications/differential/management/PhabricatorDifferentialMigrateHunkWorkflow.php:43-56 | src/applications/repository/management/PhabricatorRepositoryManagementThawWorkflow.php:114-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13–14 lines × 2) src/applications/diffusion/conduit/DiffusionLastModifiedQueryConduitAPIMethod.php:25 — src/applications/diffusion/conduit/DiffusionLastModifiedQueryConduitAPIMethod.php:25-37 | src/applications/diffusion/conduit/DiffusionLastModifiedQueryConduitAPIMethod.php:78-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/conduit/DiffusionLastModifiedQueryConduitAPIMethod.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) src/applications/drydock/controller/DrydockLeaseController.php:39 — src/applications/drydock/controller/DrydockLeaseController.php:39-52 | src/applications/drydock/controller/DrydockLogController.php:105-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/controller/DrydockLeaseController.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 (13–14 lines × 2) src/applications/files/diff/PhabricatorDocumentEngineBlocks.php:101 — src/applications/files/diff/PhabricatorDocumentEngineBlocks.php:101-114 | src/applications/files/diff/PhabricatorDocumentEngineBlocks.php:116-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) src/applications/legalpad/controller/LegalpadDocumentSignController.php:561 — src/applications/legalpad/controller/LegalpadDocumentSignController.php:561-574 | src/applications/legalpad/controller/LegalpadDocumentSignController.php:614-626 — both copies are in the same file, so extract the 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–14 lines × 2) src/applications/macro/xaction/PhabricatorMacroAudioTransaction.php:46 — src/applications/macro/xaction/PhabricatorMacroAudioTransaction.php:46-59 | src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php:94-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–14 lines × 2) src/applications/project/controller/PhabricatorProjectBoardBackgroundController.php:18 — src/applications/project/controller/PhabricatorProjectBoardBackgroundController.php:18-31 | src/applications/project/controller/PhabricatorProjectBoardDisableController.php:18-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/controller/PhabricatorProjectBoardBackgroundController.php:18` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/project/controller/PhabricatorProjectBoardDisableController.php:17` calls `withIDs`, `array`, `executeOne` and `src/applications/project/controller/PhabricatorProjectBoardBackgroundController.php:18` 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) src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:299 — src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:299-312 | src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php:33-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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×11
  • Duplicated block (12 lines × 3) src/applications/almanac/controller/AlmanacDeviceViewController.php:19 — src/applications/almanac/controller/AlmanacDeviceViewController.php:19-30 | src/applications/almanac/controller/AlmanacNamespaceViewController.php:17-28 | src/applications/almanac/controller/AlmanacNetworkViewController.php:17-28 — before extracting anything, compare `src/applications/almanac/controller/AlmanacDeviceViewController.php` and `src/applications/almanac/controller/AlmanacNamespaceViewController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) src/applications/auth/controller/PhabricatorAuthSetPasswordController.php:80 — src/applications/auth/controller/PhabricatorAuthSetPasswordController.php:80-91 | src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php:94-105 | src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php:111-122 — 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 `src/applications/auth/controller/PhabricatorAuthSetPasswordController.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 (12 lines × 3) src/applications/badges/xaction/PhabricatorBadgesBadgeFlavorTransaction.php:36 — src/applications/badges/xaction/PhabricatorBadgesBadgeFlavorTransaction.php:36-47 | src/applications/phortune/xaction/PhortuneAccountBillingNameTransaction.php:42-53 | src/applications/phortune/xaction/PhortuneAccountNameTransaction.php:41-52 — 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 `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 × 3) src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:91 — src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:91-102 | src/applications/herald/controller/HeraldWebhookViewController.php:144-155 | src/applications/phortune/controller/cart/PhortuneCartViewController.php:150-161 — 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 `src/applications/calendar/controller/PhabricatorCalendarExportViewController.php:91` it does not close everything it opens, so those 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 (12 lines × 3) src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:128 — src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:128-141 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:122-133 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:207-218 — 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 `src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:134` calls `appendRemarkupInstructions`, `pht` and `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:219` 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 × 3) src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:112 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:112-123 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:175-186 | src/applications/search/controller/PhabricatorApplicationSearchController.php:1079-1090 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) src/applications/drydock/controller/DrydockBlueprintViewController.php:164 — src/applications/drydock/controller/DrydockBlueprintViewController.php:164-175 | src/applications/drydock/controller/DrydockBlueprintViewController.php:230-241 | src/applications/drydock/controller/DrydockResourceViewController.php:187-198 — 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 (12 lines × 3) src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:252 — src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:252-263 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:198-209 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:187-198 — before extracting anything, compare `src/applications/people/controller/PhabricatorPeopleProfilePictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:252` 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 × 3) src/applications/phame/controller/post/PhamePostViewController.php:221 — src/applications/phame/controller/post/PhamePostViewController.php:221-232 | src/applications/phame/controller/post/PhamePostViewController.php:236-247 | src/applications/phame/controller/post/PhamePostViewController.php:259-270 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/post/PhamePostViewController.php:221` it does not close everything it opens, so those 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 (12 lines × 3) src/applications/multimeter/controller/MultimeterSampleController.php:131 — src/applications/multimeter/controller/MultimeterSampleController.php:131-142 | src/applications/multimeter/controller/MultimeterSampleController.php:144-155 | src/applications/multimeter/controller/MultimeterSampleController.php:156-168 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/multimeter/controller/MultimeterSampleController.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. 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 (12 lines × 3) src/applications/fund/xaction/FundInitiativeNameTransaction.php:17 — src/applications/fund/xaction/FundInitiativeNameTransaction.php:17-28 | src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php:20-32 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:17-28 — before extracting anything, compare `src/applications/fund/xaction/FundInitiativeNameTransaction.php` and `src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×11
  • Duplicated block (10 lines × 3) src/applications/badges/controller/PhabricatorBadgesViewController.php:91 — src/applications/badges/controller/PhabricatorBadgesViewController.php:91-100 | src/applications/meta/controller/PhabricatorApplicationDetailViewController.php:163-172 | src/applications/owners/controller/PhabricatorOwnersDetailController.php:249-258 — 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 `src/applications/badges/controller/PhabricatorBadgesViewController.php:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/owners/controller/PhabricatorOwnersDetailController.php:259` calls `setWorkflow` and `src/applications/badges/controller/PhabricatorBadgesViewController.php:101` 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 × 3) src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:34 — src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:34-43 | src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:40-49 | src/applications/phortune/xaction/PhortuneMerchantInvoiceEmailTransaction.php:39-48 — before extracting anything, compare `src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php` and `src/applications/phortune/xaction/PhortuneMerchantInvoiceEmailTransaction.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 `src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:34` it does not close everything it opens, so those 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) src/applications/console/controller/DarkConsoleController.php:51 — src/applications/console/controller/DarkConsoleController.php:51-60 | src/applications/policy/controller/PhabricatorPolicyEditController.php:294-303 | src/applications/search/controller/PhabricatorApplicationSearchController.php:986-995 — 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 (10 lines × 3) src/applications/drydock/controller/DrydockBlueprintViewController.php:168 — src/applications/drydock/controller/DrydockBlueprintViewController.php:168-177 | src/applications/drydock/controller/DrydockBlueprintViewController.php:234-243 | src/applications/drydock/controller/DrydockController.php:98-107 — 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. 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 × 3) src/applications/help/controller/PhabricatorHelpDocumentationController.php:11 — src/applications/help/controller/PhabricatorHelpDocumentationController.php:11-20 | src/applications/meta/controller/PhabricatorApplicationDetailViewController.php:12-21 | src/applications/meta/controller/PhabricatorApplicationEmailCommandsController.php:11-20 — 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 (10 lines × 3) src/applications/phortune/query/PhortuneCartQuery.php:98 — src/applications/phortune/query/PhortuneCartQuery.php:98-107 | src/applications/phortune/query/PhortunePaymentMethodQuery.php:62-71 | src/applications/phortune/query/PhortuneSubscriptionQuery.php:75-84 — 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 `src/applications/phortune/query/PhortuneCartQuery.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/phortune/query/PhortunePaymentMethodQuery.php:72` calls `didRejectResult` and `src/applications/phortune/query/PhortuneCartQuery.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 (10 lines × 3) src/applications/search/controller/PhabricatorApplicationSearchController.php:409 — src/applications/search/controller/PhabricatorApplicationSearchController.php:409-418 | src/applications/search/controller/PhabricatorApplicationSearchController.php:1045-1054 | src/infrastructure/export/engine/PhabricatorExportEngineBulkJobType.php:66-75 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (10 lines × 3) src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php:75 — src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php:75-84 | src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php:44-53 | src/applications/herald/query/HeraldRuleSearchEngine.php:100-109 — 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 (10 lines × 3) src/applications/packages/phid/PhabricatorPackagesPackagePHIDType.php:33 — src/applications/packages/phid/PhabricatorPackagesPackagePHIDType.php:33-42 | src/applications/packages/phid/PhabricatorPackagesPublisherPHIDType.php:33-42 | src/applications/packages/phid/PhabricatorPackagesVersionPHIDType.php:33-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 all 3 call sites, so a change lands once.
  • Duplicated block (10 lines × 3) src/applications/diffusion/engineextension/DiffusionRepositoryURIsSearchEngineAttachment.php:19 — src/applications/diffusion/engineextension/DiffusionRepositoryURIsSearchEngineAttachment.php:19-31 | src/applications/project/engineextension/PhabricatorProjectsMembersSearchEngineAttachment.php:19-28 | src/applications/project/engineextension/PhabricatorProjectsWatchersSearchEngineAttachment.php:19-28 — 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 (10 lines × 3) src/applications/nuance/worker/NuanceWorker.php:10 — src/applications/nuance/worker/NuanceWorker.php:10-22 | src/applications/tokens/editor/PhabricatorTokenGivenEditor.php:147-156 | src/applications/tokens/editor/PhabricatorTokenGivenEditor.php:160-169 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×11
  • Duplicated block (9 lines × 3) src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:52 — src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:52-60 | src/applications/almanac/xaction/AlmanacNetworkNameTransaction.php:61-69 | src/applications/almanac/xaction/AlmanacServiceNameTransaction.php:61-69 — before extracting anything, compare `src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php` and `src/applications/almanac/xaction/AlmanacServiceNameTransaction.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php:29 — src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php:29-38 | src/applications/auth/management/PhabricatorAuthManagementVerifyWorkflow.php:25-33 | src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php:53-62 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php:51` calls `getViewer` and `src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php:28` 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 × 3) src/applications/config/controller/services/PhabricatorConfigServicesController.php:14 — src/applications/config/controller/services/PhabricatorConfigServicesController.php:14-22 | src/applications/config/controller/services/PhabricatorConfigServicesController.php:39-47 | src/applications/config/controller/settings/PhabricatorConfigSettingsController.php:19-27 — 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. 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 × 3) src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:254 — src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:254-262 | src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:274-282 | src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:294-302 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 3) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:110 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:110-118 | src/applications/phame/controller/blog/PhameBlogManageController.php:64-72 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:211-219 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) src/applications/phortune/query/PhortuneCartQuery.php:79 — src/applications/phortune/query/PhortuneCartQuery.php:79-87 | src/applications/phortune/query/PhortunePaymentMethodQuery.php:42-50 | src/applications/phortune/query/PhortuneSubscriptionQuery.php:55-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/query/PhortuneCartQuery.php:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/phortune/query/PhortunePaymentMethodQuery.php:52` calls `didRejectResult` and `src/applications/phortune/query/PhortuneCartQuery.php:89` 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 × 3) src/applications/diffusion/management/DiffusionRepositoryManagementPanelGroup.php:7 — src/applications/diffusion/management/DiffusionRepositoryManagementPanelGroup.php:7-18 | src/applications/herald/action/HeraldActionGroup.php:6-14 | src/applications/herald/field/HeraldFieldGroup.php:6-14 — 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 `src/applications/diffusion/management/DiffusionRepositoryManagementPanelGroup.php:7` 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) src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:79 — src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:79-87 | src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php:49-57 | src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobSearchEngine.php:46-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 (9 lines × 3) src/applications/notification/client/PhabricatorNotificationServerRef.php:70 — src/applications/notification/client/PhabricatorNotificationServerRef.php:70-78 | src/infrastructure/cluster/PhabricatorDatabaseRef.php:295-303 | src/infrastructure/cluster/search/PhabricatorSearchService.php:158-166 — 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 `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) src/applications/people/management/PhabricatorPeopleManagementApproveWorkflow.php:8 — src/applications/people/management/PhabricatorPeopleManagementApproveWorkflow.php:8-16 | src/applications/people/management/PhabricatorPeopleManagementEmpowerWorkflow.php:7-15 | src/applications/people/management/PhabricatorPeopleManagementEnableWorkflow.php:7-15 — 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 (9 lines × 3) src/applications/slowvote/xaction/PhabricatorSlowvoteResponsesTransaction.php:32 — src/applications/slowvote/xaction/PhabricatorSlowvoteResponsesTransaction.php:32-40 | src/applications/slowvote/xaction/PhabricatorSlowvoteStatusTransaction.php:32-41 | src/applications/slowvote/xaction/PhabricatorSlowvoteVotingMethodTransaction.php:32-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D2 · Cognitive Complexity · (anonymous) · ×10
  • (anonymous)::assist (cognitive 26) webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188 — (anonymous)::assist has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 6 (9 pts), boolean chains 6, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • (anonymous)::seek_anchor (cognitive 25) webroot/rsrc/js/core/behavior-watch-anchor.js:34 — (anonymous)::seek_anchor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 3 (5 pts), loops 2 (3 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.
  • (anonymous)::onupdate (cognitive 25) webroot/rsrc/js/core/behavior-audio-source.js:39 — (anonymous)::onupdate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::getNewValue (cognitive 22) webroot/rsrc/js/core/behavior-time-typeahead.js:82 — (anonymous)::getNewValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::blame (cognitive 19) webroot/rsrc/js/application/files/behavior-document-engine.js:262 — (anonymous)::blame has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::findTodayClusters (cognitive 17) webroot/rsrc/js/application/calendar/behavior-day-view.js:7 — (anonymous)::findTodayClusters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (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.
  • (anonymous)::sort_handler (cognitive 16) webroot/rsrc/js/core/behavior-search-typeahead.js:59 — (anonymous)::sort_handler has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::onstartselect (cognitive 16) webroot/rsrc/js/core/behavior-oncopy.js:11 — (anonymous)::onstartselect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), error handling 3, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • (anonymous)::extract_text (cognitive 16) webroot/rsrc/js/core/behavior-oncopy.js:250 — (anonymous)::extract_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::openSearch (cognitive 16) webroot/rsrc/js/application/repository/repository-crossreference.js:123 — (anonymous)::openSearch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×10
  • Duplicated block (8 lines × 3) src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:166 — src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:166-173 | src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:107-114 | src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:141-148 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:162` calls `renderReviewerEditTitle` and `src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.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 (8 lines × 3) src/applications/harbormaster/constants/HarbormasterBuildStatus.php:34 — src/applications/harbormaster/constants/HarbormasterBuildStatus.php:34-41 | src/applications/harbormaster/constants/HarbormasterBuildableStatus.php:24-31 | src/infrastructure/status/PhabricatorObjectStatus.php:15-22 — 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 `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) src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:62 — src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:62-69 | src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php:59-66 | src/applications/packages/controller/PhabricatorPackagesVersionViewController.php:60-67 — before extracting anything, compare `src/applications/packages/controller/PhabricatorPackagesPackageViewController.php` and `src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php:11 — src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php:11-18 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:11-18 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php:11-18 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 3) src/applications/auth/editor/PhabricatorAuthContactNumberEditor.php:27 — src/applications/auth/editor/PhabricatorAuthContactNumberEditor.php:27-34 | src/applications/metamta/editor/PhabricatorMetaMTAApplicationEmailEditor.php:158-165 | src/applications/phurl/editor/PhabricatorPhurlURLEditor.php:100-107 — 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 (8 lines × 3) src/applications/config/type/PhabricatorBoolConfigType.php:39 — src/applications/config/type/PhabricatorBoolConfigType.php:39-46 | src/applications/config/type/PhabricatorIntConfigType.php:26-33 | src/applications/config/type/PhabricatorStringConfigType.php:12-19 — 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) src/applications/drydock/query/DrydockAuthorizationSearchEngine.php:110 — src/applications/drydock/query/DrydockAuthorizationSearchEngine.php:110-117 | src/applications/drydock/query/DrydockLogSearchEngine.php:149-156 | src/applications/drydock/query/DrydockResourceSearchEngine.php:106-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 3) src/applications/pholio/xaction/PholioImageDescriptionTransaction.php:9 — src/applications/pholio/xaction/PholioImageDescriptionTransaction.php:9-16 | src/applications/pholio/xaction/PholioImageNameTransaction.php:9-16 | src/applications/pholio/xaction/PholioImageSequenceTransaction.php:9-16 — 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) src/applications/slowvote/constants/SlowvotePollResponseVisibility.php:23 — src/applications/slowvote/constants/SlowvotePollResponseVisibility.php:23-30 | src/applications/slowvote/constants/SlowvotePollStatus.php:22-29 | src/applications/slowvote/constants/SlowvotePollVotingMethod.php:22-29 — 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) src/applications/slowvote/xaction/PhabricatorSlowvoteResponsesTransaction.php:21 — src/applications/slowvote/xaction/PhabricatorSlowvoteResponsesTransaction.php:21-28 | src/applications/slowvote/xaction/PhabricatorSlowvoteStatusTransaction.php:21-28 | src/applications/slowvote/xaction/PhabricatorSlowvoteVotingMethodTransaction.php:21-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×10
  • Duplicated block (6 lines × 3) src/applications/calendar/parser/data/PhutilCalendarAbsoluteDateTime.php:69 — src/applications/calendar/parser/data/PhutilCalendarAbsoluteDateTime.php:69-74 | src/applications/calendar/parser/data/PhutilCalendarRelativeDateTime.php:63-68 | src/view/form/control/AphrontFormDateControlValue.php:244-249 — 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 (6 lines × 3) src/applications/badges/editor/PhabricatorBadgesEditor.php:107 — src/applications/badges/editor/PhabricatorBadgesEditor.php:107-112 | src/applications/legalpad/editor/LegalpadDocumentEditor.php:159-165 | src/applications/macro/editor/PhabricatorMacroEditor.php:51-56 — 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 `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 × 3) src/applications/badges/storage/PhabricatorBadgesBadge.php:108 — src/applications/badges/storage/PhabricatorBadgesBadge.php:108-113 | src/applications/packages/storage/PhabricatorPackagesPublisher.php:125-130 | src/applications/project/storage/PhabricatorProjectTrigger.php:311-316 — 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 (6 lines × 3) src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php:61 — src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php:61-66 | src/applications/differential/typeahead/DifferentialResponsibleViewerFunctionDatasource.php:61-66 | src/applications/people/typeahead/PhabricatorViewerDatasource.php:64-69 — before extracting anything, compare `src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php` and `src/applications/differential/typeahead/DifferentialResponsibleViewerFunctionDatasource.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. 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 × 3) src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php:44 — src/applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php:44-49 | src/applications/calendar/xaction/PhabricatorCalendarEventStartDateTransaction.php:44-49 | src/applications/countdown/xaction/PhabricatorCountdownEpochTransaction.php:31-36 — 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 (6 lines × 3) src/applications/herald/xaction/HeraldRuleEditTransaction.php:41 — src/applications/herald/xaction/HeraldRuleEditTransaction.php:41-46 | src/applications/transactions/xaction/PhabricatorEditEngineLocksTransaction.php:27-32 | src/applications/transactions/xaction/PhabricatorEditEngineOrderTransaction.php:27-32 — 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 (6 lines × 3) src/applications/people/typeahead/PhabricatorViewerDatasource.php:73 — src/applications/people/typeahead/PhabricatorViewerDatasource.php:73-78 | src/applications/project/typeahead/PhabricatorProjectLogicalOnlyDatasource.php:67-73 | src/applications/project/typeahead/PhabricatorProjectLogicalViewerDatasource.php:95-100 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) src/aphront/httpparametertype/AphrontProjectListHTTPParameterType.php:7 — src/aphront/httpparametertype/AphrontProjectListHTTPParameterType.php:7-12 | src/aphront/httpparametertype/AphrontUserListHTTPParameterType.php:7-12 | src/applications/maniphest/httpparametertype/ManiphestTaskListHTTPParameterType.php:7-12 — 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 (6 lines × 3) src/applications/calendar/phid/PhabricatorCalendarExternalInviteePHIDType.php:33 — src/applications/calendar/phid/PhabricatorCalendarExternalInviteePHIDType.php:33-38 | src/applications/people/phid/PhabricatorPeopleExternalPHIDType.php:32-37 | src/applications/repository/phid/PhabricatorRepositoryRefCursorPHIDType.php:37-43 — 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 (6 lines × 3) src/applications/diffusion/query/DiffusionPullLogSearchEngine.php:178 — src/applications/diffusion/query/DiffusionPullLogSearchEngine.php:178-183 | src/applications/diffusion/query/DiffusionSyncLogSearchEngine.php:146-151 | src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php:99-104 — before extracting anything, compare `src/applications/diffusion/query/DiffusionPullLogSearchEngine.php` and `src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×9
  • Duplicated block (27 lines × 2) src/applications/differential/constants/DifferentialConstantsModule.php:68 — src/applications/differential/constants/DifferentialConstantsModule.php:68-106 | src/applications/herald/controller/HeraldTranscriptController.php:649-675 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/constants/DifferentialConstantsModule.php:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) src/applications/differential/constants/DifferentialConstantsModule.php:114 — src/applications/differential/constants/DifferentialConstantsModule.php:114-140 | src/applications/differential/constants/DifferentialConstantsModule.php:148-174 — both copies are in the same file, so extract the 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 (27 lines × 2) src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:96 — src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:96-122 | src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:164-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php:58 — src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php:58-84 | src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php:37-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (27 lines × 2) src/applications/phortune/codex/PhortunePaymentMethodPolicyCodex.php:7 — src/applications/phortune/codex/PhortunePaymentMethodPolicyCodex.php:7-33 | src/applications/phortune/codex/PhortuneSubscriptionPolicyCodex.php:7-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (27 lines × 2) src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php:67 — src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php:67-93 | src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php:62-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (27 lines × 2) src/applications/project/order/PhabricatorProjectColumnPriorityOrder.php:65 — src/applications/project/order/PhabricatorProjectColumnPriorityOrder.php:65-91 | src/applications/project/order/PhabricatorProjectColumnStatusOrder.php:72-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/order/PhabricatorProjectColumnPriorityOrder.php:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) src/applications/almanac/editor/AlmanacInterfaceEditor.php:7 — src/applications/almanac/editor/AlmanacInterfaceEditor.php:7-33 | src/applications/almanac/editor/AlmanacNamespaceEditor.php:7-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/editor/AlmanacInterfaceEditor.php:7` 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 (27 lines × 2) src/infrastructure/customfield/storage/PhabricatorCustomFieldNumericIndexStorage.php:7 — src/infrastructure/customfield/storage/PhabricatorCustomFieldNumericIndexStorage.php:7-33 | src/infrastructure/customfield/storage/PhabricatorCustomFieldStringIndexStorage.php:7-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/customfield/storage/PhabricatorCustomFieldNumericIndexStorage.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×8
  • Duplicated block (23 lines × 2) src/applications/almanac/query/AlmanacNamespaceSearchEngine.php:66 — src/applications/almanac/query/AlmanacNamespaceSearchEngine.php:66-88 | src/applications/almanac/query/AlmanacNetworkSearchEngine.php:66-88 — before extracting anything, compare `src/applications/almanac/query/AlmanacNamespaceSearchEngine.php` and `src/applications/almanac/query/AlmanacNetworkSearchEngine.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. If that is what happened, the fix is to keep one copy and have the 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 (23 lines × 2) src/applications/differential/parser/DifferentialChangesetParser.php:1680 — src/applications/differential/parser/DifferentialChangesetParser.php:1680-1702 | src/applications/differential/parser/DifferentialChangesetParser.php:1716-1738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/parser/DifferentialChangesetParser.php:1680` it begins part-way through the construct above it, so those exact lines 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) src/applications/diffusion/controller/DiffusionRepositoryURICredentialController.php:7 — src/applications/diffusion/controller/DiffusionRepositoryURICredentialController.php:7-29 | src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:7-29 — 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 (23 lines × 2) src/applications/harbormaster/controller/HarbormasterLintMessagesController.php:11 — src/applications/harbormaster/controller/HarbormasterLintMessagesController.php:11-33 | src/applications/harbormaster/controller/HarbormasterUnitMessageListController.php:11-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/controller/HarbormasterLintMessagesController.php:11` it does not close everything it opens, so those exact lines 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) src/applications/owners/controller/PhabricatorOwnersDetailController.php:82 — src/applications/owners/controller/PhabricatorOwnersDetailController.php:82-104 | src/applications/owners/controller/PhabricatorOwnersDetailController.php:109-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/owners/controller/PhabricatorOwnersDetailController.php:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) src/applications/people/controller/PhabricatorPeopleProfileViewController.php:255 — src/applications/people/controller/PhabricatorPeopleProfileViewController.php:255-277 | src/applications/project/controller/PhabricatorProjectProfileController.php:81-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (23 lines × 2) src/applications/project/controller/PhabricatorProjectBoardDisableController.php:30 — src/applications/project/controller/PhabricatorProjectBoardDisableController.php:30-52 | src/applications/project/controller/PhabricatorProjectBoardViewController.php:991-1013 — before extracting anything, compare `src/applications/project/controller/PhabricatorProjectBoardDisableController.php` and `src/applications/project/controller/PhabricatorProjectBoardViewController.php` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/project/controller/PhabricatorProjectBoardViewController.php:1014` calls `addHiddenInput` and `src/applications/project/controller/PhabricatorProjectBoardDisableController.php:53` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (23 lines × 2) src/applications/search/engine/PhabricatorApplicationSearchEngine.php:747 — src/applications/search/engine/PhabricatorApplicationSearchEngine.php:747-769 | src/applications/search/field/PhabricatorSearchTokenizerField.php:35-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/search/engine/PhabricatorApplicationSearchEngine.php:747` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×8
  • Duplicated block (15–16 lines × 2) src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:130 — src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:130-145 | src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php:114-128 — before extracting anything, compare `src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php` and `src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.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 (15–16 lines × 2) src/applications/auth/storage/PhabricatorAuthSSHKeyTransaction.php:19 — src/applications/auth/storage/PhabricatorAuthSSHKeyTransaction.php:19-34 | src/applications/oauthserver/storage/PhabricatorOAuthServerTransaction.php:23-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/storage/PhabricatorAuthSSHKeyTransaction.php:19` it does not close everything it opens, so those 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 × 2) src/applications/config/check/PhabricatorMySQLSetupCheck.php:87 — src/applications/config/check/PhabricatorMySQLSetupCheck.php:87-102 | src/applications/config/check/PhabricatorMySQLSetupCheck.php:124-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/check/PhabricatorMySQLSetupCheck.php:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–16 lines × 2) src/applications/files/controller/PhabricatorFileUploadController.php:92 — src/applications/files/controller/PhabricatorFileUploadController.php:92-107 | src/applications/phlux/controller/PhluxEditController.php:163-177 — 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 (15–16 lines × 2) src/applications/legalpad/controller/LegalpadDocumentSignController.php:580 — src/applications/legalpad/controller/LegalpadDocumentSignController.php:580-595 | src/applications/legalpad/controller/LegalpadDocumentSignController.php:646-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–16 lines × 2) src/applications/meta/controller/PhabricatorApplicationPanelController.php:11 — src/applications/meta/controller/PhabricatorApplicationPanelController.php:11-25 | src/applications/meta/controller/PhabricatorApplicationUninstallController.php:9-24 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/meta/controller/PhabricatorApplicationUninstallController.php:8` calls `getUser` and `src/applications/meta/controller/PhabricatorApplicationPanelController.php:9` 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–16 lines × 2) src/applications/phortune/controller/account/PhortuneAccountSubscriptionController.php:21 — src/applications/phortune/controller/account/PhortuneAccountSubscriptionController.php:21-36 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionsController.php:20-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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, `src/applications/phortune/controller/account/PhortuneAccountSubscriptionController.php:19` calls `newAccountAuthorityView` and `src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionsController.php:18` 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) src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:206 — src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:206-221 | src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:226-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:222` calls `getTypeName`, `getChildByIndex` and `src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:205` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×8
  • Duplicated block (7 lines × 3) src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php:32 — src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php:32-38 | src/applications/differential/typeahead/DifferentialResponsibleViewerFunctionDatasource.php:32-38 | src/applications/people/typeahead/PhabricatorViewerDatasource.php:38-44 — before extracting anything, compare `src/applications/calendar/typeahead/PhabricatorCalendarInviteeViewerFunctionDatasource.php` and `src/applications/differential/typeahead/DifferentialResponsibleViewerFunctionDatasource.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 (7 lines × 3) src/applications/oauthserver/phid/PhabricatorOAuthServerClientPHIDType.php:32 — src/applications/oauthserver/phid/PhabricatorOAuthServerClientPHIDType.php:32-38 | src/applications/pholio/phid/PholioImagePHIDType.php:32-38 | src/applications/phortune/phid/PhortuneAccountPHIDType.php:32-38 — 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 × 3) src/applications/almanac/constants/AlmanacDeviceStatus.php:22 — src/applications/almanac/constants/AlmanacDeviceStatus.php:22-28 | src/applications/differential/constants/DifferentialLintStatus.php:25-31 | src/applications/differential/constants/DifferentialUnitStatus.php:25-31 — 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 `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 × 3) src/applications/almanac/constants/AlmanacDeviceStatus.php:56 — src/applications/almanac/constants/AlmanacDeviceStatus.php:56-62 | src/applications/differential/constants/DifferentialLintStatus.php:43-49 | src/applications/differential/constants/DifferentialUnitStatus.php:43-49 — 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 × 3) src/applications/almanac/query/AlmanacInterfaceQuery.php:78 — src/applications/almanac/query/AlmanacInterfaceQuery.php:78-84 | src/applications/phriction/query/PhrictionDocumentQuery.php:168-174 | src/applications/repository/query/PhabricatorRepositoryQuery.php:471-477 — 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 `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 × 3) src/applications/auth/provider/PhabricatorAuthProvider.php:103 — src/applications/auth/provider/PhabricatorAuthProvider.php:103-109 | src/applications/harbormaster/stepgroup/HarbormasterBuildStepGroup.php:29-37 | src/applications/project/order/PhabricatorProjectColumnOrder.php:30-38 — 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 × 3) src/applications/files/editor/PhabricatorFileEditor.php:57 — src/applications/files/editor/PhabricatorFileEditor.php:57-63 | src/applications/herald/editor/HeraldRuleEditor.php:74-80 | src/applications/phame/editor/PhameBlogEditor.php:68-74 — 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 `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 × 3) src/applications/fund/controller/FundInitiativeViewController.php:169 — src/applications/fund/controller/FundInitiativeViewController.php:169-175 | src/applications/legalpad/controller/LegalpadDocumentManageController.php:184-190 | src/applications/phurl/controller/PhabricatorPhurlURLViewController.php:66-72 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×7
  • Duplicated block (24 lines × 2) src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:53 — src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:53-76 | src/applications/almanac/xaction/AlmanacServiceNameTransaction.php:62-85 — before extracting anything, compare `src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php` and `src/applications/almanac/xaction/AlmanacServiceNameTransaction.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:53` it begins part-way through the construct above it, so those 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 (24 lines × 2) src/applications/badges/controller/PhabricatorBadgesViewController.php:96 — src/applications/badges/controller/PhabricatorBadgesViewController.php:96-119 | src/applications/paste/controller/PhabricatorPasteViewController.php:116-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/badges/controller/PhabricatorBadgesViewController.php:94` calls `newCurtainView` and `src/applications/paste/controller/PhabricatorPasteViewController.php:114` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (24 lines × 2) src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:165 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:165-191 | src/applications/project/controller/trigger/PhabricatorProjectTriggerViewController.php:172-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (24 lines × 2) src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:165 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:165-192 | src/applications/project/controller/trigger/PhabricatorProjectTriggerViewController.php:133-156 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) src/applications/diviner/query/DivinerAtomQuery.php:274 — src/applications/diviner/query/DivinerAtomQuery.php:274-297 | src/applications/diviner/query/DivinerBookQuery.php:73-96 — 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 (24 lines × 2) src/applications/paste/query/PhabricatorPasteQuery.php:240 — src/applications/paste/query/PhabricatorPasteQuery.php:240-263 | src/applications/paste/query/PhabricatorPasteQuery.php:301-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/paste/query/PhabricatorPasteQuery.php:240` it begins part-way through the construct above it, so those exact lines 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) src/view/phui/calendar/PHUICalendarDayView.php:261 — src/view/phui/calendar/PHUICalendarDayView.php:261-284 | src/view/phui/calendar/PHUICalendarMonthView.php:424-447 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/view/phui/calendar/PHUICalendarDayView.php:261` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×7
  • Duplicated block (17 lines × 3) src/applications/differential/conduit/DifferentialConduitAPIMethod.php:138 — src/applications/differential/conduit/DifferentialConduitAPIMethod.php:138-154 | src/infrastructure/customfield/engineextension/PhabricatorCustomFieldSearchEngineExtension.php:94-110 | src/infrastructure/export/engine/PhabricatorCustomFieldExportEngineExtension.php:42-58 — 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 `src/applications/differential/conduit/DifferentialConduitAPIMethod.php:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) src/applications/nuance/query/NuanceQueueQuery.php:24 — src/applications/nuance/query/NuanceQueueQuery.php:24-40 | src/applications/people/query/PhabricatorPeopleUserEmailQuery.php:28-44 | src/applications/xhprof/query/PhabricatorXHProfSampleQuery.php:24-40 — before extracting anything, compare `src/applications/nuance/query/NuanceQueueQuery.php` and `src/applications/xhprof/query/PhabricatorXHProfSampleQuery.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 (17 lines × 3) src/applications/owners/xaction/PhabricatorOwnersPackageAuthorityTransaction.php:16 — src/applications/owners/xaction/PhabricatorOwnersPackageAuthorityTransaction.php:16-32 | src/applications/owners/xaction/PhabricatorOwnersPackageAutoreviewTransaction.php:16-32 | src/applications/owners/xaction/PhabricatorOwnersPackageDominionTransaction.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 all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (17 lines × 3) src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:10 — src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:10-26 | src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php:10-26 | src/applications/people/controller/PhabricatorPeopleProfileTasksController.php:10-26 — before extracting anything, compare `src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php` and `src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php:30 — src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php:30-46 | src/applications/repository/xaction/PhabricatorRepositoryFilesizeLimitTransaction.php:30-46 | src/applications/repository/xaction/PhabricatorRepositoryTouchLimitTransaction.php:30-46 — before extracting anything, compare `src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.php` and `src/applications/repository/xaction/PhabricatorRepositoryTouchLimitTransaction.php` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/repository/xaction/PhabricatorRepositoryCopyTimeLimitTransaction.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. 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 × 3) src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:11 — src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:11-27 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:11-27 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationReorderController.php:11-27 — before extracting anything, compare `src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php` and `src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php` as WHOLE FILES: this scan already matched 3 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.
  • Duplicated block (17 lines × 3) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:7 — src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:7-26 | src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementPriorityWorkflow.php:7-25 | src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementRetryWorkflow.php:7-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×7
  • Duplicated block (16 lines × 3) src/applications/almanac/controller/AlmanacDeviceViewController.php:61 — src/applications/almanac/controller/AlmanacDeviceViewController.php:61-81 | src/applications/almanac/controller/AlmanacNamespaceViewController.php:39-54 | src/applications/almanac/controller/AlmanacNetworkViewController.php:39-54 — before extracting anything, compare `src/applications/almanac/controller/AlmanacDeviceViewController.php` and `src/applications/almanac/controller/AlmanacNamespaceViewController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 3) src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:21 — src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:21-36 | src/applications/calendar/xaction/PhabricatorCalendarImportNameTransaction.php:21-36 | src/applications/repository/xaction/PhabricatorRepositoryCallsignTransaction.php:29-44 — 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 `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:21` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) src/applications/calendar/controller/PhabricatorCalendarImportDeleteController.php:7 — src/applications/calendar/controller/PhabricatorCalendarImportDeleteController.php:7-22 | src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:7-22 | src/applications/calendar/controller/PhabricatorCalendarImportReloadController.php:7-22 — 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 (16 lines × 3) src/applications/conduit/controller/PhabricatorConduitController.php:69 — src/applications/conduit/controller/PhabricatorConduitController.php:69-84 | src/applications/drydock/controller/DrydockLeaseViewController.php:60-75 | src/applications/drydock/controller/DrydockResourceViewController.php:65-80 — before extracting anything, compare `src/applications/drydock/controller/DrydockLeaseViewController.php` and `src/applications/drydock/controller/DrydockResourceViewController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:21 — src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:21-36 | src/applications/phortune/xaction/paymentmethod/PhortunePaymentMethodNameTransaction.php:21-36 | src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.php:21-36 — 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 `src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:21` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) src/applications/drydock/logtype/DrydockLeaseAllocationFailureLogType.php:8 — src/applications/drydock/logtype/DrydockLeaseAllocationFailureLogType.php:8-23 | src/applications/drydock/logtype/DrydockLeaseReacquireLogType.php:8-23 | src/applications/drydock/logtype/DrydockResourceAllocationFailureLogType.php:8-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/logtype/DrydockLeaseAllocationFailureLogType.php:8` 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 × 3) src/infrastructure/markup/markuprule/PhutilRemarkupDelRule.php:6 — src/infrastructure/markup/markuprule/PhutilRemarkupDelRule.php:6-21 | src/infrastructure/markup/markuprule/PhutilRemarkupItalicRule.php:6-21 | src/infrastructure/markup/markuprule/PhutilRemarkupUnderlineRule.php:6-21 — 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 `src/infrastructure/markup/markuprule/PhutilRemarkupDelRule.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×7
  • Duplicated block (14–15 lines × 2) src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php:94 — src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php:94-107 | src/applications/repository/xaction/PhabricatorRepositorySymbolSourcesTransaction.php:55-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) src/applications/config/controller/services/PhabricatorConfigServicesController.php:21 — src/applications/config/controller/services/PhabricatorConfigServicesController.php:21-35 | src/applications/config/controller/settings/PhabricatorConfigSettingsController.php:21-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14–15 lines × 2) src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:52 — src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:52-65 | src/applications/phriction/controller/PhrictionPublishController.php:69-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:52` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14–15 lines × 2) src/applications/nuance/controller/NuanceConsoleController.php:43 — src/applications/nuance/controller/NuanceConsoleController.php:43-56 | src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodEditController.php:83-97 — 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 (14–15 lines × 2) src/applications/passphrase/controller/PassphraseCredentialCreateController.php:52 — src/applications/passphrase/controller/PassphraseCredentialCreateController.php:52-65 | src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php:281-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php:281` it does not close everything it opens, so those 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 (14–15 lines × 2) src/applications/phame/controller/post/PhamePostViewController.php:236 — src/applications/phame/controller/post/PhamePostViewController.php:236-249 | src/applications/phame/controller/post/PhamePostViewController.php:259-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/post/PhamePostViewController.php:259` it begins part-way through the construct above it, so those 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–15 lines × 2) src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php:31 — src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php:31-44 | src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php:31-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×7
  • Duplicated block (13 lines × 4) src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:44 — src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:44-57 | src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:50-62 | src/applications/phame/controller/post/PhamePostPublishController.php:52-64 | src/applications/project/controller/PhabricatorProjectLockController.php:67-80 — 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 `src/applications/calendar/controller/PhabricatorCalendarExportDisableController.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. 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 × 4) src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:51 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:51-63 | src/applications/owners/controller/PhabricatorOwnersArchiveController.php:51-63 | src/applications/paste/controller/PhabricatorPasteArchiveController.php:50-62 | src/applications/pholio/controller/PholioMockArchiveController.php:50-62 — before extracting anything, compare `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php` and `src/applications/owners/controller/PhabricatorOwnersArchiveController.php` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.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. 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 × 4) src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:97 — src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:97-109 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:58-70 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php:62-74 | src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php:88-100 — before extracting anything, compare `src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:97` it does not close everything it opens, so those 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, `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php:60` calls `getViewer` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.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 (13 lines × 4) src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php:14 — src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php:14-26 | src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:16-28 | src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php:16-28 | src/applications/people/controller/PhabricatorPeopleProfileTasksController.php:16-28 — before extracting anything, compare `src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php` and `src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:7 — src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:7-19 | src/applications/people/controller/PhabricatorPeopleProfileManageController.php:11-23 | src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php:7-19 | src/applications/people/controller/PhabricatorPeopleProfileTasksController.php:7-19 — before extracting anything, compare `src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php` and `src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) src/applications/phortune/controller/account/PhortuneAccountChargesController.php:55 — src/applications/phortune/controller/account/PhortuneAccountChargesController.php:55-67 | src/applications/phortune/controller/account/PhortuneAccountProfileController.php:126-138 | src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php:64-76 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionsController.php:53-65 — before extracting anything, compare `src/applications/phortune/controller/account/PhortuneAccountChargesController.php` and `src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 4) src/applications/drydock/logtype/DrydockLeaseReclaimLogType.php:8 — src/applications/drydock/logtype/DrydockLeaseReclaimLogType.php:8-20 | src/applications/drydock/logtype/DrydockLeaseWaitingForActivationLogType.php:8-20 | src/applications/drydock/logtype/DrydockLeaseWaitingForReclamationLogType.php:8-20 | src/applications/drydock/logtype/DrydockLeaseWaitingForResourcesLogType.php:8-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/logtype/DrydockLeaseReclaimLogType.php:8` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×6
  • Duplicated block (11 lines × 4) src/applications/diffusion/engineextension/DiffusionDatasourceEngineExtension.php:34 — src/applications/diffusion/engineextension/DiffusionDatasourceEngineExtension.php:34-44 | src/applications/phriction/engineextension/PhrictionDatasourceEngineExtension.php:28-38 | src/applications/project/engineextension/ProjectDatasourceEngineExtension.php:28-38 | src/applications/search/engineextension/PhabricatorFerretSearchEngineExtension.php:38-49 — 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.
  • Duplicated block (11 lines × 4) src/applications/drydock/query/DrydockLogQuery.php:44 — src/applications/drydock/query/DrydockLogQuery.php:44-54 | src/applications/drydock/query/DrydockLogQuery.php:65-75 | src/applications/drydock/query/DrydockLogQuery.php:86-96 | src/applications/drydock/query/DrydockLogQuery.php:107-117 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/query/DrydockLogQuery.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 (11 lines × 4) src/applications/calendar/xaction/PhabricatorCalendarEventAllDayTransaction.php:52 — src/applications/calendar/xaction/PhabricatorCalendarEventAllDayTransaction.php:52-62 | src/applications/calendar/xaction/PhabricatorCalendarEventCancelTransaction.php:33-43 | src/applications/differential/xaction/DifferentialRevisionHoldDraftTransaction.php:45-55 | src/applications/macro/xaction/PhabricatorMacroDisabledTransaction.php:29-39 — 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. 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 × 4) src/applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php:10 — src/applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php:10-20 | src/applications/dashboard/engine/PhabricatorDashboardPanelFulltextEngine.php:10-20 | src/applications/dashboard/engine/PhabricatorDashboardPortalFulltextEngine.php:10-20 | src/applications/people/search/PhabricatorUserFulltextEngine.php:10-20 — 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.
  • Duplicated block (11 lines × 4) src/applications/herald/query/HeraldRuleQuery.php:277 — src/applications/herald/query/HeraldRuleQuery.php:277-288 | src/applications/phortune/query/PhortuneAccountQuery.php:113-123 | src/applications/phortune/query/PhortuneMerchantQuery.php:107-117 | src/applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php:96-107 — before extracting anything, compare `src/applications/phortune/query/PhortuneAccountQuery.php` and `src/applications/phortune/query/PhortuneMerchantQuery.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (11 lines × 4) src/applications/uiexample/examples/PHUIColorPalletteExample.php:108 — src/applications/uiexample/examples/PHUIColorPalletteExample.php:108-118 | src/applications/uiexample/examples/PHUIIconExample.php:218-228 | src/applications/uiexample/examples/PHUIImageMaskExample.php:56-66 | src/applications/uiexample/examples/PHUITagExample.php:205-215 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/uiexample/examples/PHUIIconExample.php:230` calls `id`, `PHUIObjectBoxView`, `setHeaderText` and `src/applications/uiexample/examples/PHUIColorPalletteExample.php:120` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×6
  • Duplicated block (9 lines × 4) src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:9 — src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:9-17 | src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php:7-15 | src/applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php:7-16 | REDACTED:7-16 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:7` calls `newNavigation` and `src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php:6` 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) src/applications/console/controller/DarkConsoleController.php:53 — src/applications/console/controller/DarkConsoleController.php:53-61 | src/applications/policy/controller/PhabricatorPolicyEditController.php:296-304 | src/applications/search/controller/PhabricatorApplicationSearchController.php:988-996 | src/applications/settings/panel/PhabricatorSettingsPanel.php:294-302 — 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.
  • Duplicated block (9 lines × 4) src/applications/feed/query/PhabricatorFeedSearchEngine.php:112 — src/applications/feed/query/PhabricatorFeedSearchEngine.php:112-120 | src/applications/macro/query/PhabricatorMacroSearchEngine.php:96-105 | src/applications/paste/query/PhabricatorPasteSearchEngine.php:93-102 | src/applications/pholio/query/PholioMockSearchEngine.php:54-63 — 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.
  • Duplicated block (9 lines × 4) src/applications/almanac/storage/AlmanacDevice.php:249 — src/applications/almanac/storage/AlmanacDevice.php:249-257 | src/applications/almanac/storage/AlmanacInterface.php:152-160 | src/applications/almanac/storage/AlmanacNetwork.php:90-99 | src/applications/almanac/storage/AlmanacService.php:248-256 — before extracting anything, compare `src/applications/almanac/storage/AlmanacDevice.php` and `src/applications/almanac/storage/AlmanacService.php` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the 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 × 4) src/applications/auth/provider/PhabricatorAsanaAuthProvider.php:40 — src/applications/auth/provider/PhabricatorAsanaAuthProvider.php:40-48 | src/applications/auth/provider/PhabricatorJIRAAuthProvider.php:300-308 | REDACTED:485-493 | src/applications/auth/provider/PhabricatorPasswordAuthProvider.php:343-351 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 4) src/applications/uiexample/examples/PHUIColorPalletteExample.php:110 — src/applications/uiexample/examples/PHUIColorPalletteExample.php:110-118 | src/applications/uiexample/examples/PHUIIconExample.php:224-232 | src/applications/uiexample/examples/PHUIImageMaskExample.php:66-74 | src/applications/uiexample/examples/PHUITagExample.php:219-227 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D2 · Cognitive Complexity · (anonymous) (cognitive 16) · ×5
  • (anonymous) (cognitive 16) webroot/rsrc/js/core/behavior-refresh-csrf.js:31 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2, match/switch 2 (nesting depth added 3). None of this is in the body itself: all 16 points belong to 8 function items inside it that branch (redraw_bar, a function literal at line 36, a function literal at line 121, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cognitive 16) webroot/rsrc/js/core/behavior-gesture.js:15 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 1 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 5 function items inside it that branch (a function literal at line 50, a function literal at line 25, a function literal at line 92, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cognitive 16) webroot/rsrc/js/core/behavior-form.js:6 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, loops 2, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 5 function items inside it that branch (a function literal at line 18, a function literal at line 57, will_submit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cognitive 16) webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:12 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 5, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 29 function items inside it that branch (a function literal at line 99, update_statics, a function literal at line 272, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cognitive 16) webroot/rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js:11 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). Of this number, 10 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×5
  • Duplicated block (31 lines × 2) src/applications/audit/storage/PhabricatorAuditTransaction.php:168 — src/applications/audit/storage/PhabricatorAuditTransaction.php:168-198 | src/applications/audit/storage/PhabricatorAuditTransaction.php:304-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/audit/storage/PhabricatorAuditTransaction.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 (31 lines × 2) src/applications/config/schema/PhabricatorConfigStorageSchema.php:104 — src/applications/config/schema/PhabricatorConfigStorageSchema.php:104-134 | src/applications/config/schema/PhabricatorConfigStorageSchema.php:145-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/schema/PhabricatorConfigStorageSchema.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. 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 (31 lines × 2) src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php:195 — src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php:195-225 | src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryMercurialCommitChangeParserWorker.php:250-280 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php:195` it begins part-way through the construct above it, so those exact lines 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) src/applications/harbormaster/step/HarbormasterArcLintBuildStepImplementation.php:9 — src/applications/harbormaster/step/HarbormasterArcLintBuildStepImplementation.php:9-39 | src/applications/harbormaster/step/HarbormasterArcUnitBuildStepImplementation.php:9-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/step/HarbormasterArcLintBuildStepImplementation.php:9` 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 (31 lines × 2) src/applications/badges/lipsum/PhabricatorBadgesBadgeTestDataGenerator.php:17 — src/applications/badges/lipsum/PhabricatorBadgesBadgeTestDataGenerator.php:17-47 | src/applications/conpherence/lipsum/PhabricatorConpherenceRoomTestDataGenerator.php:35-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×5
  • Duplicated block (18 lines × 3) src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:95 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:95-112 | src/applications/project/controller/PhabricatorProjectManageController.php:111-128 | src/applications/spaces/controller/PhabricatorSpacesViewController.php:116-133 — 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 `src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.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 `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 × 3) src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:34 — src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:34-51 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:57-74 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:225-242 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:77` calls `phutil_tag`, `array`, `getOldFile` and `src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:54` 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 (18 lines × 3) src/applications/drydock/storage/DrydockLease.php:280 — src/applications/drydock/storage/DrydockLease.php:280-297 | src/applications/drydock/storage/DrydockLease.php:348-365 | src/applications/drydock/storage/DrydockResource.php:206-223 — before extracting anything, compare `src/applications/drydock/storage/DrydockLease.php` and `src/applications/drydock/storage/DrydockResource.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) src/applications/conpherence/xaction/ConpherenceThreadPictureTransaction.php:9 — src/applications/conpherence/xaction/ConpherenceThreadPictureTransaction.php:9-26 | src/applications/phame/xaction/PhameBlogProfileImageTransaction.php:10-31 | src/applications/phortune/xaction/PhortuneMerchantPictureTransaction.php:9-30 — 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 `src/applications/conpherence/xaction/ConpherenceThreadPictureTransaction.php:9` 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 (18 lines × 3) src/applications/differential/herald/DifferentialRevisionPackageHeraldField.php:9 — src/applications/differential/herald/DifferentialRevisionPackageHeraldField.php:9-26 | src/applications/diffusion/herald/DiffusionCommitPackageHeraldField.php:9-26 | src/applications/diffusion/herald/DiffusionPreCommitContentPackageHeraldField.php:9-26 — 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 `src/applications/differential/herald/DifferentialRevisionPackageHeraldField.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×5
  • Duplicated block (15 lines × 4) src/applications/auth/query/PhabricatorAuthInviteQuery.php:63 — src/applications/auth/query/PhabricatorAuthInviteQuery.php:63-77 | src/applications/phortune/query/PhortunePaymentProviderConfigQuery.php:63-77 | src/applications/phortune/query/PhortuneProductQuery.php:81-95 | src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php:172-186 — 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.
  • Duplicated block (15 lines × 4) src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:17 — src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:17-31 | src/applications/calendar/xaction/PhabricatorCalendarImportNameTransaction.php:17-31 | src/applications/repository/xaction/PhabricatorRepositoryCallsignTransaction.php:25-39 | src/applications/repository/xaction/PhabricatorRepositoryStagingURITransaction.php:17-31 — 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 `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 4) src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:46 — src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:46-60 | src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:65-79 | src/applications/drydock/controller/DrydockBlueprintDisableController.php:49-63 | src/applications/project/controller/PhabricatorProjectSilenceController.php:70-84 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php` and `src/applications/drydock/controller/DrydockBlueprintDisableController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarExportDisableController.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. 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 × 4) src/applications/differential/typeahead/DifferentialBlockingReviewerDatasource.php:111 — src/applications/differential/typeahead/DifferentialBlockingReviewerDatasource.php:111-125 | src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:98-112 | src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php:132-146 | src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php:121-135 — before extracting anything, compare `src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php` and `src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 4) src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php:7 — src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php:7-22 | src/applications/auth/management/PhabricatorAuthManagementVerifyWorkflow.php:7-21 | src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php:7-30 | src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php:18-40 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×5
  • Duplicated block (14 lines × 3) src/applications/diffusion/herald/DiffusionCommitAuthorPackagesHeraldField.php:13 — src/applications/diffusion/herald/DiffusionCommitAuthorPackagesHeraldField.php:13-26 | src/applications/diffusion/herald/DiffusionCommitCommitterPackagesHeraldField.php:13-26 | src/applications/diffusion/herald/DiffusionPreCommitContentAuthorPackagesHeraldField.php:13-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 3) src/applications/harbormaster/controller/HarbormasterPlanBehaviorController.php:7 — src/applications/harbormaster/controller/HarbormasterPlanBehaviorController.php:7-20 | src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:7-20 | src/applications/harbormaster/controller/HarbormasterStepAddController.php:7-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 3) src/applications/harbormaster/controller/HarbormasterPlanViewController.php:484 — src/applications/harbormaster/controller/HarbormasterPlanViewController.php:484-497 | src/applications/harbormaster/controller/HarbormasterPlanViewController.php:531-544 | src/applications/herald/controller/HeraldWebhookViewController.php:222-235 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 3) src/applications/meta/controller/PhabricatorApplicationEditController.php:8 — src/applications/meta/controller/PhabricatorApplicationEditController.php:8-21 | src/applications/meta/controller/PhabricatorApplicationPanelController.php:12-27 | src/applications/meta/controller/PhabricatorApplicationUninstallController.php:10-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/meta/controller/PhabricatorApplicationUninstallController.php:8` calls `getUser` and `src/applications/meta/controller/PhabricatorApplicationPanelController.php:9` 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 × 3) src/applications/conpherence/storage/ConpherenceTransactionComment.php:13 — src/applications/conpherence/storage/ConpherenceTransactionComment.php:13-26 | src/applications/legalpad/storage/LegalpadTransactionComment.php:23-38 | src/applications/pholio/storage/PholioTransactionComment.php:18-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) src/applications/auth/management/PhabricatorAuthManagementUnlimitWorkflow.php:36 — src/applications/auth/management/PhabricatorAuthManagementUnlimitWorkflow.php:36-48 | src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php:78-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/management/PhabricatorAuthManagementUnlimitWorkflow.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–13 lines × 2) src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php:65 — src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php:65-77 | src/applications/conpherence/xaction/ConpherenceThreadParticipantsTransaction.php:99-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.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. 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–13 lines × 2) src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:91 — src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:91-103 | src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php:80-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The 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–13 lines × 2) src/applications/passphrase/xaction/PassphraseCredentialUsernameTransaction.php:37 — src/applications/passphrase/xaction/PassphraseCredentialUsernameTransaction.php:37-48 | src/applications/project/xaction/column/PhabricatorProjectColumnNameTransaction.php:48-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/passphrase/xaction/PassphraseCredentialUsernameTransaction.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. 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 (12–13 lines × 2) src/applications/project/storage/PhabricatorProjectTransaction.php:101 — src/applications/project/storage/PhabricatorProjectTransaction.php:101-112 | src/applications/project/storage/PhabricatorProjectTransaction.php:113-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/storage/PhabricatorProjectTransaction.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×5
  • Duplicated block (12 lines × 5) src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:50 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:50-61 | src/applications/owners/controller/PhabricatorOwnersArchiveController.php:50-61 | src/applications/paste/controller/PhabricatorPasteArchiveController.php:49-60 | src/applications/pholio/controller/PholioMockArchiveController.php:49-60 | src/applications/slowvote/controller/PhabricatorSlowvoteCloseController.php:50-61 — before extracting anything, compare `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php` and `src/applications/owners/controller/PhabricatorOwnersArchiveController.php` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:50` it begins part-way through the construct above it, so those 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 × 5) src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:17 — src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:17-28 | src/applications/phortune/xaction/PhortuneAccountBillingNameTransaction.php:17-28 | src/applications/phortune/xaction/PhortuneMerchantInvoiceEmailTransaction.php:17-28 | src/applications/phortune/xaction/paymentmethod/PhortunePaymentMethodNameTransaction.php:17-28 | src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.php:17-28 — before extracting anything, compare `src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php` and `src/applications/phortune/xaction/PhortuneMerchantInvoiceEmailTransaction.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 `src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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 (12 lines × 5) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:68 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:68-79 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:84-95 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:68-79 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:74-85 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:85-96 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:68` it begins part-way through the construct above it, so those 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 (12 lines × 5) src/applications/phortune/controller/account/PhortuneAccountChargesController.php:55 — src/applications/phortune/controller/account/PhortuneAccountChargesController.php:55-66 | src/applications/phortune/controller/account/PhortuneAccountProfileController.php:126-137 | src/applications/phortune/controller/account/PhortuneAccountSubscriptionViewController.php:141-152 | src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php:64-75 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionsController.php:53-64 — before extracting anything, compare `src/applications/phortune/controller/account/PhortuneAccountChargesController.php` and `src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 5) src/applications/passphrase/xaction/PassphraseCredentialSecretIDTransaction.php:34 — src/applications/passphrase/xaction/PassphraseCredentialSecretIDTransaction.php:34-45 | src/applications/phame/xaction/PhameBlogSubtitleTransaction.php:32-43 | src/applications/phame/xaction/PhamePostSubtitleTransaction.php:32-43 | src/applications/slowvote/xaction/PhabricatorSlowvoteDescriptionTransaction.php:23-36 | src/applications/slowvote/xaction/PhabricatorSlowvoteQuestionTransaction.php:34-47 — before extracting anything, compare `src/applications/phame/xaction/PhameBlogSubtitleTransaction.php` and `src/applications/phame/xaction/PhamePostSubtitleTransaction.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×5
  • Duplicated block (10 lines × 4) src/applications/almanac/phid/AlmanacDevicePHIDType.php:32 — src/applications/almanac/phid/AlmanacDevicePHIDType.php:32-41 | src/applications/almanac/phid/AlmanacNamespacePHIDType.php:32-41 | src/applications/almanac/phid/AlmanacNetworkPHIDType.php:32-41 | src/applications/almanac/phid/AlmanacServicePHIDType.php:32-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 all 4 call sites, so a change lands once.
  • Duplicated block (10 lines × 4) src/applications/auth/xaction/PhabricatorAuthContactNumberNumberTransaction.php:42 — src/applications/auth/xaction/PhabricatorAuthContactNumberNumberTransaction.php:42-51 | src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:42-51 | src/applications/project/xaction/column/PhabricatorProjectColumnNameTransaction.php:53-62 | src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.php:42-51 — before extracting anything, compare `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php` and `src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/xaction/PhabricatorAuthContactNumberNumberTransaction.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:39` calls `validateTransactions`, `array` and `src/applications/project/xaction/column/PhabricatorProjectColumnNameTransaction.php:51` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 4) src/applications/drydock/query/DrydockAuthorizationQuery.php:79 — src/applications/drydock/query/DrydockAuthorizationQuery.php:79-88 | src/applications/drydock/query/DrydockAuthorizationQuery.php:101-110 | src/applications/drydock/query/DrydockRepositoryOperationQuery.php:80-89 | src/applications/drydock/query/DrydockRepositoryOperationQuery.php:106-115 — 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 `src/applications/drydock/query/DrydockAuthorizationQuery.php:79` it begins part-way through the construct above it, so those exact lines 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) src/applications/phortune/storage/PhortuneCart.php:691 — src/applications/phortune/storage/PhortuneCart.php:691-700 | src/applications/phortune/storage/PhortuneCharge.php:176-185 | src/applications/phortune/storage/PhortunePaymentMethod.php:185-194 | src/applications/phortune/storage/PhortuneSubscription.php:280-289 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. 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 × 4) src/applications/differential/relationships/DifferentialRevisionRelationship.php:7 — src/applications/differential/relationships/DifferentialRevisionRelationship.php:7-16 | src/applications/diffusion/relationships/DiffusionCommitRelationship.php:7-16 | src/applications/maniphest/relationship/ManiphestTaskRelationship.php:7-16 | src/applications/pholio/relationships/PholioMockRelationship.php:7-16 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×5
  • Duplicated block (5 lines × 3) src/applications/almanac/storage/AlmanacDevice.php:60 — src/applications/almanac/storage/AlmanacDevice.php:60-64 | src/applications/almanac/storage/AlmanacNamespace.php:48-52 | src/applications/almanac/storage/AlmanacService.php:73-77 — before extracting anything, compare `src/applications/almanac/storage/AlmanacDevice.php` and `src/applications/almanac/storage/AlmanacService.php` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the 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 × 3) src/applications/differential/customfield/DifferentialRevertPlanField.php:43 — src/applications/differential/customfield/DifferentialRevertPlanField.php:43-47 | src/applications/differential/customfield/DifferentialSummaryField.php:54-58 | src/applications/differential/customfield/DifferentialTestPlanField.php:58-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) src/applications/maniphest/editor/ManiphestTransactionEditor.php:203 — src/applications/maniphest/editor/ManiphestTransactionEditor.php:203-207 | src/applications/paste/editor/PhabricatorPasteEditor.php:93-97 | src/applications/ponder/editor/PonderQuestionEditor.php:147-151 — 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 (5 lines × 3) src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php:67 — src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php:67-71 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php:71-75 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldText.php:45-49 — 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 (5 lines × 3) src/applications/differential/lipsum/PhabricatorDifferentialRevisionTestDataGenerator.php:42 — src/applications/differential/lipsum/PhabricatorDifferentialRevisionTestDataGenerator.php:42-46 | src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php:65-69 | src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php:87-91 — 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 `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.
D15 · Churn × Complexity Hotspots · Hotspot · ×4
  • Hotspot: src/applications/policy/filter/PhabricatorPolicyFilter.php src/applications/policy/filter/PhabricatorPolicyFilter.php:156 — src/applications/policy/filter/PhabricatorPolicyFilter.php changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in PhabricatorPolicyFilter.apply at line 156. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 11:44:29 -07:00' --until='2026-10-23 11:44:29 -07:00' --full-history --no-merges -- src/applications/policy/filter/PhabricatorPolicyFilter.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/applications/calendar/query/PhabricatorCalendarEventQuery.php src/applications/calendar/query/PhabricatorCalendarEventQuery.php:515 — src/applications/calendar/query/PhabricatorCalendarEventQuery.php changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in PhabricatorCalendarEventQuery.willFilterPage at line 515. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 11:44:29 -07:00' --until='2026-10-23 11:44:29 -07:00' --full-history --no-merges -- src/applications/calendar/query/PhabricatorCalendarEventQuery.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/applications/diffusion/query/DiffusionCommitQuery.php src/applications/diffusion/query/DiffusionCommitQuery.php:361 — src/applications/diffusion/query/DiffusionCommitQuery.php changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in DiffusionCommitQuery.didFilterPage at line 361. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 11:44:29 -07:00' --until='2026-10-23 11:44:29 -07:00' --full-history --no-merges -- src/applications/diffusion/query/DiffusionCommitQuery.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php:17 — src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in PhabricatorOAuthServerTokenController.handleRequest at line 17. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 11:44:29 -07:00' --until='2026-10-23 11:44:29 -07:00' --full-history --no-merges -- src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D17 · Explicit Debt · HackComment · ×4
  • HackComment src/applications/project/events/PhabricatorProjectUIEventListener.php:15 — // Hacky solution so that property list view on Diffusion — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php:19 — // Hacky solution so that property list view on Diffusion — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/applications/tokens/event/PhabricatorTokenUIEventListener.php:19 — // Hacky solution so that property list view on Diffusion — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/infrastructure/storage/lisk/LiskDAO.php:1641 — // Hack for policy system hints, see PhabricatorPolicyRule for notes. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×4
  • Duplicated block (26 lines × 2) src/applications/drydock/controller/DrydockLeaseViewController.php:55 — src/applications/drydock/controller/DrydockLeaseViewController.php:55-80 | src/applications/drydock/controller/DrydockResourceViewController.php:60-85 — before extracting anything, compare `src/applications/drydock/controller/DrydockLeaseViewController.php` and `src/applications/drydock/controller/DrydockResourceViewController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `src/applications/drydock/controller/DrydockResourceViewController.php:87` calls `buildLeaseBox` and `src/applications/drydock/controller/DrydockLeaseViewController.php:82` 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 (26 lines × 2) src/applications/guides/module/PhabricatorGuideQuickStartModule.php:29 — src/applications/guides/module/PhabricatorGuideQuickStartModule.php:29-54 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:56-81 — both copies are in the same file, so extract the 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) src/applications/phortune/controller/account/PhortuneAccountProfileController.php:108 — src/applications/phortune/controller/account/PhortuneAccountProfileController.php:108-133 | src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php:46-71 — before extracting anything, compare `src/applications/phortune/controller/account/PhortuneAccountProfileController.php` and `src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php` as WHOLE FILES: this scan already matched 3 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.
  • Duplicated block (26 lines × 2) src/applications/project/controller/PhabricatorProjectProfileController.php:258 — src/applications/project/controller/PhabricatorProjectProfileController.php:258-283 | src/applications/project/controller/PhabricatorProjectProfileController.php:306-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×4
  • Duplicated block (25 lines × 2) src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.php:41 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.php:41-65 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberPrimaryController.php:52-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/contact/PhabricatorAuthContactNumberDisableController.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.
  • Duplicated block (25 lines × 2) src/applications/differential/editor/DifferentialTransactionEditor.php:1172 — src/applications/differential/editor/DifferentialTransactionEditor.php:1172-1196 | src/applications/differential/herald/DifferentialReviewersHeraldAction.php:42-66 — 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 (25 lines × 2) src/applications/phame/view/PhameBlogListView.php:41 — src/applications/phame/view/PhameBlogListView.php:41-65 | src/applications/phame/view/PhameDraftListView.php:49-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/view/PhameBlogListView.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/phame/view/PhameDraftListView.php:74` calls `pht` and `src/applications/phame/view/PhameBlogListView.php:66` 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 (25 lines × 2) src/applications/project/controller/PhabricatorProjectBoardViewController.php:423 — src/applications/project/controller/PhabricatorProjectBoardViewController.php:423-447 | src/applications/project/controller/PhabricatorProjectBoardViewController.php:526-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×4
  • Duplicated block (19–20 lines × 2) src/applications/almanac/xaction/AlmanacBindingServiceTransaction.php:43 — src/applications/almanac/xaction/AlmanacBindingServiceTransaction.php:43-61 | src/applications/almanac/xaction/AlmanacInterfaceDeviceTransaction.php:52-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 `src/applications/almanac/xaction/AlmanacBindingServiceTransaction.php:43` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19–20 lines × 2) src/applications/drydock/controller/DrydockBlueprintViewController.php:162 — src/applications/drydock/controller/DrydockBlueprintViewController.php:162-180 | src/applications/drydock/controller/DrydockBlueprintViewController.php:227-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. 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–20 lines × 2) src/applications/ponder/controller/PonderAnswerCommentController.php:39 — src/applications/ponder/controller/PonderAnswerCommentController.php:39-58 | src/applications/ponder/controller/PonderQuestionCommentController.php:36-54 — before extracting anything, compare `src/applications/ponder/controller/PonderAnswerCommentController.php` and `src/applications/ponder/controller/PonderQuestionCommentController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/ponder/controller/PonderAnswerCommentController.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. 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–20 lines × 2) src/applications/project/controller/PhabricatorProjectBoardImportController.php:7 — src/applications/project/controller/PhabricatorProjectBoardImportController.php:7-25 | src/applications/project/controller/PhabricatorProjectBoardReorderController.php:7-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×4
  • Duplicated block (18–19 lines × 2) src/applications/dashboard/controller/PhabricatorDashboardConsoleController.php:29 — src/applications/dashboard/controller/PhabricatorDashboardConsoleController.php:29-47 | src/applications/drydock/controller/DrydockConsoleController.php:32-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 `src/applications/dashboard/controller/PhabricatorDashboardConsoleController.php:29` it does not close everything it opens, so those 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–19 lines × 2) src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php:86 — src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php:86-104 | src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php:104-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php:86` it does not close everything it opens, so those exact lines 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) src/applications/macro/controller/PhabricatorMacroAudioController.php:142 — src/applications/macro/controller/PhabricatorMacroAudioController.php:142-160 | src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:273-290 — 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 (18–19 lines × 2) src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php:117 — src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php:117-134 | src/applications/repository/xaction/PhabricatorRepositoryIdentityAssignTransaction.php:60-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×4
  • Duplicated block (14–15 lines × 4) src/applications/almanac/controller/AlmanacServiceEditController.php:95 — src/applications/almanac/controller/AlmanacServiceEditController.php:95-108 | src/applications/calendar/controller/PhabricatorCalendarImportEditController.php:75-89 | src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:233-247 | src/applications/meta/controller/PhabricatorApplicationEditController.php:152-165 — before extracting anything, compare `src/applications/almanac/controller/AlmanacServiceEditController.php` and `src/applications/calendar/controller/PhabricatorCalendarImportEditController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–15 lines × 4) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:44 — src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:44-58 | src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php:68-82 | src/applications/phame/controller/post/PhamePostPublishController.php:54-67 | src/applications/phortune/controller/merchant/PhortuneMerchantProviderDisableController.php:58-72 — before extracting anything, compare `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php` and `src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:44` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14–15 lines × 4) src/applications/passphrase/controller/PassphraseCredentialConduitController.php:7 — src/applications/passphrase/controller/PassphraseCredentialConduitController.php:7-21 | src/applications/passphrase/controller/PassphraseCredentialDestroyController.php:7-21 | src/applications/passphrase/controller/PassphraseCredentialLockController.php:7-21 | src/applications/passphrase/controller/PassphraseCredentialPublicController.php:7-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. 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 × 4) src/applications/people/editor/PhabricatorUserEditor.php:222 — src/applications/people/editor/PhabricatorUserEditor.php:222-235 | src/applications/people/editor/PhabricatorUserEditor.php:271-284 | src/applications/people/editor/PhabricatorUserEditor.php:350-363 | src/applications/people/editor/PhabricatorUserEditor.php:404-418 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/people/editor/PhabricatorUserEditor.php:237` calls `getIsPrimary`, `Exception`, `pht` and `src/applications/people/editor/PhabricatorUserEditor.php:286` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×4
  • Duplicated block (13 lines × 5) src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:93 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:93-105 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:108-120 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:79-91 | src/applications/nuance/controller/NuanceQueueViewController.php:65-77 | src/applications/project/controller/PhabricatorProjectManageController.php:86-98 — before extracting anything, compare `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php` and `src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:91` calls `newCurtainView` and `src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:77` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 5) src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:69 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:69-81 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelViewController.php:92-104 | src/applications/harbormaster/controller/HarbormasterPlanViewController.php:235-247 | src/applications/harbormaster/controller/HarbormasterStepViewController.php:118-130 | src/applications/phurl/controller/PhabricatorPhurlURLViewController.php:101-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/harbormaster/controller/HarbormasterPlanViewController.php:231` calls `array` and `src/applications/harbormaster/controller/HarbormasterStepViewController.php:113` 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 (13 lines × 5) src/applications/harbormaster/query/HarbormasterBuildQuery.php:60 — src/applications/harbormaster/query/HarbormasterBuildQuery.php:60-72 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:85-97 | src/applications/harbormaster/query/HarbormasterBuildStepQuery.php:57-69 | src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php:181-193 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:67-79 — before extracting anything, compare `src/applications/harbormaster/query/HarbormasterBuildQuery.php` and `src/applications/harbormaster/query/HarbormasterBuildStepQuery.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 `src/applications/harbormaster/query/HarbormasterBuildQuery.php:60` it does not close everything it opens, so those exact lines 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 × 5) src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php:46 — src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php:46-59 | src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:39-51 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:275-288 | src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php:39-51 | src/applications/people/controller/PhabricatorPeopleProfileTasksController.php:39-51 — before extracting anything, compare `src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php` and `src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:273` calls `buildProfileHeader` and `src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:37` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×4
  • Duplicated block (11–12 lines × 2) src/applications/badges/controller/PhabricatorBadgesRecipientsController.php:11 — src/applications/badges/controller/PhabricatorBadgesRecipientsController.php:11-21 | src/applications/badges/controller/PhabricatorBadgesViewController.php:11-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11–12 lines × 2) src/applications/dashboard/controller/dashboard/PhabricatorDashboardInstallController.php:18 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardInstallController.php:18-29 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:11-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11–12 lines × 2) src/applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php:32 — src/applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php:32-43 | src/applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php:73-83 — both copies are in the same file, so extract the 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) src/applications/phortune/xaction/PhortuneAccountNameTransaction.php:37 — src/applications/phortune/xaction/PhortuneAccountNameTransaction.php:37-47 | src/applications/phurl/xaction/PhabricatorPhurlURLAliasTransaction.php:37-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/xaction/PhortuneAccountNameTransaction.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×4
  • Duplicated block (10–11 lines × 2) src/applications/auth/query/PhabricatorAuthSessionQuery.php:45 — src/applications/auth/query/PhabricatorAuthSessionQuery.php:45-54 | src/applications/people/query/PhabricatorPeopleUserEmailQuery.php:52-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/query/PhabricatorAuthSessionQuery.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.
  • Duplicated block (10–11 lines × 2) src/applications/flag/controller/PhabricatorFlagEditController.php:6 — src/applications/flag/controller/PhabricatorFlagEditController.php:6-16 | src/applications/tokens/controller/PhabricatorTokenGiveController.php:6-15 — 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 (10–11 lines × 2) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:54 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:54-63 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:69-79 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:54` it does not close everything it opens, so those 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–11 lines × 2) src/applications/phortune/query/PhortuneAccountEmailQuery.php:42 — src/applications/phortune/query/PhortuneAccountEmailQuery.php:42-52 | src/applications/phortune/query/PhortuneChargeQuery.php:60-69 — before extracting anything, compare `src/applications/phortune/query/PhortuneAccountEmailQuery.php` and `src/applications/phortune/query/PhortuneChargeQuery.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/query/PhortuneAccountEmailQuery.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/phortune/query/PhortuneAccountEmailQuery.php:53` calls `didRejectResult` and `src/applications/phortune/query/PhortuneChargeQuery.php:70` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×4
  • Duplicated block (7 lines × 4) src/applications/phortune/query/PhortuneAccountEmailQuery.php:43 — src/applications/phortune/query/PhortuneAccountEmailQuery.php:43-49 | src/applications/phortune/query/PhortuneChargeQuery.php:61-67 | src/applications/phortune/query/PhortunePurchaseQuery.php:42-48 | src/applications/phortune/query/PhortunePurchaseQuery.php:58-64 — before extracting anything, compare `src/applications/phortune/query/PhortuneAccountEmailQuery.php` and `src/applications/phortune/query/PhortuneChargeQuery.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/query/PhortuneAccountEmailQuery.php:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/phortune/query/PhortuneAccountEmailQuery.php:53` calls `didRejectResult` and `src/applications/phortune/query/PhortuneChargeQuery.php:70` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) src/applications/almanac/query/AlmanacNamespaceSearchEngine.php:28 — src/applications/almanac/query/AlmanacNamespaceSearchEngine.php:28-34 | src/applications/almanac/query/AlmanacNetworkSearchEngine.php:28-34 | src/applications/nuance/query/NuanceSourceSearchEngine.php:19-25 | src/applications/packages/query/PhabricatorPackagesPublisherSearchEngine.php:23-29 — before extracting anything, compare `src/applications/almanac/query/AlmanacNamespaceSearchEngine.php` and `src/applications/almanac/query/AlmanacNetworkSearchEngine.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. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 4) src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php:65 — src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php:65-71 | src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php:75-81 | src/applications/dashboard/install/PhabricatorDashboardHomeInstallWorkflow.php:64-70 | src/applications/dashboard/install/PhabricatorDashboardHomeInstallWorkflow.php:74-80 — 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. 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 × 4) src/applications/differential/typeahead/DifferentialRevisionClosedStatusDatasource.php:65 — src/applications/differential/typeahead/DifferentialRevisionClosedStatusDatasource.php:65-71 | src/applications/differential/typeahead/DifferentialRevisionOpenStatusDatasource.php:65-71 | src/applications/maniphest/typeahead/ManiphestTaskClosedStatusDatasource.php:65-71 | src/applications/maniphest/typeahead/ManiphestTaskOpenStatusDatasource.php:65-71 — 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. 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.
D1 · Cyclomatic Complexity · (anonymous) · ×3
  • (anonymous)::assist (cyclomatic 29) webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188 — (anonymous)::assist has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous)::seek_anchor (cyclomatic 16) webroot/rsrc/js/core/behavior-watch-anchor.js:34 — (anonymous)::seek_anchor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous)::getNewValue (cyclomatic 16) webroot/rsrc/js/core/behavior-time-typeahead.js:82 — (anonymous)::getNewValue 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.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (7 members, 50+ identical tokens) src/applications/auth/query/PhabricatorAuthPasswordQuery.php:83 — src/applications/auth/query/PhabricatorAuthPasswordQuery.php:83-103 | src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php:51-74 | src/applications/auth/query/PhabricatorAuthSessionQuery.php:42-60 | src/applications/conduit/query/PhabricatorConduitTokenQuery.php:90-108 | src/applications/drydock/query/DrydockCommandQuery.php:29-48 | src/applications/people/query/PhabricatorPeopleUserEmailQuery.php:49-70 | src/applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php:111-148 — 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) src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:7 — src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:7-60 | src/applications/calendar/controller/PhabricatorCalendarImportDeleteController.php:7-61 | src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:7-68 | src/applications/calendar/controller/PhabricatorCalendarImportReloadController.php:7-49 | src/applications/harbormaster/controller/HarbormasterPlanBehaviorController.php:7-89 | src/applications/harbormaster/controller/HarbormasterPlanDisableController.php:7-65 | src/applications/harbormaster/controller/HarbormasterStepAddController.php:7-105 — 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) src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:30 — src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:30-54 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:60-81 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:85-137 | src/applications/harbormaster/query/HarbormasterBuildStepQuery.php:57-78 | src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php:181-202 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:67-88 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:92-125 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×3
  • Duplicated block (22–23 lines × 2) src/applications/macro/xaction/PhabricatorMacroFileTransaction.php:51 — src/applications/macro/xaction/PhabricatorMacroFileTransaction.php:51-73 | src/applications/project/xaction/PhabricatorProjectImageTransaction.php:84-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/macro/xaction/PhabricatorMacroFileTransaction.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. 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) src/applications/phame/query/PhameBlogQuery.php:113 — src/applications/phame/query/PhameBlogQuery.php:113-134 | src/applications/phame/query/PhamePostQuery.php:77-99 — 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 (22–23 lines × 2) src/applications/pholio/controller/PholioInlineController.php:65 — src/applications/pholio/controller/PholioInlineController.php:65-86 | src/applications/pholio/view/PholioTransactionView.php:108-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/pholio/controller/PholioInlineController.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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×3
  • Duplicated block (21–22 lines × 2) src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:351 — src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:351-371 | src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:380-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:380` it begins part-way through the construct above it, so those exact lines 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) src/applications/drydock/controller/DrydockBlueprintViewController.php:64 — src/applications/drydock/controller/DrydockBlueprintViewController.php:64-85 | src/applications/drydock/controller/DrydockRepositoryOperationViewController.php:56-76 — 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–22 lines × 2) src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:282 — src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:282-303 | src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:370-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×3
  • Duplicated block (19 lines × 3) src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:73 — src/applications/packages/controller/PhabricatorPackagesPackageViewController.php:73-91 | src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php:70-88 | src/applications/packages/controller/PhabricatorPackagesVersionViewController.php:71-89 — before extracting anything, compare `src/applications/packages/controller/PhabricatorPackagesPackageViewController.php` and `src/applications/packages/controller/PhabricatorPackagesPublisherViewController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (19 lines × 3) src/applications/repository/xaction/PhabricatorRepositoryFetchRefsTransaction.php:17 — src/applications/repository/xaction/PhabricatorRepositoryFetchRefsTransaction.php:17-35 | src/applications/repository/xaction/PhabricatorRepositoryPermanentRefsTransaction.php:17-35 | src/applications/repository/xaction/PhabricatorRepositoryTrackOnlyTransaction.php:17-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 3 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 (19 lines × 3) src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php:401 — src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php:401-419 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php:173-191 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php:91-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php:88` calls `idx`, `getOptions` and `src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php:399` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×3
  • Duplicated block (17–19 lines × 2) src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:40 — src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:40-56 | src/applications/phame/controller/post/PhamePostPublishController.php:45-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarExportDisableController.php:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17–19 lines × 2) src/applications/diffusion/controller/DiffusionHistoryController.php:10 — src/applications/diffusion/controller/DiffusionHistoryController.php:10-28 | src/applications/diffusion/controller/DiffusionTagListController.php:10-26 — 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–19 lines × 2) src/applications/project/controller/PhabricatorProjectColumnDetailController.php:7 — src/applications/project/controller/PhabricatorProjectColumnDetailController.php:7-23 | src/applications/project/controller/PhabricatorProjectColumnEditController.php:7-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:10 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:10-26 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:13-30 — before extracting anything, compare `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php` and `src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:10` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:47 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:47-64 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelViewController.php:54-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 matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17–18 lines × 2) src/applications/drydock/query/DrydockBlueprintSearchEngine.php:77 — src/applications/drydock/query/DrydockBlueprintSearchEngine.php:77-94 | src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php:83-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/query/DrydockBlueprintSearchEngine.php:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×3
  • Duplicated block (17 lines × 4) src/applications/countdown/controller/PhabricatorCountdownViewController.php:114 — src/applications/countdown/controller/PhabricatorCountdownViewController.php:114-130 | src/applications/paste/controller/PhabricatorPasteViewController.php:157-173 | src/applications/ponder/controller/PonderQuestionViewController.php:186-202 | src/applications/slowvote/controller/PhabricatorSlowvotePollController.php:125-141 — 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. 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 × 4) src/applications/differential/typeahead/DifferentialBlockingReviewerDatasource.php:77 — src/applications/differential/typeahead/DifferentialBlockingReviewerDatasource.php:77-93 | src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:65-81 | src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php:89-105 | src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php:79-95 — before extracting anything, compare `src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php` and `src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/typeahead/DifferentialBlockingReviewerDatasource.php:77` it does not close everything it opens, so those exact lines 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 × 4) src/applications/fund/query/FundBackerQuery.php:72 — src/applications/fund/query/FundBackerQuery.php:72-88 | src/applications/phortune/query/PhortuneCartQuery.php:156-172 | src/applications/phortune/query/PhortuneChargeQuery.php:98-114 | src/applications/phortune/query/PhortunePurchaseQuery.php:78-94 — before extracting anything, compare `src/applications/phortune/query/PhortuneCartQuery.php` and `src/applications/phortune/query/PhortuneChargeQuery.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) src/applications/calendar/xaction/PhabricatorCalendarEventFrequencyTransaction.php:60 — src/applications/calendar/xaction/PhabricatorCalendarEventFrequencyTransaction.php:60-76 | src/applications/calendar/xaction/PhabricatorCalendarImportFrequencyTransaction.php:27-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/xaction/PhabricatorCalendarEventFrequencyTransaction.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. 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 × 2) src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php:109 — src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php:109-124 | src/applications/harbormaster/xaction/build/HarbormasterBuildMessageResumeTransaction.php:99-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 `src/applications/harbormaster/xaction/build/HarbormasterBuildMessagePauseTransaction.php:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) src/applications/phortune/storage/PhortuneCartTransaction.php:35 — src/applications/phortune/storage/PhortuneCartTransaction.php:35-51 | src/applications/phortune/storage/PhortuneCartTransaction.php:66-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×3
  • Duplicated block (16 lines × 4) src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:91 — src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:91-106 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:106-121 | src/applications/nuance/controller/NuanceQueueViewController.php:63-78 | src/applications/project/controller/PhabricatorProjectManageController.php:84-99 — before extracting anything, compare `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php` and `src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 4) src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:222 — src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:222-237 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:95-110 | src/applications/project/controller/PhabricatorProjectManageController.php:111-126 | src/applications/spaces/controller/PhabricatorSpacesViewController.php:116-131 — 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 `src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 4) src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:8 — src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:8-23 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:8-23 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationReorderController.php:8-23 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationSubtypeController.php:8-23 — before extracting anything, compare `src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php` and `src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php` as WHOLE FILES: this scan already matched 3 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 `src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:8` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×3
  • Duplicated block (15–16 lines × 3) src/applications/phortune/controller/account/PhortuneAccountEmailViewController.php:38 — src/applications/phortune/controller/account/PhortuneAccountEmailViewController.php:38-52 | src/applications/phortune/controller/account/PhortuneAccountPaymentMethodViewController.php:44-59 | src/applications/phortune/controller/merchant/PhortuneMerchantProviderViewController.php:42-56 — 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 (15–16 lines × 3) src/applications/project/controller/PhabricatorProjectBoardImportController.php:8 — src/applications/project/controller/PhabricatorProjectBoardImportController.php:8-22 | src/applications/project/controller/PhabricatorProjectBoardReorderController.php:8-23 | src/applications/project/controller/PhabricatorProjectColumnHideController.php:9-24 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/project/controller/PhabricatorProjectColumnHideController.php:8` calls `getURIData` and `src/applications/project/controller/PhabricatorProjectBoardReorderController.php:7` 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 × 3) src/applications/project/menuitem/PhabricatorProjectManageProfileMenuItem.php:50 — src/applications/project/menuitem/PhabricatorProjectManageProfileMenuItem.php:50-65 | src/applications/project/menuitem/PhabricatorProjectMembersProfileMenuItem.php:40-55 | src/applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php:48-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×3
  • Duplicated block (14–15 lines × 3) src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:52 — src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:52-66 | src/applications/fund/controller/FundInitiativeCloseController.php:51-64 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationDisableController.php:40-54 — before extracting anything, compare `src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php` and `src/applications/fund/controller/FundInitiativeCloseController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:52` it begins part-way through the construct above it, so those 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 × 3) src/applications/fund/xaction/FundInitiativeNameTransaction.php:32 — src/applications/fund/xaction/FundInitiativeNameTransaction.php:32-45 | src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php:36-50 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:32-45 — before extracting anything, compare `src/applications/fund/xaction/FundInitiativeNameTransaction.php` and `src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–15 lines × 3) src/applications/project/controller/PhabricatorProjectBoardDisableController.php:35 — src/applications/project/controller/PhabricatorProjectBoardDisableController.php:35-49 | src/applications/project/controller/PhabricatorProjectBoardViewController.php:903-916 | src/applications/project/controller/PhabricatorProjectBoardViewController.php:996-1010 — before extracting anything, compare `src/applications/project/controller/PhabricatorProjectBoardDisableController.php` and `src/applications/project/controller/PhabricatorProjectBoardViewController.php` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/controller/PhabricatorProjectBoardDisableController.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. 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, `src/applications/project/controller/PhabricatorProjectBoardViewController.php:1014` calls `addHiddenInput` and `src/applications/project/controller/PhabricatorProjectBoardDisableController.php:53` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×3
  • Duplicated block (12–15 lines × 2) src/applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php:43 — src/applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php:43-57 | src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php:54-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12–15 lines × 2) src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php:74 — src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php:74-85 | src/applications/people/management/PhabricatorPeopleManagementWorkflow.php:20-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.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 (12–15 lines × 2) src/applications/people/controller/PhabricatorPeopleDisableController.php:89 — src/applications/people/controller/PhabricatorPeopleDisableController.php:89-103 | src/applications/people/controller/PhabricatorPeopleEmpowerController.php:43-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/people/controller/PhabricatorPeopleDisableController.php:89` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×3
  • Duplicated block (12 lines × 4) src/applications/badges/controller/PhabricatorBadgesCommentController.php:35 — src/applications/badges/controller/PhabricatorBadgesCommentController.php:35-46 | src/applications/ponder/controller/PonderAnswerCommentController.php:37-48 | src/applications/ponder/controller/PonderQuestionCommentController.php:34-45 | src/applications/slowvote/controller/PhabricatorSlowvoteCommentController.php:35-46 — before extracting anything, compare `src/applications/badges/controller/PhabricatorBadgesCommentController.php` and `src/applications/slowvote/controller/PhabricatorSlowvoteCommentController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/badges/controller/PhabricatorBadgesCommentController.php:49` calls `replaceOrDelete` and `src/applications/ponder/controller/PonderAnswerCommentController.php:51` 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 × 4) src/applications/drydock/controller/DrydockBlueprintDisableController.php:36 — src/applications/drydock/controller/DrydockBlueprintDisableController.php:36-47 | src/applications/oauthserver/controller/client/PhabricatorOAuthClientDisableController.php:33-44 | src/applications/phame/controller/post/PhamePostPublishController.php:41-52 | src/applications/project/controller/PhabricatorProjectSilenceController.php:57-68 — before extracting anything, compare `src/applications/drydock/controller/DrydockBlueprintDisableController.php` and `src/applications/project/controller/PhabricatorProjectSilenceController.php` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/controller/DrydockBlueprintDisableController.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. 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 (12 lines × 4) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:959 — src/applications/transactions/storage/PhabricatorApplicationTransaction.php:959-970 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:972-983 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:985-996 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:998-1009 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×3
  • Duplicated block (11 lines × 6) src/applications/almanac/controller/AlmanacBindingViewController.php:128 — src/applications/almanac/controller/AlmanacBindingViewController.php:128-138 | src/applications/almanac/controller/AlmanacDeviceViewController.php:93-103 | src/applications/almanac/controller/AlmanacNamespaceViewController.php:66-76 | src/applications/almanac/controller/AlmanacNetworkViewController.php:67-77 | src/applications/almanac/controller/AlmanacServiceViewController.php:98-108 | src/applications/diffusion/controller/DiffusionIdentityViewController.php:67-77 — before extracting anything, compare `src/applications/almanac/controller/AlmanacDeviceViewController.php` and `src/applications/almanac/controller/AlmanacNamespaceViewController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/almanac/controller/AlmanacBindingViewController.php:127` calls `getApplicationURI` and `src/applications/almanac/controller/AlmanacDeviceViewController.php:92` 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 × 6) src/applications/calendar/controller/PhabricatorCalendarEventJoinController.php:67 — src/applications/calendar/controller/PhabricatorCalendarEventJoinController.php:67-77 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:50-60 | src/applications/owners/controller/PhabricatorOwnersArchiveController.php:50-60 | src/applications/paste/controller/PhabricatorPasteArchiveController.php:49-59 | src/applications/pholio/controller/PholioMockArchiveController.php:49-59 | src/applications/slowvote/controller/PhabricatorSlowvoteCloseController.php:50-60 — before extracting anything, compare `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php` and `src/applications/owners/controller/PhabricatorOwnersArchiveController.php` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarEventJoinController.php:67` it begins part-way through the construct above it, so those 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 × 6) src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:48 — src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:48-59 | src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:58-69 | src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php:61-72 | src/applications/drydock/controller/DrydockBlueprintDisableController.php:42-53 | src/applications/fund/controller/FundInitiativeCloseController.php:47-57 | src/applications/project/controller/PhabricatorProjectSilenceController.php:63-74 — before extracting anything, compare `src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php` and `src/applications/fund/controller/FundInitiativeCloseController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarImportDisableController.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:55` calls `setContentSourceFromRequest` and `src/applications/drydock/controller/DrydockBlueprintDisableController.php:39` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) src/applications/phortune/query/PhortuneCartQuery.php:81 — src/applications/phortune/query/PhortuneCartQuery.php:81-88 | src/applications/phortune/query/PhortuneChargeQuery.php:63-70 | src/applications/phortune/query/PhortunePaymentMethodQuery.php:44-51 | src/applications/phortune/query/PhortuneSubscriptionQuery.php:57-64 — before extracting anything, compare `src/applications/phortune/query/PhortuneCartQuery.php` and `src/applications/phortune/query/PhortuneChargeQuery.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/query/PhortuneCartQuery.php:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/phortune/query/PhortuneChargeQuery.php:62` calls `setParentQuery` and `src/applications/phortune/query/PhortuneCartQuery.php:80` 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 × 4) src/applications/phriction/conduit/PhrictionCreateConduitAPIMethod.php:27 — src/applications/phriction/conduit/PhrictionCreateConduitAPIMethod.php:27-34 | src/applications/phriction/conduit/PhrictionEditConduitAPIMethod.php:27-34 | src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php:40-47 | src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php:40-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 all 4 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/phriction/conduit/PhrictionEditConduitAPIMethod.php:35` calls `needContent` and `src/applications/phriction/conduit/PhrictionCreateConduitAPIMethod.php:35` 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 × 4) src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php:11 — src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php:11-18 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php:11-18 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php:11-18 | src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldText.php:11-18 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×3
  • Duplicated block (34 lines × 2) src/applications/feed/application/PhabricatorFeedApplication.php:6 — src/applications/feed/application/PhabricatorFeedApplication.php:6-39 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/feed/application/PhabricatorFeedApplication.php:6` 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 (34 lines × 2) src/applications/legalpad/xaction/LegalpadDocumentPreambleTransaction.php:10 — src/applications/legalpad/xaction/LegalpadDocumentPreambleTransaction.php:10-54 | src/applications/transactions/xaction/PhabricatorEditEnginePreambleTransaction.php:9-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/legalpad/xaction/LegalpadDocumentPreambleTransaction.php:10` 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 (34 lines × 2) src/applications/auth/management/PhabricatorAuthManagementRevokeWorkflow.php:7 — src/applications/auth/management/PhabricatorAuthManagementRevokeWorkflow.php:7-47 | src/infrastructure/daemon/garbagecollector/management/PhabricatorGarbageCollectorManagementSetPolicyWorkflow.php:7-40 — 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.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×3
  • Duplicated block (7 lines × 2 locations) webroot/rsrc/js/application/diff/DiffChangesetList.js:1887 — webroot/rsrc/js/application/diff/DiffChangesetList.js:1887 · webroot/rsrc/js/application/diff/DiffChangesetList.js:1896 — 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) webroot/rsrc/js/application/diffusion/behavior-audit-preview.js:21 — webroot/rsrc/js/application/diffusion/behavior-audit-preview.js:21 · webroot/rsrc/js/core/behavior-remarkup-preview.js:30 — 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 (7 lines × 2 locations) webroot/rsrc/js/application/files/behavior-icon-composer.js:25 — webroot/rsrc/js/application/files/behavior-icon-composer.js:25 · webroot/rsrc/js/application/files/behavior-icon-composer.js:33 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X3 · Exception handling · Swallowed exception (empty catch) · ×3
  • Swallowed exception (empty catch) src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:597 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/applications/files/storage/PhabricatorFile.php:430 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/applications/files/transform/PhabricatorFileTransform.php:22 — 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 27) · ×2
  • (anonymous) (cyclomatic 27) webroot/rsrc/js/application/transactions/behavior-comment-actions.js:12 — (anonymous) has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 15 function items inside it that branch (add_row, find_option, redraw, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cyclomatic 27) webroot/rsrc/js/application/calendar/behavior-day-view.js:5 — (anonymous) has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 12 function items inside it that branch (findTodayClusters, updateEventsFromCluster, drawRows, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 23) · ×2
  • (anonymous) (cyclomatic 23) webroot/rsrc/js/core/behavior-line-linker.js:10 — (anonymous) has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (highlight, a function literal at line 39, a function literal at line 138, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cyclomatic 23) webroot/rsrc/js/application/diffusion/behavior-commit-graph.js:8 — (anonymous) has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 20) · ×2
  • (anonymous) (cyclomatic 20) webroot/rsrc/js/core/behavior-object-selector.js:9 — (anonymous) has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 11 function items inside it that branch (redrawList, onreceive, redrawAttached, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cyclomatic 20) webroot/rsrc/js/application/differential/behavior-populate.js:13 — (anonymous) has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 95, onredraw, get_lists, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 16) · ×2
  • (anonymous) (cyclomatic 16) webroot/rsrc/js/application/policy/behavior-policy-control.js:13 — (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 30, add_policy, render_option, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cyclomatic 16) webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js:10 — (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 9 function items inside it that branch (updateFormStatus, updateBrowserStatus, a function literal at line 82, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 59) · ×2
  • (anonymous) (cognitive 59) webroot/rsrc/js/core/behavior-fancy-datepicker.js:10 — (anonymous) has cognitive complexity 59 (threshold 15). Drivers by points: if/else 30 (38 pts), boolean chains 8, loops 7, match/switch 4 (6 pts) (nesting depth added 10). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 18 function items inside it that branch (render_day, write_date, getValidDate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cognitive 59) webroot/rsrc/js/core/darkconsole/behavior-dark-console.js:13 — (anonymous) has cognitive complexity 59 (threshold 15). Drivers by points: if/else 33 (47 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts), match/switch 1 (2 pts), ternaries 1 (nesting depth added 17). Most of this is not in the body itself: 9 of the 59 points are its own statements and the rest belongs to 25 function items inside it that branch (a function literal at line 355, render_request, a function literal at line 263, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 29) · ×2
  • (anonymous) (cognitive 29) webroot/rsrc/js/core/behavior-lightbox-attachments.js:12 — (anonymous) has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 3, loops 2, match/switch 1, ternaries 1 (nesting depth added 3). None of this is in the body itself: all 29 points belong to 13 function items inside it that branch (activateLightbox, lightBoxHandleKeyDown, loadLightBox, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • (anonymous) (cognitive 29) webroot/rsrc/js/application/differential/behavior-populate.js:13 — (anonymous) has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 29 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 95, onredraw, get_lists, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 24) · ×2
  • (anonymous) (cognitive 24) webroot/rsrc/js/application/projects/behavior-project-boards.js:13 — (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: loops 12 (16 pts), if/else 7 (8 pts) (nesting depth added 5). Of this number, 19 points are the body's own statements and 5 belong to 5 function items inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • (anonymous) (cognitive 24) webroot/rsrc/js/application/conpherence/behavior-durable-column.js:13 — (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (18 pts), ternaries 4, loops 1, match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 29 function items inside it that branch (a function literal at line 334, _drawColumn, _minimizeColumn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-oncopy.JX.behavior("phabricator-oncopy") · ×2
  • behavior-oncopy.JX.behavior("phabricator-oncopy")::onstartselect (cognitive 16) webroot/rsrc/js/core/behavior-oncopy.js:11 — behavior-oncopy.JX.behavior("phabricator-oncopy")::onstartselect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), error handling 3, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (behavior-oncopy.JX.behavior("phabricator-oncopy")::extract_text) 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.
  • behavior-oncopy.JX.behavior("phabricator-oncopy")::extract_text (cognitive 16) webroot/rsrc/js/core/behavior-oncopy.js:250 — behavior-oncopy.JX.behavior("phabricator-oncopy")::extract_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 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. This shape REPEATS in the file: one other method here (behavior-oncopy.JX.behavior("phabricator-oncopy")::onstartselect) 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:7 — src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:7-76 | src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php:7-85 | src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php:7-44 | src/applications/diffusion/controller/DiffusionRepositoryEditEnormousController.php:7-88 | src/applications/diffusion/controller/DiffusionRepositoryEditPublishingController.php:7-80 | src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php:7-64 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php:99 — src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php:99-135 | src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php:130-166 | src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php:186-222 | src/applications/search/menuitem/PhabricatorEditEngineProfileMenuItem.php:127-167 | src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php:103-144 | src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php:114-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.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×2
  • Duplicated block (41 lines × 2) src/applications/files/controller/PhabricatorFileDetachController.php:77 — src/applications/files/controller/PhabricatorFileDetachController.php:77-117 | src/applications/files/controller/PhabricatorFileUICurtainAttachController.php:90-130 — before extracting anything, compare `src/applications/files/controller/PhabricatorFileDetachController.php` and `src/applications/files/controller/PhabricatorFileUICurtainAttachController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/files/controller/PhabricatorFileDetachController.php:77` 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 (41 lines × 2) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:68 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:68-108 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:68-108 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php` and `src/applications/phame/controller/post/PhamePostHeaderPictureController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×2
  • Duplicated block (40 lines × 2) src/applications/almanac/controller/AlmanacConsoleController.php:16 — src/applications/almanac/controller/AlmanacConsoleController.php:16-55 | src/applications/config/controller/PhabricatorConfigConsoleController.php:13-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (40 lines × 2) src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:180 — src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:180-219 | src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:259-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:180` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) src/applications/people/conduit/UserDisableConduitAPIMethod.php:39 — src/applications/people/conduit/UserDisableConduitAPIMethod.php:39-70 | src/applications/people/conduit/UserEnableConduitAPIMethod.php:39-70 — before extracting anything, compare `src/applications/people/conduit/UserDisableConduitAPIMethod.php` and `src/applications/people/conduit/UserEnableConduitAPIMethod.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (32 lines × 2) src/applications/phortune/controller/cart/PhortuneCartViewController.php:77 — src/applications/phortune/controller/cart/PhortuneCartViewController.php:77-108 | src/applications/phortune/controller/external/PhortuneExternalOrderController.php:45-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/controller/cart/PhortuneCartViewController.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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) src/applications/celerity/CeleritySpriteGenerator.php:6 — src/applications/celerity/CeleritySpriteGenerator.php:6-34 | src/applications/celerity/CeleritySpriteGenerator.php:38-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (29 lines × 2) src/applications/files/document/PhabricatorAudioDocumentEngine.php:38 — src/applications/files/document/PhabricatorAudioDocumentEngine.php:38-66 | src/applications/files/document/PhabricatorVideoDocumentEngine.php:44-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×2
  • Duplicated block (23–24 lines × 2) src/applications/calendar/controller/PhabricatorCalendarImportDropController.php:7 — src/applications/calendar/controller/PhabricatorCalendarImportDropController.php:7-30 | src/applications/xhprof/controller/PhabricatorXHProfDropController.php:7-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarImportDropController.php:7` it does not close everything it opens, so those 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 (23–24 lines × 2) src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:179 — src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:179-202 | src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:370-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×2
  • Duplicated block (23 lines × 3) src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:56 — src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:56-78 | src/applications/drydock/controller/DrydockBlueprintDisableController.php:40-62 | src/applications/project/controller/PhabricatorProjectSilenceController.php:61-83 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php` and `src/applications/drydock/controller/DrydockBlueprintDisableController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:55` calls `setContentSourceFromRequest` and `src/applications/drydock/controller/DrydockBlueprintDisableController.php:39` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (23 lines × 3) src/applications/differential/herald/DifferentialRevisionPackageOwnerHeraldField.php:9 — src/applications/differential/herald/DifferentialRevisionPackageOwnerHeraldField.php:9-31 | src/applications/diffusion/herald/DiffusionCommitPackageOwnerHeraldField.php:9-32 | src/applications/diffusion/herald/DiffusionPreCommitContentPackageOwnerHeraldField.php:9-31 — 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 `src/applications/differential/herald/DifferentialRevisionPackageOwnerHeraldField.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19–23 lines × 2) · ×2
  • Duplicated block (19–23 lines × 2) src/applications/auth/view/PhabricatorAuthSSHKeyTableView.php:93 — src/applications/auth/view/PhabricatorAuthSSHKeyTableView.php:93-115 | src/applications/drydock/controller/DrydockController.php:41-59 — 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 (19–23 lines × 2) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementCancelWorkflow.php:20 — src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementCancelWorkflow.php:20-42 | src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementPriorityWorkflow.php:46-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementCancelWorkflow.php:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×2
  • Duplicated block (21–23 lines × 2) src/applications/config/option/PhabricatorCoreConfigOptions.php:277 — src/applications/config/option/PhabricatorCoreConfigOptions.php:277-299 | src/applications/config/option/PhabricatorSecurityConfigOptions.php:298-318 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/option/PhabricatorCoreConfigOptions.php:277` 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 (21–23 lines × 2) src/applications/dashboard/controller/PhabricatorDashboardConsoleController.php:49 — src/applications/dashboard/controller/PhabricatorDashboardConsoleController.php:49-71 | src/applications/drydock/controller/DrydockConsoleController.php:68-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/PhabricatorDashboardConsoleController.php:49` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×2
  • Duplicated block (20–22 lines × 2) src/applications/diffusion/controller/DiffusionCompareController.php:247 — src/applications/diffusion/controller/DiffusionCompareController.php:247-268 | src/applications/diffusion/controller/DiffusionLintController.php:312-331 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionCompareController.php:247` it does not close everything it opens, so those 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–22 lines × 2) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:952 — src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:952-973 | src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1153-1172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:952` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:951` calls `getBuiltinOrders` and `src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1151` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×2
  • Duplicated block (19–21 lines × 2) src/applications/audit/view/PhabricatorAuditTransactionView.php:57 — src/applications/audit/view/PhabricatorAuditTransactionView.php:57-75 | src/applications/differential/view/DifferentialTransactionView.php:89-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/audit/view/PhabricatorAuditTransactionView.php:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–21 lines × 2) src/applications/differential/engine/DifferentialDiffExtractionEngine.php:55 — src/applications/differential/engine/DifferentialDiffExtractionEngine.php:55-73 | src/applications/diffusion/controller/DiffusionBrowseController.php:726-746 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/engine/DifferentialDiffExtractionEngine.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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×2
  • Duplicated block (20–21 lines × 2) src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:48 — src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:48-68 | src/applications/fund/controller/FundInitiativeCloseController.php:47-66 — before extracting anything, compare `src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php` and `src/applications/fund/controller/FundInitiativeCloseController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarImportDisableController.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 (20–21 lines × 2) src/applications/tokens/controller/PhabricatorTokenGivenController.php:57 — src/applications/tokens/controller/PhabricatorTokenGivenController.php:57-76 | src/applications/tokens/controller/PhabricatorTokenLeaderController.php:40-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/tokens/controller/PhabricatorTokenGivenController.php:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 5) · ×2
  • Duplicated block (20 lines × 5) src/applications/auth/query/PhabricatorAuthContactNumberQuery.php:50 — src/applications/auth/query/PhabricatorAuthContactNumberQuery.php:50-69 | src/applications/auth/query/PhabricatorAuthPasswordQuery.php:44-63 | src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php:80-99 | src/applications/drydock/query/DrydockRepositoryOperationQuery.php:126-145 | src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php:191-210 — before extracting anything, compare `src/applications/auth/query/PhabricatorAuthPasswordQuery.php` and `src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php:102` calls `array`, `foreach` and `src/applications/auth/query/PhabricatorAuthContactNumberQuery.php:72` 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 (20 lines × 5) src/applications/phortune/query/PhortuneAccountEmailQuery.php:67 — src/applications/phortune/query/PhortuneAccountEmailQuery.php:67-86 | src/applications/phortune/query/PhortuneCartQuery.php:160-179 | src/applications/phortune/query/PhortuneChargeQuery.php:102-121 | src/applications/phortune/query/PhortunePaymentMethodQuery.php:104-123 | src/applications/phortune/query/PhortuneSubscriptionQuery.php:147-166 — before extracting anything, compare `src/applications/phortune/query/PhortuneAccountEmailQuery.php` and `src/applications/phortune/query/PhortuneChargeQuery.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×2
  • Duplicated block (20 lines × 4) src/applications/auth/query/PhabricatorAuthChallengeQuery.php:46 — src/applications/auth/query/PhabricatorAuthChallengeQuery.php:46-65 | src/applications/auth/query/PhabricatorAuthFactorConfigQuery.php:44-63 | src/applications/auth/query/PhabricatorExternalAccountQuery.php:148-167 | src/applications/settings/query/PhabricatorUserPreferencesQuery.php:149-168 — 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.
  • Duplicated block (20 lines × 4) src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:90 — src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:90-109 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:101-120 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:102-121 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:106-125 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` and `src/applications/people/controller/PhabricatorPeopleProfilePictureController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×2
  • Duplicated block (20 lines × 3) src/applications/almanac/controller/AlmanacDeviceViewController.php:201 — src/applications/almanac/controller/AlmanacDeviceViewController.php:201-222 | src/applications/drydock/controller/DrydockController.php:8-27 | src/applications/drydock/controller/DrydockController.php:46-76 — 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 (20 lines × 3) src/applications/phortune/query/PhortuneAccountQuery.php:88 — src/applications/phortune/query/PhortuneAccountQuery.php:88-107 | src/applications/phortune/query/PhortuneMerchantQuery.php:82-101 | src/applications/project/query/PhabricatorProjectQuery.php:493-512 — before extracting anything, compare `src/applications/phortune/query/PhortuneAccountQuery.php` and `src/applications/phortune/query/PhortuneMerchantQuery.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×2
  • Duplicated block (18–20 lines × 2) src/applications/auth/controller/PhabricatorAuthOneTimeLoginController.php:240 — src/applications/auth/controller/PhabricatorAuthOneTimeLoginController.php:240-257 | src/applications/auth/controller/PhabricatorAuthSetExternalController.php:9-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18–20 lines × 2) src/applications/herald/controller/HeraldWebhookViewController.php:129 — src/applications/herald/controller/HeraldWebhookViewController.php:129-148 | src/applications/paste/controller/PhabricatorPasteViewController.php:103-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/herald/controller/HeraldWebhookViewController.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.
D4 · Code Duplication · Duplicated block (15–18 lines × 3) · ×2
  • Duplicated block (15–18 lines × 3) src/applications/files/controller/PhabricatorFileViewController.php:79 — src/applications/files/controller/PhabricatorFileViewController.php:79-93 | src/applications/harbormaster/controller/HarbormasterPlanViewController.php:72-89 | src/applications/legalpad/controller/LegalpadDocumentManageController.php:64-78 — 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 (15–18 lines × 3) src/applications/phortune/controller/account/PhortuneAccountOrdersController.php:21 — src/applications/phortune/controller/account/PhortuneAccountOrdersController.php:21-36 | src/applications/phortune/controller/account/PhortuneAccountOverviewController.php:31-48 | src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php:19-33 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/phortune/controller/account/PhortuneAccountOverviewController.php:29` calls `buildStatusView`, `buildInvoicesSection` and `src/applications/phortune/controller/account/PhortuneAccountOrdersController.php:19` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×2
  • Duplicated block (16–17 lines × 3) src/applications/auth/controller/config/PhabricatorAuthListController.php:102 — src/applications/auth/controller/config/PhabricatorAuthListController.php:102-118 | src/applications/auth/controller/message/PhabricatorAuthMessageListController.php:62-77 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderListController.php:64-79 — before extracting anything, compare `src/applications/auth/controller/config/PhabricatorAuthListController.php` and `src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderListController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16–17 lines × 3) src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:70 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php:70-85 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelViewController.php:93-108 | src/applications/phurl/controller/PhabricatorPhurlURLViewController.php:102-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (15–17 lines × 3) · ×2
  • Duplicated block (15–17 lines × 3) src/applications/calendar/controller/PhabricatorCalendarEventAvailabilityController.php:7 — src/applications/calendar/controller/PhabricatorCalendarEventAvailabilityController.php:7-21 | src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php:7-23 | src/applications/calendar/controller/PhabricatorCalendarEventJoinController.php:7-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The 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–17 lines × 3) src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php:12 — src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php:12-28 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php:13-29 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php:13-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12–17 lines × 2) · ×2
  • Duplicated block (12–17 lines × 2) REDACTED:299 — REDACTED:299-310 | REDACTED:339-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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 (12–17 lines × 2) src/applications/legalpad/controller/LegalpadDocumentManageController.php:127 — src/applications/legalpad/controller/LegalpadDocumentManageController.php:127-138 | src/applications/people/controller/PhabricatorPeopleProfileManageController.php:105-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/legalpad/controller/LegalpadDocumentManageController.php:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–16 lines × 6) · ×2
  • Duplicated block (15–16 lines × 6) src/applications/badges/controller/PhabricatorBadgesArchiveController.php:40 — src/applications/badges/controller/PhabricatorBadgesArchiveController.php:40-55 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php:40-54 | src/applications/owners/controller/PhabricatorOwnersArchiveController.php:40-54 | src/applications/paste/controller/PhabricatorPasteArchiveController.php:39-53 | src/applications/phame/controller/blog/PhameBlogArchiveController.php:39-53 | src/applications/project/controller/PhabricatorProjectArchiveController.php:40-54 — before extracting anything, compare `src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php` and `src/applications/owners/controller/PhabricatorOwnersArchiveController.php` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/controller/PhabricatorBadgesArchiveController.php:40` it begins part-way through the construct above it, so those 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 (15–16 lines × 6) src/applications/guides/module/PhabricatorGuideInstallModule.php:36 — src/applications/guides/module/PhabricatorGuideInstallModule.php:36-50 | src/applications/guides/module/PhabricatorGuideInstallModule.php:93-107 | src/applications/guides/module/PhabricatorGuideInstallModule.php:122-136 | src/applications/guides/module/PhabricatorGuideInstallModule.php:146-161 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:90-104 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:157-171 — before extracting anything, compare `src/applications/guides/module/PhabricatorGuideInstallModule.php` and `src/applications/guides/module/PhabricatorGuideQuickStartModule.php` as WHOLE FILES: this scan already matched 4 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 `src/applications/guides/module/PhabricatorGuideInstallModule.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/guides/module/PhabricatorGuideInstallModule.php:52` calls `id`, `PhabricatorAuthProviderConfigQuery`, `setViewer` and `src/applications/guides/module/PhabricatorGuideInstallModule.php:110` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–16 lines × 4) · ×2
  • Duplicated block (15–16 lines × 4) src/applications/almanac/controller/AlmanacBindingViewController.php:119 — src/applications/almanac/controller/AlmanacBindingViewController.php:119-133 | src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php:73-88 | src/applications/badges/controller/PhabricatorBadgesViewController.php:83-97 | src/applications/owners/controller/PhabricatorOwnersDetailController.php:241-255 — 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 `src/applications/almanac/controller/AlmanacBindingViewController.php:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 4) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:95 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:95-109 | src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:82-97 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:95-109 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:85-99 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/controller/ConpherenceRoomPictureController.php:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×2
  • Duplicated block (14–16 lines × 2) src/applications/differential/storage/DifferentialTransaction.php:228 — src/applications/differential/storage/DifferentialTransaction.php:228-241 | src/applications/differential/storage/DifferentialTransaction.php:326-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–16 lines × 2) src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php:113 — src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php:113-128 | src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php:50-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×2
  • Duplicated block (15 lines × 5) src/applications/badges/controller/PhabricatorBadgesArchiveController.php:11 — src/applications/badges/controller/PhabricatorBadgesArchiveController.php:11-25 | src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php:12-26 | src/applications/owners/controller/PhabricatorOwnersArchiveController.php:11-25 | src/applications/phame/controller/blog/PhameBlogArchiveController.php:11-25 | src/applications/project/controller/PhabricatorProjectArchiveController.php:11-25 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogArchiveController.php` and `src/applications/project/controller/PhabricatorProjectArchiveController.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 `src/applications/badges/controller/PhabricatorBadgesArchiveController.php:11` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php:9` calls `array` and `src/applications/badges/controller/PhabricatorBadgesArchiveController.php:8` 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) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:43 — src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:43-57 | src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php:67-81 | src/applications/phortune/controller/merchant/PhortuneMerchantProviderDisableController.php:57-71 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultCreateController.php:43-57 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationIsEditController.php:41-55 — before extracting anything, compare `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php` and `src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:43` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 6) · ×2
  • Duplicated block (14 lines × 6) src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:71 — src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:71-84 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:86-99 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:101-114 | src/applications/nuance/controller/NuanceQueueViewController.php:58-71 | src/applications/nuance/controller/NuanceSourceViewController.php:71-84 | src/applications/project/controller/PhabricatorProjectManageController.php:79-92 — before extracting anything, compare `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php` and `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/nuance/controller/NuanceSourceViewController.php:68` calls `id`, `PhabricatorActionListView`, `setUser` and `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:69` 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 × 6) src/applications/conpherence/query/ConpherenceThreadQuery.php:106 — src/applications/conpherence/query/ConpherenceThreadQuery.php:106-119 | src/applications/phame/query/PhameBlogQuery.php:86-99 | src/applications/phame/query/PhameBlogQuery.php:114-127 | src/applications/phame/query/PhamePostQuery.php:78-91 | src/applications/phortune/query/PhortuneMerchantQuery.php:49-62 | src/applications/repository/query/PhabricatorRepositoryQuery.php:382-395 — there are 6 copies across 5 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 `src/applications/conpherence/query/ConpherenceThreadQuery.php:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×2
  • Duplicated block (14 lines × 4) src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:107 — src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:107-120 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:170-183 | src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:217-230 | src/applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php:165-178 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php:122` calls `id`, `AphrontRedirectResponse`, `setURI` and `src/applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php:179` 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 × 4) src/applications/files/controller/PhabricatorFileViewController.php:79 — src/applications/files/controller/PhabricatorFileViewController.php:79-92 | src/applications/harbormaster/controller/HarbormasterPlanViewController.php:72-88 | src/applications/legalpad/controller/LegalpadDocumentManageController.php:64-77 | src/applications/phurl/controller/PhabricatorPhurlURLViewController.php:45-59 — 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 `src/applications/phurl/controller/PhabricatorPhurlURLViewController.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×2
  • Duplicated block (12–14 lines × 2) src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:236 — src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:236-247 | src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:73-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12–14 lines × 2) src/applications/pholio/query/PholioMockSearchEngine.php:67 — src/applications/pholio/query/PholioMockSearchEngine.php:67-80 | src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php:84-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/pholio/query/PholioMockSearchEngine.php:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php:97` calls `setParameter`, `array` and `src/applications/pholio/query/PholioMockSearchEngine.php:81` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×2
  • Duplicated block (12–13 lines × 3) src/applications/search/engine/PhabricatorProfileMenuEngine.php:567 — src/applications/search/engine/PhabricatorProfileMenuEngine.php:567-578 | src/applications/search/engine/PhabricatorProfileMenuEngine.php:1037-1049 | src/applications/search/engine/PhabricatorProfileMenuEngine.php:1195-1207 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12–13 lines × 3) src/applications/uiexample/examples/PHUIListExample.php:65 — src/applications/uiexample/examples/PHUIListExample.php:65-77 | src/applications/uiexample/examples/PHUIListExample.php:136-147 | src/applications/uiexample/examples/PHUIListExample.php:168-179 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/uiexample/examples/PHUIListExample.php:164` calls `setHref`, `setSelected` and `src/applications/uiexample/examples/PHUIListExample.php:62` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) src/applications/differential/controller/DifferentialRevisionViewController.php:1322 — src/applications/differential/controller/DifferentialRevisionViewController.php:1322-1334 | src/applications/differential/controller/DifferentialRevisionViewController.php:1433-1443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11–13 lines × 2) src/applications/repository/customfield/PhabricatorCommitBranchesField.php:38 — src/applications/repository/customfield/PhabricatorCommitBranchesField.php:38-50 | src/applications/repository/customfield/PhabricatorCommitTagsField.php:38-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/repository/customfield/PhabricatorCommitBranchesField.php:38` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×2
  • Duplicated block (11 lines × 7) src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:71 — src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:71-82 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:86-97 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:101-112 | src/applications/nuance/controller/NuanceItemViewController.php:57-67 | src/applications/nuance/controller/NuanceQueueViewController.php:58-69 | src/applications/nuance/controller/NuanceSourceViewController.php:71-82 | src/applications/project/controller/PhabricatorProjectManageController.php:79-90 — before extracting anything, compare `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php` and `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.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 `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/nuance/controller/NuanceSourceViewController.php:68` calls `id`, `PhabricatorActionListView`, `setUser` and `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:69` 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 × 7) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:215 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:215-226 | src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:120-130 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:221-232 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:117-127 | src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodCreateController.php:316-329 | src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodEditController.php:81-94 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:111-122 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×2
  • Duplicated block (10 lines × 5) src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:7 — src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:7-16 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:7-16 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationReorderController.php:7-16 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationSaveController.php:7-16 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationSubtypeController.php:7-16 — before extracting anything, compare `src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php` and `src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php` as WHOLE FILES: this scan already matched 3 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.
  • Duplicated block (10 lines × 5) src/applications/almanac/query/AlmanacInterfaceQuery.php:137 — src/applications/almanac/query/AlmanacInterfaceQuery.php:137-146 | src/applications/almanac/query/AlmanacServiceQuery.php:73-82 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:201-210 | src/applications/phriction/query/PhrictionContentQuery.php:70-79 | src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php:166-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) src/applications/auth/controller/config/PhabricatorAuthListController.php:90 — src/applications/auth/controller/config/PhabricatorAuthListController.php:90-99 | src/applications/auth/controller/message/PhabricatorAuthMessageListController.php:51-59 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderListController.php:52-61 — before extracting anything, compare `src/applications/auth/controller/config/PhabricatorAuthListController.php` and `src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderListController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (9–10 lines × 3) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:346 — src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:346-355 | src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:510-518 | src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:530-538 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:346` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) src/applications/auth/controller/PhabricatorAuthRegisterController.php:327 — src/applications/auth/controller/PhabricatorAuthRegisterController.php:327-334 | src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:191-199 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/PhabricatorAuthRegisterController.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. 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–9 lines × 2) src/infrastructure/storage/lisk/LiskDAO.php:1592 — src/infrastructure/storage/lisk/LiskDAO.php:1592-1599 | src/infrastructure/storage/lisk/LiskDAO.php:1610-1618 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/storage/lisk/LiskDAO.php:1592` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (58 lines × 11) · ×2
  • Duplicated block (58 lines × 11) src/applications/badges/application/PhabricatorBadgesApplication.php:6 — src/applications/badges/application/PhabricatorBadgesApplication.php:6-69 | src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/countdown/application/PhabricatorCountdownApplication.php:6-63 | src/applications/drydock/application/PhabricatorDrydockApplication.php:6-118 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 | src/applications/herald/application/PhabricatorHeraldApplication.php:6-91 | src/applications/owners/application/PhabricatorOwnersApplication.php:6-75 | src/applications/packages/application/PhabricatorPackagesApplication.php:6-86 | src/applications/phurl/application/PhabricatorPhurlApplication.php:6-72 | src/applications/slowvote/application/PhabricatorSlowvoteApplication.php:6-70 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/countdown/application/PhabricatorCountdownApplication.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 589 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/application/PhabricatorBadgesApplication.php:6` 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 (58 lines × 11) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/countdown/application/PhabricatorCountdownApplication.php:6-63 | src/applications/diviner/application/PhabricatorDivinerApplication.php:6-80 | src/applications/drydock/application/PhabricatorDrydockApplication.php:6-118 | src/applications/fund/application/PhabricatorFundApplication.php:6-70 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 | src/applications/herald/application/PhabricatorHeraldApplication.php:6-91 | src/applications/macro/application/PhabricatorMacroApplication.php:6-63 | src/applications/owners/application/PhabricatorOwnersApplication.php:6-75 | src/applications/slowvote/application/PhabricatorSlowvoteApplication.php:6-70 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/countdown/application/PhabricatorCountdownApplication.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 589 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) src/applications/almanac/controller/AlmanacDeviceController.php:11 — src/applications/almanac/controller/AlmanacDeviceController.php:11-16 | src/applications/almanac/controller/AlmanacNamespaceController.php:6-11 | src/applications/almanac/controller/AlmanacNetworkController.php:6-11 | src/applications/almanac/controller/AlmanacServiceController.php:6-11 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. 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) src/applications/calendar/editor/PhabricatorCalendarEventEditor.php:91 — src/applications/calendar/editor/PhabricatorCalendarEventEditor.php:91-97 | src/applications/conpherence/editor/ConpherenceEditor.php:89-95 | src/applications/legalpad/editor/LegalpadDocumentEditor.php:15-21 | src/applications/phurl/editor/PhabricatorPhurlURLEditor.php:27-32 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×2
  • Duplicated block (8 lines × 6) src/applications/auth/xaction/PhabricatorAuthContactNumberNumberTransaction.php:22 — src/applications/auth/xaction/PhabricatorAuthContactNumberNumberTransaction.php:22-29 | src/applications/dashboard/xaction/dashboard/PhabricatorDashboardIconTransaction.php:17-24 | src/applications/dashboard/xaction/dashboard/PhabricatorDashboardNameTransaction.php:17-24 | src/applications/dashboard/xaction/panel/PhabricatorDashboardPanelNameTransaction.php:17-24 | src/applications/dashboard/xaction/portal/PhabricatorDashboardPortalNameTransaction.php:17-24 | src/applications/transactions/xaction/PhabricatorEditEngineSubtypeTransaction.php:17-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. 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) src/applications/calendar/controller/PhabricatorCalendarImportListController.php:13 — src/applications/calendar/controller/PhabricatorCalendarImportListController.php:13-21 | src/applications/herald/controller/HeraldRuleListController.php:21-29 | src/applications/passphrase/controller/PassphraseController.php:29-37 | src/applications/phlux/controller/PhluxController.php:6-13 | src/applications/pholio/controller/PholioController.php:11-19 | src/applications/slowvote/controller/PhabricatorSlowvoteListController.php:17-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php:13 — src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php:13-19 | src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php:36-42 | src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php:46-52 | src/applications/dashboard/install/PhabricatorDashboardHomeInstallWorkflow.php:35-41 | src/applications/dashboard/install/PhabricatorDashboardHomeInstallWorkflow.php:45-51 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 5) src/applications/slowvote/constants/SlowvotePollResponseVisibility.php:34 — src/applications/slowvote/constants/SlowvotePollResponseVisibility.php:34-40 | src/applications/slowvote/constants/SlowvotePollResponseVisibility.php:44-50 | src/applications/slowvote/constants/SlowvotePollStatus.php:33-39 | src/applications/slowvote/constants/SlowvotePollVotingMethod.php:33-39 | src/applications/slowvote/constants/SlowvotePollVotingMethod.php:43-49 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×2
  • Outbound HTTP without resilience support/aphlict/server/lib/AphlictPeer.js:46 — `https.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience support/aphlict/server/lib/AphlictPeer.js:48 — `http.request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×2
  • Duplicated block (18 lines × 2 locations) webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:252 — webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:252 · webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:274 — 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 (18 lines × 2 locations) webroot/rsrc/js/application/diff/DiffChangesetList.js:418 — webroot/rsrc/js/application/diff/DiffChangesetList.js:418 · webroot/rsrc/js/application/diff/DiffChangesetList.js:470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) webroot/rsrc/js/application/diff/DiffChangesetList.js:2819 — webroot/rsrc/js/application/diff/DiffChangesetList.js:2819 · webroot/rsrc/js/core/behavior-oncopy.js:158 — 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 (15 lines × 2 locations) webroot/rsrc/js/application/repository/repository-crossreference.js:59 — webroot/rsrc/js/application/repository/repository-crossreference.js:59 · webroot/rsrc/js/application/repository/repository-crossreference.js:328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (14 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (14 matched lines × 2 locations) webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:810 — webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:810 · webroot/rsrc/js/application/projects/behavior-project-boards.js:37 — the two spans are one implementation copied and then locally edited — 67 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (14 matched lines × 2 locations) webroot/rsrc/js/application/projects/WorkboardController.js:153 — webroot/rsrc/js/application/projects/WorkboardController.js:153 · webroot/rsrc/js/application/projects/WorkboardController.js:178 — the two spans are one implementation copied and then locally edited — 81 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.
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (11 matched lines × 2 locations) webroot/rsrc/js/application/projects/WorkboardController.js:103 — webroot/rsrc/js/application/projects/WorkboardController.js:103 · webroot/rsrc/js/phuix/PHUIXFormationColumnView.js:46 — the two spans are one implementation copied and then locally edited — 72 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (11 matched lines × 2 locations) webroot/rsrc/js/phuix/PHUIXButtonView.js:33 — webroot/rsrc/js/phuix/PHUIXButtonView.js:33 · webroot/rsrc/js/phuix/PHUIXIconView.js:21 — the two spans are one implementation copied and then locally edited — 68 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×2
  • Duplicated block (10 lines × 2 locations) webroot/rsrc/js/application/diff/DiffChangeset.js:1035 — webroot/rsrc/js/application/diff/DiffChangeset.js:1035 · webroot/rsrc/js/application/diff/DiffInline.js:745 — 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 (10 lines × 2 locations) webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:172 — webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:172 · webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (10 matched lines × 2 locations) webroot/rsrc/js/application/diff/DiffInline.js:1115 — webroot/rsrc/js/application/diff/DiffInline.js:1115 · webroot/rsrc/js/application/files/behavior-document-engine.js:12 — the two spans are one implementation copied and then locally edited — 58 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (10 matched lines × 2 locations) webroot/rsrc/js/application/drydock/drydock-live-operation-status.js:9 — webroot/rsrc/js/application/drydock/drydock-live-operation-status.js:9 · webroot/rsrc/js/phui/behavior-phui-timer-control.js:8 — the two spans are one implementation copied and then locally edited — 52 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×2
  • Duplicated block (9 lines × 2 locations) webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:359 — webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:359 · webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:392 — both copies are in the same file, so extract the 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) webroot/rsrc/js/application/diff/DiffChangesetList.js:467 — webroot/rsrc/js/application/diff/DiffChangesetList.js:467 · webroot/rsrc/js/application/diff/DiffChangesetList.js:611 — 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 (9 lines × 3 locations) · ×2
  • Duplicated block (9 lines × 3 locations) webroot/rsrc/js/application/diff/DiffChangeset.js:866 — webroot/rsrc/js/application/diff/DiffChangeset.js:866 · webroot/rsrc/js/application/diff/DiffChangesetList.js:1986 · webroot/rsrc/js/application/diff/DiffChangesetList.js:2020 — the 3 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 (9 lines × 3 locations) webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:117 — webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:117 · webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:197 · webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:246 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (9 matched lines × 2 locations) webroot/rsrc/js/application/herald/HeraldRuleEditor.js:373 — webroot/rsrc/js/application/herald/HeraldRuleEditor.js:373 · webroot/rsrc/js/phuix/PHUIXFormControl.js:350 — the two spans are one implementation copied and then locally edited — 85 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (9 matched lines × 2 locations) webroot/rsrc/js/core/behavior-refresh-csrf.js:121 — webroot/rsrc/js/core/behavior-refresh-csrf.js:121 · webroot/rsrc/js/core/behavior-refresh-csrf.js:137 — the two spans are one implementation copied and then locally edited — 54 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.
R10 · Code Duplication · Duplicated block (8 lines × 4 locations) · ×2
  • Duplicated block (8 lines × 4 locations) webroot/rsrc/js/application/config/behavior-reorder-fields.js:40 — webroot/rsrc/js/application/config/behavior-reorder-fields.js:40 · webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:19 · webroot/rsrc/js/application/search/behavior-reorder-queries.js:19 · webroot/rsrc/js/core/behavior-reorder-applications.js:19 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (8 lines × 4 locations) webroot/rsrc/js/application/diff/DiffChangesetList.js:337 — webroot/rsrc/js/application/diff/DiffChangesetList.js:337 · webroot/rsrc/js/application/diff/DiffChangesetList.js:418 · webroot/rsrc/js/application/diff/DiffChangesetList.js:470 · webroot/rsrc/js/application/diff/DiffChangesetList.js:614 — 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.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×2
  • Duplicated block (8 lines × 2 locations) webroot/rsrc/js/application/transactions/behavior-comment-actions.js:243 — webroot/rsrc/js/application/transactions/behavior-comment-actions.js:243 · webroot/rsrc/js/application/transactions/behavior-transaction-comment-form.js:33 — 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 (8 lines × 2 locations) webroot/rsrc/js/application/uiexample/gesture-example.js:67 — webroot/rsrc/js/application/uiexample/gesture-example.js:67 · webroot/rsrc/js/application/uiexample/gesture-example.js:76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×2
  • Process-global state is restored only on the happy path conf/__init_conf__.php:3 — `phabricator_read_config_file` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 49, put back at line 61) and the `display_errors` ini setting (changed at line 55, put back at line 62) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path src/infrastructure/time/PhabricatorTime.php:51 — `parseLocalTime` 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 54, put back at line 59) — 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.
D1 · Cyclomatic Complexity · PhabricatorAuthRegisterController.handleRequest (cyclomatic 88) · ×1
  • PhabricatorAuthRegisterController.handleRequest (cyclomatic 88) src/applications/auth/controller/PhabricatorAuthRegisterController.php:10 — PhabricatorAuthRegisterController.handleRequest has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-pholio-mock-view.JX.behavior("pholio-mock-view") (cyclomatic 75) · ×1
  • behavior-pholio-mock-view.JX.behavior("pholio-mock-view") (cyclomatic 75) webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:16 — behavior-pholio-mock-view.JX.behavior("pholio-mock-view") has cyclomatic complexity 75 (threshold 15). Most of this is not in the body itself: 2 of the 75 points are its own statements and the rest belongs to 29 function items inside it that branch (redraw_inlines, resize_selection, render_image_info, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 75) · ×1
  • (anonymous) (cyclomatic 75) webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:16 — (anonymous) has cyclomatic complexity 75 (threshold 15). Most of this is not in the body itself: 2 of the 75 points are its own statements and the rest belongs to 50 function items inside it that branch (redraw_inlines, resize_selection, render_image_info, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · qsprintf.xsprintf_query (cyclomatic 69) · ×1
  • qsprintf.xsprintf_query (cyclomatic 69) src/infrastructure/storage/xsprintf/qsprintf.php:90 — qsprintf.xsprintf_query 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.
D1 · Cyclomatic Complexity · DifferentialChangesetParser.render (cyclomatic 65) · ×1
  • DifferentialChangesetParser.render (cyclomatic 65) src/applications/differential/parser/DifferentialChangesetParser.php:749 — DifferentialChangesetParser.render has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransaction.getTitle (cyclomatic 65) · ×1
  • PhabricatorApplicationTransaction.getTitle (cyclomatic 65) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:943 — PhabricatorApplicationTransaction.getTitle has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repository-crossreference.JX.behavior("repository-crossreference") (cyclomatic 64) · ×1
  • repository-crossreference.JX.behavior("repository-crossreference") (cyclomatic 64) webroot/rsrc/js/application/repository/repository-crossreference.js:9 — repository-crossreference.JX.behavior("repository-crossreference") has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 3 of the 64 points are its own statements and the rest belongs to 13 function items inside it that branch (openSearch, a function literal at line 58, a function literal at line 325, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 64) · ×1
  • (anonymous) (cyclomatic 64) webroot/rsrc/js/application/repository/repository-crossreference.js:9 — (anonymous) has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 3 of the 64 points are its own statements and the rest belongs to 18 function items inside it that branch (openSearch, a function literal at line 58, a function literal at line 325, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhutilSearchQueryCompiler.tokenizeQuery (cyclomatic 62) · ×1
  • PhutilSearchQueryCompiler.tokenizeQuery (cyclomatic 62) src/applications/search/compiler/PhutilSearchQueryCompiler.php:104 — PhutilSearchQueryCompiler.tokenizeQuery has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarbormasterBuildLogRenderController.handleRequest (cyclomatic 60) · ×1
  • HarbormasterBuildLogRenderController.handleRequest (cyclomatic 60) src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:10 — HarbormasterBuildLogRenderController.handleRequest has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-document-engine.JX.behavior("document-engine") (cyclomatic 59) · ×1
  • behavior-document-engine.JX.behavior("document-engine") (cyclomatic 59) webroot/rsrc/js/application/files/behavior-document-engine.js:8 — behavior-document-engine.JX.behavior("document-engine") has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 6 of the 59 points are its own statements and the rest belongs to 14 function items inside it that branch (blame, onview, getHSV, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 59) · ×1
  • (anonymous) (cyclomatic 59) webroot/rsrc/js/application/files/behavior-document-engine.js:8 — (anonymous) has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 6 of the 59 points are its own statements and the rest belongs to 18 function items inside it that branch (blame, onview, getHSV, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DifferentialRevisionViewController.handleRequest (cyclomatic 57) · ×1
  • DifferentialRevisionViewController.handleRequest (cyclomatic 57) src/applications/differential/controller/DifferentialRevisionViewController.php:43 — DifferentialRevisionViewController.handleRequest has cyclomatic complexity 57 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DifferentialChangesetHTMLRenderer.renderChangeTypeHeader (cyclomatic 57) · ×1
  • DifferentialChangesetHTMLRenderer.renderChangeTypeHeader (cyclomatic 57) src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:21 — DifferentialChangesetHTMLRenderer.renderChangeTypeHeader has cyclomatic complexity 57 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · behavior-fancy-datepicker.JX.behavior("fancy-datepicker") (cyclomatic 57) · ×1
  • behavior-fancy-datepicker.JX.behavior("fancy-datepicker") (cyclomatic 57) webroot/rsrc/js/core/behavior-fancy-datepicker.js:10 — behavior-fancy-datepicker.JX.behavior("fancy-datepicker") has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 2 of the 57 points are its own statements and the rest belongs to 14 function items inside it that branch (write_date, getValidDate, render_day, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 57) · ×1
  • (anonymous) (cyclomatic 57) webroot/rsrc/js/core/behavior-fancy-datepicker.js:10 — (anonymous) has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 2 of the 57 points are its own statements and the rest belongs to 18 function items inside it that branch (write_date, getValidDate, render_day, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhabricatorRepository.generateURI (cyclomatic 56) · ×1
  • PhabricatorRepository.generateURI (cyclomatic 56) src/applications/repository/storage/PhabricatorRepository.php:681 — PhabricatorRepository.generateURI has cyclomatic complexity 56 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhabricatorRepositorySvnCommitChangeParserWorker.parseCommitChanges (cyclomatic 54) · ×1
  • PhabricatorRepositorySvnCommitChangeParserWorker.parseCommitChanges (cyclomatic 54) src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php:6 — PhabricatorRepositorySvnCommitChangeParserWorker.parseCommitChanges has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialChangesetTwoUpRenderer.renderTextChange (cyclomatic 53) · ×1
  • DifferentialChangesetTwoUpRenderer.renderTextChange (cyclomatic 53) src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:31 — DifferentialChangesetTwoUpRenderer.renderTextChange has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCalendarImportEngine.importEventDocument (cyclomatic 51) · ×1
  • PhabricatorCalendarImportEngine.importEventDocument (cyclomatic 51) src/applications/calendar/import/PhabricatorCalendarImportEngine.php:55 — PhabricatorCalendarImportEngine.importEventDocument 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.
D1 · Cyclomatic Complexity · PhabricatorApplicationSearchController.processSearchRequest (cyclomatic 51) · ×1
  • PhabricatorApplicationSearchController.processSearchRequest (cyclomatic 51) src/applications/search/controller/PhabricatorApplicationSearchController.php:95 — PhabricatorApplicationSearchController.processSearchRequest 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.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransactionEditor.applyTransactions (cyclomatic 50) · ×1
  • PhabricatorApplicationTransactionEditor.applyTransactions (cyclomatic 50) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1175 — PhabricatorApplicationTransactionEditor.applyTransactions 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.
D1 · Cyclomatic Complexity · PhabricatorRepositoryMercurialCommitChangeParserWorker.parseCommitChanges (cyclomatic 49) · ×1
  • PhabricatorRepositoryMercurialCommitChangeParserWorker.parseCommitChanges (cyclomatic 49) src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryMercurialCommitChangeParserWorker.php:6 — PhabricatorRepositoryMercurialCommitChangeParserWorker.parseCommitChanges has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorStorageManagementDumpWorkflow.didExecute (cyclomatic 49) · ×1
  • PhabricatorStorageManagementDumpWorkflow.didExecute (cyclomatic 49) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php:64 — PhabricatorStorageManagementDumpWorkflow.didExecute has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorStorageManagementWorkflow.doAdjustSchemata (cyclomatic 49) · ×1
  • PhabricatorStorageManagementWorkflow.doAdjustSchemata (cyclomatic 49) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:159 — PhabricatorStorageManagementWorkflow.doAdjustSchemata has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionCommitQuery.buildWhereClauseParts (cyclomatic 48) · ×1
  • DiffusionCommitQuery.buildWhereClauseParts (cyclomatic 48) src/applications/diffusion/query/DiffusionCommitQuery.php:536 — DiffusionCommitQuery.buildWhereClauseParts has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionCommitController.handleRequest (cyclomatic 47) · ×1
  • DiffusionCommitController.handleRequest (cyclomatic 47) src/applications/diffusion/controller/DiffusionCommitController.php:17 — DiffusionCommitController.handleRequest has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProfileMenuEngine.buildResponse (cyclomatic 47) · ×1
  • PhabricatorProfileMenuEngine.buildResponse (cyclomatic 47) src/applications/search/engine/PhabricatorProfileMenuEngine.php:102 — PhabricatorProfileMenuEngine.buildResponse has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIDiffInlineCommentDetailView.render (cyclomatic 46) · ×1
  • PHUIDiffInlineCommentDetailView.render (cyclomatic 46) src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php:78 — PHUIDiffInlineCommentDetailView.render has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIObjectItemView.getTagContent (cyclomatic 46) · ×1
  • PHUIObjectItemView.getTagContent (cyclomatic 46) src/view/phui/PHUIObjectItemView.php:383 — PHUIObjectItemView.getTagContent has cyclomatic complexity 46 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorStorageManagementWorkflow.doUpgradeSchemata (cyclomatic 45) · ×1
  • PhabricatorStorageManagementWorkflow.doUpgradeSchemata (cyclomatic 45) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:918 — PhabricatorStorageManagementWorkflow.doUpgradeSchemata has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldAdapter.doesConditionMatch (cyclomatic 43) · ×1
  • HeraldAdapter.doesConditionMatch (cyclomatic 43) src/applications/herald/adapter/HeraldAdapter.php:444 — HeraldAdapter.doesConditionMatch has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-oncopy.JX.behavior("phabricator-oncopy") (cyclomatic 43) · ×1
  • behavior-oncopy.JX.behavior("phabricator-oncopy") (cyclomatic 43) webroot/rsrc/js/core/behavior-oncopy.js:7 — behavior-oncopy.JX.behavior("phabricator-oncopy") has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 8 function items inside it that branch (onstartselect, extract_text, oncopy, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 43) · ×1
  • (anonymous) (cyclomatic 43) webroot/rsrc/js/core/behavior-oncopy.js:7 — (anonymous) has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 8 function items inside it that branch (onstartselect, extract_text, oncopy, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransaction.shouldHide (cyclomatic 42) · ×1
  • PhabricatorApplicationTransaction.shouldHide (cyclomatic 42) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:588 — PhabricatorApplicationTransaction.shouldHide has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorInlineCommentAdjustmentEngine.execute (cyclomatic 42) · ×1
  • PhabricatorInlineCommentAdjustmentEngine.execute (cyclomatic 42) src/infrastructure/diff/engine/PhabricatorInlineCommentAdjustmentEngine.php:60 — PhabricatorInlineCommentAdjustmentEngine.execute has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionServeController.serveRequest (cyclomatic 41) · ×1
  • DiffusionServeController.serveRequest (cyclomatic 41) src/applications/diffusion/controller/DiffusionServeController.php:176 — DiffusionServeController.serveRequest has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AphrontTableView.render (cyclomatic 41) · ×1
  • AphrontTableView.render (cyclomatic 41) src/view/control/AphrontTableView.php:131 — AphrontTableView.render has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-dark-console.JX.behavior("dark-console") (cyclomatic 41) · ×1
  • behavior-dark-console.JX.behavior("dark-console") (cyclomatic 41) webroot/rsrc/js/core/darkconsole/behavior-dark-console.js:13 — behavior-dark-console.JX.behavior("dark-console") has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 16 function items inside it that branch (render_request, leader_log, a function literal at line 382, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 41) · ×1
  • (anonymous) (cyclomatic 41) webroot/rsrc/js/core/darkconsole/behavior-dark-console.js:13 — (anonymous) has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 25 function items inside it that branch (render_request, leader_log, a function literal at line 382, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DiffusionURIEditor.validateTransaction (cyclomatic 40) · ×1
  • DiffusionURIEditor.validateTransaction (cyclomatic 40) src/applications/diffusion/editor/DiffusionURIEditor.php:156 — DiffusionURIEditor.validateTransaction has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorManiphestTaskFactEngine.newDatapointsForObject (cyclomatic 39) · ×1
  • PhabricatorManiphestTaskFactEngine.newDatapointsForObject (cyclomatic 39) src/applications/fact/engine/PhabricatorManiphestTaskFactEngine.php:86 — PhabricatorManiphestTaskFactEngine.newDatapointsForObject has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryManagementReparseWorkflow.execute (cyclomatic 39) · ×1
  • PhabricatorRepositoryManagementReparseWorkflow.execute (cyclomatic 39) src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php:81 — PhabricatorRepositoryManagementReparseWorkflow.execute has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorEditEngine.buildEditResponse (cyclomatic 39) · ×1
  • PhabricatorEditEngine.buildEditResponse (cyclomatic 39) src/applications/transactions/editengine/PhabricatorEditEngine.php:1033 — PhabricatorEditEngine.buildEditResponse has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorWorkerManagementWorkflow.loadTasks (cyclomatic 39) · ×1
  • PhabricatorWorkerManagementWorkflow.loadTasks (cyclomatic 39) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php:69 — PhabricatorWorkerManagementWorkflow.loadTasks has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DifferentialChangesetViewController.handleRequest (cyclomatic 38) · ×1
  • DifferentialChangesetViewController.handleRequest (cyclomatic 38) src/applications/differential/controller/DifferentialChangesetViewController.php:9 — DifferentialChangesetViewController.handleRequest has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DiffusionRepositoryBasicsManagementPanel.buildRepositoryStatus (cyclomatic 38) · ×1
  • DiffusionRepositoryBasicsManagementPanel.buildRepositoryStatus (cyclomatic 38) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:336 — DiffusionRepositoryBasicsManagementPanel.buildRepositoryStatus has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorFilesManagementIntegrityWorkflow.execute (cyclomatic 38) · ×1
  • PhabricatorFilesManagementIntegrityWorkflow.execute (cyclomatic 38) src/applications/files/management/PhabricatorFilesManagementIntegrityWorkflow.php:53 — PhabricatorFilesManagementIntegrityWorkflow.execute has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorSearchManagementIndexWorkflow.execute (cyclomatic 38) · ×1
  • PhabricatorSearchManagementIndexWorkflow.execute (cyclomatic 38) src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:74 — PhabricatorSearchManagementIndexWorkflow.execute has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-menu.JX.behavior("conpherence-menu") (cyclomatic 38) · ×1
  • behavior-menu.JX.behavior("conpherence-menu") (cyclomatic 38) REDACTED:17 — behavior-menu.JX.behavior("conpherence-menu") has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 15 function items inside it that branch (onDeviceChange, redrawThread, updatePageData, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 38) · ×1
  • (anonymous) (cyclomatic 38) REDACTED:17 — (anonymous) has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 30 function items inside it that branch (onDeviceChange, redrawThread, updatePageData, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhabricatorController.willBeginExecution (cyclomatic 37) · ×1
  • PhabricatorController.willBeginExecution (cyclomatic 37) src/applications/base/controller/PhabricatorController.php:64 — PhabricatorController.willBeginExecution has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · qsprintf.qsprintf_check_scalar_type (cyclomatic 37) · ×1
  • qsprintf.qsprintf_check_scalar_type (cyclomatic 37) src/infrastructure/storage/xsprintf/qsprintf.php:398 — qsprintf.qsprintf_check_scalar_type has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhabricatorStorageManagementWorkflow.findAdjustments (cyclomatic 36) · ×1
  • PhabricatorStorageManagementWorkflow.findAdjustments (cyclomatic 36) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:534 — PhabricatorStorageManagementWorkflow.findAdjustments has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilCalendarRecurrenceRule.newDaysSet (cyclomatic 35) · ×1
  • PhutilCalendarRecurrenceRule.newDaysSet (cyclomatic 35) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:1178 — PhutilCalendarRecurrenceRule.newDaysSet has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorEditEngineConfigurationQuery.loadPage (cyclomatic 35) · ×1
  • PhabricatorEditEngineConfigurationQuery.loadPage (cyclomatic 35) src/applications/transactions/query/PhabricatorEditEngineConfigurationQuery.php:71 — PhabricatorEditEngineConfigurationQuery.loadPage has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorConduitAPIController.authenticateUser (cyclomatic 34) · ×1
  • PhabricatorConduitAPIController.authenticateUser (cyclomatic 34) src/applications/conduit/controller/PhabricatorConduitAPIController.php:167 — PhabricatorConduitAPIController.authenticateUser has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialChangesetOneUpRenderer.renderDocumentEngineBlocks (cyclomatic 34) · ×1
  • DifferentialChangesetOneUpRenderer.renderDocumentEngineBlocks (cyclomatic 34) src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:270 — DifferentialChangesetOneUpRenderer.renderDocumentEngineBlocks has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-aphlict-dropdown.JX.behavior("aphlict-dropdown") (cyclomatic 34) · ×1
  • behavior-aphlict-dropdown.JX.behavior("aphlict-dropdown") (cyclomatic 34) webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js:14 — behavior-aphlict-dropdown.JX.behavior("aphlict-dropdown") has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 178, update_counts, set_visible, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 34) · ×1
  • (anonymous) (cyclomatic 34) webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js:14 — (anonymous) has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 178, update_counts, set_visible, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ConpherenceThreadSearchEngine.loadContextMessages (cyclomatic 33) · ×1
  • ConpherenceThreadSearchEngine.loadContextMessages (cyclomatic 33) src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:233 — ConpherenceThreadSearchEngine.loadContextMessages has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorFactObjectController.handleRequest (cyclomatic 33) · ×1
  • PhabricatorFactObjectController.handleRequest (cyclomatic 33) src/applications/fact/controller/PhabricatorFactObjectController.php:6 — PhabricatorFactObjectController.handleRequest has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorInlineCommentController.processRequest (cyclomatic 33) · ×1
  • PhabricatorInlineCommentController.processRequest (cyclomatic 33) src/infrastructure/diff/PhabricatorInlineCommentController.php:93 — PhabricatorInlineCommentController.processRequest has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConpherenceUpdateController.handleRequest (cyclomatic 32) · ×1
  • ConpherenceUpdateController.handleRequest (cyclomatic 32) src/applications/conpherence/controller/ConpherenceUpdateController.php:6 — ConpherenceUpdateController.handleRequest has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhortunePaymentMethodCreateController.handleRequest (cyclomatic 32) · ×1
  • PhortunePaymentMethodCreateController.handleRequest (cyclomatic 32) src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodCreateController.php:6 — PhortunePaymentMethodCreateController.handleRequest has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectBoardViewController.handleRequest (cyclomatic 32) · ×1
  • PhabricatorProjectBoardViewController.handleRequest (cyclomatic 32) src/applications/project/controller/PhabricatorProjectBoardViewController.php:10 — PhabricatorProjectBoardViewController.handleRequest has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectColumnBulkMoveController.handleRequest (cyclomatic 32) · ×1
  • PhabricatorProjectColumnBulkMoveController.handleRequest (cyclomatic 32) src/applications/project/controller/PhabricatorProjectColumnBulkMoveController.php:6 — PhabricatorProjectColumnBulkMoveController.handleRequest has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryManagementThawWorkflow.execute (cyclomatic 32) · ×1
  • PhabricatorRepositoryManagementThawWorkflow.execute (cyclomatic 32) src/applications/repository/management/PhabricatorRepositoryManagementThawWorkflow.php:49 — PhabricatorRepositoryManagementThawWorkflow.execute has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorEditEngine.buildResponse (cyclomatic 32) · ×1
  • PhabricatorEditEngine.buildResponse (cyclomatic 32) src/applications/transactions/editengine/PhabricatorEditEngine.php:882 — PhabricatorEditEngine.buildResponse has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorEditEngine.buildCommentResponse (cyclomatic 32) · ×1
  • PhabricatorEditEngine.buildCommentResponse (cyclomatic 32) src/applications/transactions/editengine/PhabricatorEditEngine.php:1875 — PhabricatorEditEngine.buildCommentResponse has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthManagementStripWorkflow.execute (cyclomatic 31) · ×1
  • PhabricatorAuthManagementStripWorkflow.execute (cyclomatic 31) src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:54 — PhabricatorAuthManagementStripWorkflow.execute has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialRevision.newReviewerForceAcceptMap (cyclomatic 31) · ×1
  • DifferentialRevision.newReviewerForceAcceptMap (cyclomatic 31) src/applications/differential/storage/DifferentialRevision.php:253 — DifferentialRevision.newReviewerForceAcceptMap has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryQuery.willFilterPage (cyclomatic 31) · ×1
  • PhabricatorRepositoryQuery.willFilterPage (cyclomatic 31) src/applications/repository/query/PhabricatorRepositoryQuery.php:236 — PhabricatorRepositoryQuery.willFilterPage has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAphlictManagementWorkflow.parseLaunchArguments (cyclomatic 30) · ×1
  • PhabricatorAphlictManagementWorkflow.parseLaunchArguments (cyclomatic 30) src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:27 — PhabricatorAphlictManagementWorkflow.parseLaunchArguments has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthSessionEngine.newHighSecurityToken (cyclomatic 30) · ×1
  • PhabricatorAuthSessionEngine.newHighSecurityToken (cyclomatic 30) src/applications/auth/engine/PhabricatorAuthSessionEngine.php:446 — PhabricatorAuthSessionEngine.newHighSecurityToken has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialChangesetEngine.detectCopiedCode (cyclomatic 30) · ×1
  • DifferentialChangesetEngine.detectCopiedCode (cyclomatic 30) src/applications/differential/engine/DifferentialChangesetEngine.php:162 — DifferentialChangesetEngine.detectCopiedCode has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionCommitHookEngine.findMercurialChangegroupRefUpdates (cyclomatic 30) · ×1
  • DiffusionCommitHookEngine.findMercurialChangegroupRefUpdates (cyclomatic 30) src/applications/diffusion/engine/DiffusionCommitHookEngine.php:743 — DiffusionCommitHookEngine.findMercurialChangegroupRefUpdates has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldAdapter.willSaveCondition (cyclomatic 30) · ×1
  • HeraldAdapter.willSaveCondition (cyclomatic 30) src/applications/herald/adapter/HeraldAdapter.php:613 — HeraldAdapter.willSaveCondition has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LegalpadDocumentSignController.handleRequest (cyclomatic 30) · ×1
  • LegalpadDocumentSignController.handleRequest (cyclomatic 30) src/applications/legalpad/controller/LegalpadDocumentSignController.php:24 — LegalpadDocumentSignController.handleRequest has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManiphestReportController.renderBurn (cyclomatic 30) · ×1
  • ManiphestReportController.renderBurn (cyclomatic 30) src/applications/maniphest/controller/ManiphestReportController.php:74 — ManiphestReportController.renderBurn has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManiphestReportController.renderOpenTasks (cyclomatic 30) · ×1
  • ManiphestReportController.renderOpenTasks (cyclomatic 30) src/applications/maniphest/controller/ManiphestReportController.php:487 — ManiphestReportController.renderOpenTasks has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManiphestTransactionEditor.buildMoveTransaction (cyclomatic 30) · ×1
  • ManiphestTransactionEditor.buildMoveTransaction (cyclomatic 30) src/applications/maniphest/editor/ManiphestTransactionEditor.php:438 — ManiphestTransactionEditor.buildMoveTransaction has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationQuery.loadPage (cyclomatic 30) · ×1
  • PhabricatorApplicationQuery.loadPage (cyclomatic 30) src/applications/meta/query/PhabricatorApplicationQuery.php:71 — PhabricatorApplicationQuery.loadPage has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhortunePayPalPaymentProvider.processControllerRequest (cyclomatic 30) · ×1
  • PhortunePayPalPaymentProvider.processControllerRequest (cyclomatic 30) src/applications/phortune/provider/PhortunePayPalPaymentProvider.php:287 — PhortunePayPalPaymentProvider.processControllerRequest has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildFerretWhereClause (cyclomatic 30) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildFerretWhereClause (cyclomatic 30) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2208 — PhabricatorCursorPagedPolicyAwareQuery.buildFerretWhereClause has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIHeaderView.getTagContent (cyclomatic 30) · ×1
  • PHUIHeaderView.getTagContent (cyclomatic 30) src/view/phui/PHUIHeaderView.php:190 — PHUIHeaderView.getTagContent has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _update (cyclomatic 30) · ×1
  • _update (cyclomatic 30) webroot/rsrc/js/phuix/PHUIXAutocomplete.js:428 — _update has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCalendarEventQuery.willFilterPage (cyclomatic 29) · ×1
  • PhabricatorCalendarEventQuery.willFilterPage (cyclomatic 29) src/applications/calendar/query/PhabricatorCalendarEventQuery.php:515 — PhabricatorCalendarEventQuery.willFilterPage has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionBrowseQueryConduitAPIMethod.getGitResult (cyclomatic 29) · ×1
  • DiffusionBrowseQueryConduitAPIMethod.getGitResult (cyclomatic 29) src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:35 — DiffusionBrowseQueryConduitAPIMethod.getGitResult has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PassphraseCredentialEditController.handleRequest (cyclomatic 29) · ×1
  • PassphraseCredentialEditController.handleRequest (cyclomatic 29) src/applications/passphrase/controller/PassphraseCredentialEditController.php:5 — PassphraseCredentialEditController.handleRequest has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectQuery.buildWhereClauseParts (cyclomatic 29) · ×1
  • PhabricatorProjectQuery.buildWhereClauseParts (cyclomatic 29) src/applications/project/query/PhabricatorProjectQuery.php:457 — PhabricatorProjectQuery.buildWhereClauseParts 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.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransactionView.renderEvent (cyclomatic 29) · ×1
  • PhabricatorApplicationTransactionView.renderEvent (cyclomatic 29) src/applications/transactions/view/PhabricatorApplicationTransactionView.php:422 — PhabricatorApplicationTransactionView.renderEvent has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorTypeaheadModularDatasourceController.handleRequest (cyclomatic 29) · ×1
  • PhabricatorTypeaheadModularDatasourceController.handleRequest (cyclomatic 29) src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php:10 — PhabricatorTypeaheadModularDatasourceController.handleRequest has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-phabricator-remarkup-assist.JX.behavior("phabricator-remarkup-assist") · ×1
  • behavior-phabricator-remarkup-assist.JX.behavior("phabricator-remarkup-assist")::assist (cyclomatic 29) webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188 — behavior-phabricator-remarkup-assist.JX.behavior("phabricator-remarkup-assist")::assist has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilSpriteSheet.generate (cyclomatic 28) · ×1
  • PhutilSpriteSheet.generate (cyclomatic 28) src/aphront/sprite/PhutilSpriteSheet.php:57 — PhutilSpriteSheet.generate has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCalendarNotificationEngine.sendNotifications (cyclomatic 28) · ×1
  • PhabricatorCalendarNotificationEngine.sendNotifications (cyclomatic 28) src/applications/calendar/notifications/PhabricatorCalendarNotificationEngine.php:73 — PhabricatorCalendarNotificationEngine.sendNotifications has cyclomatic complexity 28 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · DivinerAtomController.handleRequest (cyclomatic 28) · ×1
  • DivinerAtomController.handleRequest (cyclomatic 28) src/applications/diviner/controller/DivinerAtomController.php:9 — DivinerAtomController.handleRequest has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DoorkeeperAsanaFeedWorker.publishFeedStory (cyclomatic 28) · ×1
  • DoorkeeperAsanaFeedWorker.publishFeedStory (cyclomatic 28) src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php:27 — DoorkeeperAsanaFeedWorker.publishFeedStory has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMailManagementShowOutboundWorkflow.execute (cyclomatic 28) · ×1
  • PhabricatorMailManagementShowOutboundWorkflow.execute (cyclomatic 28) src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php:29 — PhabricatorMailManagementShowOutboundWorkflow.execute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMetaMTAMail.loadActors (cyclomatic 28) · ×1
  • PhabricatorMetaMTAMail.loadActors (cyclomatic 28) src/applications/metamta/storage/PhabricatorMetaMTAMail.php:895 — PhabricatorMetaMTAMail.loadActors has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPeopleNewController.handleRequest (cyclomatic 28) · ×1
  • PhabricatorPeopleNewController.handleRequest (cyclomatic 28) src/applications/people/controller/PhabricatorPeopleNewController.php:6 — PhabricatorPeopleNewController.handleRequest has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhrictionDocumentController.handleRequest (cyclomatic 28) · ×1
  • PhrictionDocumentController.handleRequest (cyclomatic 28) src/applications/phriction/controller/PhrictionDocumentController.php:13 — PhrictionDocumentController.handleRequest has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorBoardLayoutEngine.layoutBoard (cyclomatic 28) · ×1
  • PhabricatorBoardLayoutEngine.layoutBoard (cyclomatic 28) src/applications/project/engine/PhabricatorBoardLayoutEngine.php:422 — PhabricatorBoardLayoutEngine.layoutBoard has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilRemarkupListBlockRule.renderTree (cyclomatic 28) · ×1
  • PhutilRemarkupListBlockRule.renderTree (cyclomatic 28) src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php:428 — PhutilRemarkupListBlockRule.renderTree has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPolicyAwareQuery.execute (cyclomatic 28) · ×1
  • PhabricatorPolicyAwareQuery.execute (cyclomatic 28) src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:204 — PhabricatorPolicyAwareQuery.execute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorSQLPatchList.buildAllPatches (cyclomatic 28) · ×1
  • PhabricatorSQLPatchList.buildAllPatches (cyclomatic 28) src/infrastructure/storage/patch/PhabricatorSQLPatchList.php:49 — PhabricatorSQLPatchList.buildAllPatches has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUITimelineEventView.render (cyclomatic 28) · ×1
  • PHUITimelineEventView.render (cyclomatic 28) src/view/phui/PHUITimelineEventView.php:318 — PHUITimelineEventView.render has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-lightbox-attachments.JX.behavior("lightbox-attachments") (cyclomatic 28) · ×1
  • behavior-lightbox-attachments.JX.behavior("lightbox-attachments") (cyclomatic 28) webroot/rsrc/js/core/behavior-lightbox-attachments.js:12 — behavior-lightbox-attachments.JX.behavior("lightbox-attachments") has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 6 function items inside it that branch (activateLightbox, lightBoxHandleKeyDown, loadLightBox, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 28) · ×1
  • (anonymous) (cyclomatic 28) webroot/rsrc/js/core/behavior-lightbox-attachments.js:12 — (anonymous) has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 13 function items inside it that branch (activateLightbox, lightBoxHandleKeyDown, loadLightBox, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhabricatorAuditManagementDeleteWorkflow.execute (cyclomatic 27) · ×1
  • PhabricatorAuditManagementDeleteWorkflow.execute (cyclomatic 27) src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:62 — PhabricatorAuditManagementDeleteWorkflow.execute has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuditTransaction.getTitle (cyclomatic 27) · ×1
  • PhabricatorAuditTransaction.getTitle (cyclomatic 27) src/applications/audit/storage/PhabricatorAuditTransaction.php:162 — PhabricatorAuditTransaction.getTitle has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthStartController.handleRequest (cyclomatic 27) · ×1
  • PhabricatorAuthStartController.handleRequest (cyclomatic 27) src/applications/auth/controller/PhabricatorAuthStartController.php:10 — PhabricatorAuthStartController.handleRequest has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthEditController.handleRequest (cyclomatic 27) · ×1
  • PhabricatorAuthEditController.handleRequest (cyclomatic 27) src/applications/auth/controller/config/PhabricatorAuthEditController.php:6 — PhabricatorAuthEditController.handleRequest has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorWebServerSetupCheck.executeChecks (cyclomatic 27) · ×1
  • PhabricatorWebServerSetupCheck.executeChecks (cyclomatic 27) REDACTED:9 — PhabricatorWebServerSetupCheck.executeChecks has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DifferentialChangesetOneUpRenderer.renderPrimitives (cyclomatic 27) · ×1
  • DifferentialChangesetOneUpRenderer.renderPrimitives (cyclomatic 27) src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:47 — DifferentialChangesetOneUpRenderer.renderPrimitives has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarbormasterBuildEngine.updateBuildSteps (cyclomatic 27) · ×1
  • HarbormasterBuildEngine.updateBuildSteps (cyclomatic 27) src/applications/harbormaster/engine/HarbormasterBuildEngine.php:165 — HarbormasterBuildEngine.updateBuildSteps has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilXHPASTSyntaxHighlighterFuture.applyXHPHighlight (cyclomatic 27) · ×1
  • PhutilXHPASTSyntaxHighlighterFuture.applyXHPHighlight (cyclomatic 27) src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:31 — PhutilXHPASTSyntaxHighlighterFuture.applyXHPHighlight has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-day-view.JX.behavior("day-view") (cyclomatic 27) · ×1
  • behavior-day-view.JX.behavior("day-view") (cyclomatic 27) webroot/rsrc/js/application/calendar/behavior-day-view.js:5 — behavior-day-view.JX.behavior("day-view") has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (findTodayClusters, updateEventsFromCluster, drawRows, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · behavior-comment-actions.JX.behavior("comment-actions") (cyclomatic 27) · ×1
  • behavior-comment-actions.JX.behavior("comment-actions") (cyclomatic 27) webroot/rsrc/js/application/transactions/behavior-comment-actions.js:12 — behavior-comment-actions.JX.behavior("comment-actions") has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 11 function items inside it that branch (add_row, find_option, redraw, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhabricatorCalendarEventQuery.loadPage (cyclomatic 26) · ×1
  • PhabricatorCalendarEventQuery.loadPage (cyclomatic 26) src/applications/calendar/query/PhabricatorCalendarEventQuery.php:161 — PhabricatorCalendarEventQuery.loadPage has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialHunkParser.parseHunksForHighlightMasks (cyclomatic 26) · ×1
  • DifferentialHunkParser.parseHunksForHighlightMasks (cyclomatic 26) src/applications/differential/parser/DifferentialHunkParser.php:566 — DifferentialHunkParser.parseHunksForHighlightMasks has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialReviewersView.render (cyclomatic 26) · ×1
  • DifferentialReviewersView.render (cyclomatic 26) src/applications/differential/view/DifferentialReviewersView.php:26 — DifferentialReviewersView.render has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionCommitController.buildPropertyListView (cyclomatic 26) · ×1
  • DiffusionCommitController.buildPropertyListView (cyclomatic 26) src/applications/diffusion/controller/DiffusionCommitController.php:524 — DiffusionCommitController.buildPropertyListView has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MultimeterSampleController.handleRequest (cyclomatic 26) · ×1
  • MultimeterSampleController.handleRequest (cyclomatic 26) src/applications/multimeter/controller/MultimeterSampleController.php:9 — MultimeterSampleController.handleRequest has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorObjectListQuery.execute (cyclomatic 26) · ×1
  • PhabricatorObjectListQuery.execute (cyclomatic 26) src/applications/phid/query/PhabricatorObjectListQuery.php:56 — PhabricatorObjectListQuery.execute has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransactionEditor.getTransactionOldValue (cyclomatic 26) · ×1
  • PhabricatorApplicationTransactionEditor.getTransactionOldValue (cyclomatic 26) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:490 — PhabricatorApplicationTransactionEditor.getTransactionOldValue has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorDifferenceEngine.applyIntralineDiff (cyclomatic 26) · ×1
  • PhabricatorDifferenceEngine.applyIntralineDiff (cyclomatic 26) src/infrastructure/diff/PhabricatorDifferenceEngine.php:172 — PhabricatorDifferenceEngine.applyIntralineDiff has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIDiffTableOfContentsListView.render (cyclomatic 26) · ×1
  • PHUIDiffTableOfContentsListView.render (cyclomatic 26) src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php:53 — PHUIDiffTableOfContentsListView.render has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildSpacesWhereClause (cyclomatic 26) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildSpacesWhereClause (cyclomatic 26) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:3139 — PhabricatorCursorPagedPolicyAwareQuery.buildSpacesWhereClause has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · start (cyclomatic 26) · ×1
  • start (cyclomatic 26) webroot/rsrc/js/core/DragAndDropFileUpload.js:75 — start has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 185, a function literal at line 105, contains, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · updateCard (cyclomatic 26) · ×1
  • updateCard (cyclomatic 26) webroot/rsrc/js/application/projects/WorkboardBoard.js:601 — updateCard has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthManagementRevokeWorkflow.execute (cyclomatic 25) · ×1
  • PhabricatorAuthManagementRevokeWorkflow.execute (cyclomatic 25) src/applications/auth/management/PhabricatorAuthManagementRevokeWorkflow.php:50 — PhabricatorAuthManagementRevokeWorkflow.execute has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilCalendarRecurrenceSet.getEventsBetween (cyclomatic 25) · ×1
  • PhutilCalendarRecurrenceSet.getEventsBetween (cyclomatic 25) src/applications/calendar/parser/data/PhutilCalendarRecurrenceSet.php:23 — PhutilCalendarRecurrenceSet.getEventsBetween has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialHunkParser.makeContextDiff (cyclomatic 25) · ×1
  • DifferentialHunkParser.makeContextDiff (cyclomatic 25) src/applications/differential/parser/DifferentialHunkParser.php:665 — DifferentialHunkParser.makeContextDiff has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DivinerAtomQuery.willFilterPage (cyclomatic 25) · ×1
  • DivinerAtomQuery.willFilterPage (cyclomatic 25) src/applications/diviner/query/DivinerAtomQuery.php:139 — DivinerAtomQuery.willFilterPage has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorFeedStory.loadAllFromRows (cyclomatic 25) · ×1
  • PhabricatorFeedStory.loadAllFromRows (cyclomatic 25) src/applications/feed/story/PhabricatorFeedStory.php:41 — PhabricatorFeedStory.loadAllFromRows has cyclomatic complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · ManiphestTaskSearchEngine.buildQueryFromParameters (cyclomatic 25) · ×1
  • ManiphestTaskSearchEngine.buildQueryFromParameters (cyclomatic 25) src/applications/maniphest/query/ManiphestTaskSearchEngine.php:190 — ManiphestTaskSearchEngine.buildQueryFromParameters has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PholioMockEditController.handleRequest (cyclomatic 25) · ×1
  • PholioMockEditController.handleRequest (cyclomatic 25) src/applications/pholio/controller/PholioMockEditController.php:5 — PholioMockEditController.handleRequest has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhrequentTimeBlock.getObjectTimeRanges (cyclomatic 25) · ×1
  • PhrequentTimeBlock.getObjectTimeRanges (cyclomatic 25) src/applications/phrequent/storage/PhrequentTimeBlock.php:22 — PhrequentTimeBlock.getObjectTimeRanges has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhrictionRemarkupRule.didMarkupText (cyclomatic 25) · ×1
  • PhrictionRemarkupRule.didMarkupText (cyclomatic 25) src/applications/phriction/markup/PhrictionRemarkupRule.php:86 — PhrictionRemarkupRule.didMarkupText has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPolicyEditController.handleRequest (cyclomatic 25) · ×1
  • PhabricatorPolicyEditController.handleRequest (cyclomatic 25) src/applications/policy/controller/PhabricatorPolicyEditController.php:6 — PhabricatorPolicyEditController.handleRequest has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPolicyFilter.apply (cyclomatic 25) · ×1
  • PhabricatorPolicyFilter.apply (cyclomatic 25) src/applications/policy/filter/PhabricatorPolicyFilter.php:156 — PhabricatorPolicyFilter.apply has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryQuery.buildWhereClauseParts (cyclomatic 25) · ×1
  • PhabricatorRepositoryQuery.buildWhereClauseParts (cyclomatic 25) src/applications/repository/query/PhabricatorRepositoryQuery.php:533 — PhabricatorRepositoryQuery.buildWhereClauseParts has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorFerretFulltextEngineExtension.indexFulltextObject (cyclomatic 25) · ×1
  • PhabricatorFerretFulltextEngineExtension.indexFulltextObject (cyclomatic 25) src/applications/search/engineextension/PhabricatorFerretFulltextEngineExtension.php:19 — PhabricatorFerretFulltextEngineExtension.indexFulltextObject has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIDiffGraphView.renderRawGraph (cyclomatic 25) · ×1
  • PHUIDiffGraphView.renderRawGraph (cyclomatic 25) src/infrastructure/diff/view/PHUIDiffGraphView.php:36 — PHUIDiffGraphView.renderRawGraph has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildFerretJoinClause (cyclomatic 25) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildFerretJoinClause (cyclomatic 25) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1995 — PhabricatorCursorPagedPolicyAwareQuery.buildFerretJoinClause has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorActionView.render (cyclomatic 25) · ×1
  • PhabricatorActionView.render (cyclomatic 25) src/view/layout/PhabricatorActionView.php:198 — PhabricatorActionView.render has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · behavior-search-typeahead.JX.behavior("phabricator-search-typeahead") (cyclomatic 25) · ×1
  • behavior-search-typeahead.JX.behavior("phabricator-search-typeahead") (cyclomatic 25) webroot/rsrc/js/core/behavior-search-typeahead.js:14 — behavior-search-typeahead.JX.behavior("phabricator-search-typeahead") has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 6 function items inside it that branch (sort_handler, a function literal at line 217, transform, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 25) · ×1
  • (anonymous) (cyclomatic 25) webroot/rsrc/js/core/behavior-search-typeahead.js:14 — (anonymous) has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 12 function items inside it that branch (sort_handler, a function literal at line 217, transform, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DifferentialQueryConduitAPIMethod.execute (cyclomatic 24) · ×1
  • DifferentialQueryConduitAPIMethod.execute (cyclomatic 24) src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php:65 — DifferentialQueryConduitAPIMethod.execute has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DiffusionBrowseQueryConduitAPIMethod.getSVNResult (cyclomatic 24) · ×1
  • DiffusionBrowseQueryConduitAPIMethod.getSVNResult (cyclomatic 24) src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:363 — DiffusionBrowseQueryConduitAPIMethod.getSVNResult has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionCommitQuery.didFilterPage (cyclomatic 24) · ×1
  • DiffusionCommitQuery.didFilterPage (cyclomatic 24) src/applications/diffusion/query/DiffusionCommitQuery.php:361 — DiffusionCommitQuery.didFilterPage has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarbormasterBuildViewController.handleRequest (cyclomatic 24) · ×1
  • HarbormasterBuildViewController.handleRequest (cyclomatic 24) src/applications/harbormaster/controller/HarbormasterBuildViewController.php:10 — HarbormasterBuildViewController.handleRequest has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldEngine.getRuleMatchResult (cyclomatic 24) · ×1
  • HeraldEngine.getRuleMatchResult (cyclomatic 24) src/applications/herald/engine/HeraldEngine.php:379 — HeraldEngine.getRuleMatchResult has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManiphestTaskQuery.buildWhereClauseParts (cyclomatic 24) · ×1
  • ManiphestTaskQuery.buildWhereClauseParts (cyclomatic 24) src/applications/maniphest/query/ManiphestTaskQuery.php:354 — ManiphestTaskQuery.buildWhereClauseParts has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorMetaMTAMailViewController.buildDeliveryProperties (cyclomatic 24) · ×1
  • PhabricatorMetaMTAMailViewController.buildDeliveryProperties (cyclomatic 24) src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php:216 — PhabricatorMetaMTAMailViewController.buildDeliveryProperties has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMailEmailEngine.newMessage (cyclomatic 24) · ×1
  • PhabricatorMailEmailEngine.newMessage (cyclomatic 24) src/applications/metamta/engine/PhabricatorMailEmailEngine.php:6 — PhabricatorMailEmailEngine.newMessage has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMetaMTAReceivedMail.processReceivedMail (cyclomatic 24) · ×1
  • PhabricatorMetaMTAReceivedMail.processReceivedMail (cyclomatic 24) src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php:146 — PhabricatorMetaMTAReceivedMail.processReceivedMail has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PassphraseQueryConduitAPIMethod.execute (cyclomatic 24) · ×1
  • PassphraseQueryConduitAPIMethod.execute (cyclomatic 24) src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php:31 — PassphraseQueryConduitAPIMethod.execute has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhrictionEditController.handleRequest (cyclomatic 24) · ×1
  • PhrictionEditController.handleRequest (cyclomatic 24) src/applications/phriction/controller/PhrictionEditController.php:6 — PhrictionEditController.handleRequest has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPolicyFilter.checkCapability (cyclomatic 24) · ×1
  • PhabricatorPolicyFilter.checkCapability (cyclomatic 24) src/applications/policy/filter/PhabricatorPolicyFilter.php:502 — PhabricatorPolicyFilter.checkCapability has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectQuery.willFilterPage (cyclomatic 24) · ×1
  • PhabricatorProjectQuery.willFilterPage (cyclomatic 24) src/applications/project/query/PhabricatorProjectQuery.php:239 — PhabricatorProjectQuery.willFilterPage has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectSearchEngine.buildQueryFromParameters (cyclomatic 24) · ×1
  • PhabricatorProjectSearchEngine.buildQueryFromParameters (cyclomatic 24) src/applications/project/query/PhabricatorProjectSearchEngine.php:130 — PhabricatorProjectSearchEngine.buildQueryFromParameters has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryPullLocalDaemon.run (cyclomatic 24) · ×1
  • PhabricatorRepositoryPullLocalDaemon.run (cyclomatic 24) src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:38 — PhabricatorRepositoryPullLocalDaemon.run has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorDatabaseRefParser.newRefs (cyclomatic 24) · ×1
  • PhabricatorDatabaseRefParser.newRefs (cyclomatic 24) src/infrastructure/cluster/PhabricatorDatabaseRefParser.php:37 — PhabricatorDatabaseRefParser.newRefs has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorStorageManagementRenamespaceWorkflow.didExecute (cyclomatic 24) · ×1
  • PhabricatorStorageManagementRenamespaceWorkflow.didExecute (cyclomatic 24) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php:57 — PhabricatorStorageManagementRenamespaceWorkflow.didExecute has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _onjumpkey (cyclomatic 24) · ×1
  • _onjumpkey (cyclomatic 24) webroot/rsrc/js/application/diff/DiffChangesetList.js:650 — _onjumpkey has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AphrontMultipartParser.continueParse (cyclomatic 23) · ×1
  • AphrontMultipartParser.continueParse (cyclomatic 23) src/aphront/multipartparser/AphrontMultipartParser.php:62 — AphrontMultipartParser.continueParse has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilICSParser.unescapeFieldValue (cyclomatic 23) · ×1
  • PhutilICSParser.unescapeFieldValue (cyclomatic 23) src/applications/calendar/parser/ics/PhutilICSParser.php:386 — PhutilICSParser.unescapeFieldValue has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DifferentialTransactionEditor.didApplyHeraldRules (cyclomatic 23) · ×1
  • DifferentialTransactionEditor.didApplyHeraldRules (cyclomatic 23) src/applications/differential/editor/DifferentialTransactionEditor.php:1034 — DifferentialTransactionEditor.didApplyHeraldRules has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialChangesetTwoUpRenderer.renderDocumentEngineBlocks (cyclomatic 23) · ×1
  • DifferentialChangesetTwoUpRenderer.renderDocumentEngineBlocks (cyclomatic 23) src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:368 — DifferentialChangesetTwoUpRenderer.renderDocumentEngineBlocks has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionLowLevelResolveRefsQuery.resolveGitRefs (cyclomatic 23) · ×1
  • DiffusionLowLevelResolveRefsQuery.resolveGitRefs (cyclomatic 23) src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php:60 — DiffusionLowLevelResolveRefsQuery.resolveGitRefs has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DivinerAtomController.renderFullSignature (cyclomatic 23) · ×1
  • DivinerAtomController.renderFullSignature (cyclomatic 23) src/applications/diviner/controller/DivinerAtomController.php:479 — DivinerAtomController.renderFullSignature has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhabricatorFileViewController.buildPropertyViews (cyclomatic 23) · ×1
  • PhabricatorFileViewController.buildPropertyViews (cyclomatic 23) src/applications/files/controller/PhabricatorFileViewController.php:218 — PhabricatorFileViewController.buildPropertyViews has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorEmbedFileRemarkupRule.renderImageFile (cyclomatic 23) · ×1
  • PhabricatorEmbedFileRemarkupRule.renderImageFile (cyclomatic 23) src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php:129 — PhabricatorEmbedFileRemarkupRule.renderImageFile has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldRuleQuery.willFilterPage (cyclomatic 23) · ×1
  • HeraldRuleQuery.willFilterPage (cyclomatic 23) src/applications/herald/query/HeraldRuleQuery.php:89 — HeraldRuleQuery.willFilterPage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManiphestTaskDetailController.newChangesView (cyclomatic 23) · ×1
  • ManiphestTaskDetailController.newChangesView (cyclomatic 23) src/applications/maniphest/controller/ManiphestTaskDetailController.php:545 — ManiphestTaskDetailController.newChangesView has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorOwnersPackage.findLongestPathsPerPackage (cyclomatic 23) · ×1
  • PhabricatorOwnersPackage.findLongestPathsPerPackage (cyclomatic 23) src/applications/owners/storage/PhabricatorOwnersPackage.php:378 — PhabricatorOwnersPackage.findLongestPathsPerPackage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPeopleProfilePictureController.handleRequest (cyclomatic 23) · ×1
  • PhabricatorPeopleProfilePictureController.handleRequest (cyclomatic 23) src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:6 — PhabricatorPeopleProfilePictureController.handleRequest has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectDatasource.loadResults (cyclomatic 23) · ×1
  • PhabricatorProjectDatasource.loadResults (cyclomatic 23) src/applications/project/typeahead/PhabricatorProjectDatasource.php:18 — PhabricatorProjectDatasource.loadResults has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryGitCommitChangeParserWorker.parseCommitChanges (cyclomatic 23) · ×1
  • PhabricatorRepositoryGitCommitChangeParserWorker.parseCommitChanges (cyclomatic 23) src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php:6 — PhabricatorRepositoryGitCommitChangeParserWorker.parseCommitChanges has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransactionSearchConduitAPIMethod.execute (cyclomatic 23) · ×1
  • TransactionSearchConduitAPIMethod.execute (cyclomatic 23) src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php:102 — TransactionSearchConduitAPIMethod.execute has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilRemarkupCodeBlockRule.markupText (cyclomatic 23) · ×1
  • PhutilRemarkupCodeBlockRule.markupText (cyclomatic 23) src/infrastructure/markup/blockrule/PhutilRemarkupCodeBlockRule.php:46 — PhutilRemarkupCodeBlockRule.markupText has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AphrontDialogView.render (cyclomatic 23) · ×1
  • AphrontDialogView.render (cyclomatic 23) src/view/AphrontDialogView.php:255 — AphrontDialogView.render has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · behavior-commit-graph.JX.behavior("diffusion-commit-graph") (cyclomatic 23) · ×1
  • behavior-commit-graph.JX.behavior("diffusion-commit-graph") (cyclomatic 23) webroot/rsrc/js/application/diffusion/behavior-commit-graph.js:8 — behavior-commit-graph.JX.behavior("diffusion-commit-graph") has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-line-linker.JX.behavior("phabricator-line-linker") (cyclomatic 23) · ×1
  • behavior-line-linker.JX.behavior("phabricator-line-linker") (cyclomatic 23) webroot/rsrc/js/core/behavior-line-linker.js:10 — behavior-line-linker.JX.behavior("phabricator-line-linker") has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (highlight, a function literal at line 39, a function literal at line 138, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · buildTokenizer (cyclomatic 23) · ×1
  • buildTokenizer (cyclomatic 23) webroot/rsrc/js/core/Prefab.js:73 — buildTokenizer has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 113). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PhabricatorAuditTransaction.getTitleForFeed (cyclomatic 22) · ×1
  • PhabricatorAuditTransaction.getTitleForFeed (cyclomatic 22) src/applications/audit/storage/PhabricatorAuditTransaction.php:297 — PhabricatorAuditTransaction.getTitleForFeed has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CelerityResourceController.serveResource (cyclomatic 22) · ×1
  • CelerityResourceController.serveResource (cyclomatic 22) src/applications/celerity/controller/CelerityResourceController.php:27 — CelerityResourceController.serveResource has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorConfigEditController.handleRequest (cyclomatic 22) · ×1
  • PhabricatorConfigEditController.handleRequest (cyclomatic 22) src/applications/config/controller/settings/PhabricatorConfigEditController.php:6 — PhabricatorConfigEditController.handleRequest has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DifferentialChangesetParser.replaceTabsWithSpaces (cyclomatic 22) · ×1
  • DifferentialChangesetParser.replaceTabsWithSpaces (cyclomatic 22) src/applications/differential/parser/DifferentialChangesetParser.php:1615 — DifferentialChangesetParser.replaceTabsWithSpaces has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialRevisionQuery.buildWhereClause (cyclomatic 22) · ×1
  • DifferentialRevisionQuery.buildWhereClause (cyclomatic 22) src/applications/differential/query/DifferentialRevisionQuery.php:630 — DifferentialRevisionQuery.buildWhereClause has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DifferentialTransaction.getTitleForFeed (cyclomatic 22) · ×1
  • DifferentialTransaction.getTitleForFeed (cyclomatic 22) src/applications/differential/storage/DifferentialTransaction.php:281 — DifferentialTransaction.getTitleForFeed has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialRevisionReviewersTransaction.renderReviewerEditTitle (cyclomatic 22) · ×1
  • DifferentialRevisionReviewersTransaction.renderReviewerEditTitle (cyclomatic 22) src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:165 — DifferentialRevisionReviewersTransaction.renderReviewerEditTitle has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DivinerAtomQuery.buildWhereClause (cyclomatic 22) · ×1
  • DivinerAtomQuery.buildWhereClause (cyclomatic 22) src/applications/diviner/query/DivinerAtomQuery.php:302 — DivinerAtomQuery.buildWhereClause has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManiphestConduitAPIMethod.applyRequest (cyclomatic 22) · ×1
  • ManiphestConduitAPIMethod.applyRequest (cyclomatic 22) src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php:53 — ManiphestConduitAPIMethod.applyRequest has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPeopleInviteSendController.handleRequest (cyclomatic 22) · ×1
  • PhabricatorPeopleInviteSendController.handleRequest (cyclomatic 22) src/applications/people/controller/PhabricatorPeopleInviteSendController.php:6 — PhabricatorPeopleInviteSendController.handleRequest has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepository.getAlmanacServiceRefs (cyclomatic 22) · ×1
  • PhabricatorRepository.getAlmanacServiceRefs (cyclomatic 22) src/applications/repository/storage/PhabricatorRepository.php:1858 — PhabricatorRepository.getAlmanacServiceRefs has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationSearchEngine.buildConduitResponse (cyclomatic 22) · ×1
  • PhabricatorApplicationSearchEngine.buildConduitResponse (cyclomatic 22) src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1144 — PhabricatorApplicationSearchEngine.buildConduitResponse has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorSlowvoteEditController.handleRequest (cyclomatic 22) · ×1
  • PhabricatorSlowvoteEditController.handleRequest (cyclomatic 22) src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php:6 — PhabricatorSlowvoteEditController.handleRequest has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransactionEditor.getTransactionNewValue (cyclomatic 22) · ×1
  • PhabricatorApplicationTransactionEditor.getTransactionNewValue (cyclomatic 22) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:588 — PhabricatorApplicationTransactionEditor.getTransactionNewValue has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransaction.getTitleForFeed (cyclomatic 22) · ×1
  • PhabricatorApplicationTransaction.getTitleForFeed (cyclomatic 22) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1335 — PhabricatorApplicationTransaction.getTitleForFeed has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilRemarkupListBlockRule.markupText (cyclomatic 22) · ×1
  • PhutilRemarkupListBlockRule.markupText (cyclomatic 22) src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php:88 — PhutilRemarkupListBlockRule.markupText has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-durable-column.JX.behavior("durable-column") (cyclomatic 22) · ×1
  • behavior-durable-column.JX.behavior("durable-column") (cyclomatic 22) webroot/rsrc/js/application/conpherence/behavior-durable-column.js:13 — behavior-durable-column.JX.behavior("durable-column") has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 172, a function literal at line 334, _minimizeColumn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 22) · ×1
  • (anonymous) (cyclomatic 22) webroot/rsrc/js/application/conpherence/behavior-durable-column.js:13 — (anonymous) has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 29 function items inside it that branch (a function literal at line 172, a function literal at line 334, _minimizeColumn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PhutilCalendarRecurrenceRule.newYearMap (cyclomatic 21) · ×1
  • PhutilCalendarRecurrenceRule.newYearMap (cyclomatic 21) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:1349 — PhutilCalendarRecurrenceRule.newYearMap has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorConfigClusterRepositoriesController.buildClusterRepositoryStatus (cyclomatic 21) · ×1
  • PhabricatorConfigClusterRepositoriesController.buildClusterRepositoryStatus (cyclomatic 21) src/applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php:46 — PhabricatorConfigClusterRepositoriesController.buildClusterRepositoryStatus has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorDashboardPanelTabsController.handleRequest (cyclomatic 21) · ×1
  • PhabricatorDashboardPanelTabsController.handleRequest (cyclomatic 21) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:17 — PhabricatorDashboardPanelTabsController.handleRequest has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorDashboardTabsPanelType.renderPanelContent (cyclomatic 21) · ×1
  • PhabricatorDashboardTabsPanelType.renderPanelContent (cyclomatic 21) src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php:46 — PhabricatorDashboardTabsPanelType.renderPanelContent has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialTransactionEditor.expandTransaction (cyclomatic 21) · ×1
  • DifferentialTransactionEditor.expandTransaction (cyclomatic 21) src/applications/differential/editor/DifferentialTransactionEditor.php:152 — DifferentialTransactionEditor.expandTransaction has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialTransactionEditor.updateReviewStatus (cyclomatic 21) · ×1
  • DifferentialTransactionEditor.updateReviewStatus (cyclomatic 21) src/applications/differential/editor/DifferentialTransactionEditor.php:403 — DifferentialTransactionEditor.updateReviewStatus has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionSymbolController.handleRequest (cyclomatic 21) · ×1
  • DiffusionSymbolController.handleRequest (cyclomatic 21) src/applications/diffusion/controller/DiffusionSymbolController.php:5 — DiffusionSymbolController.handleRequest has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DiffusionGitUploadPackWireProtocol.willReadBytes (cyclomatic 21) · ×1
  • DiffusionGitUploadPackWireProtocol.willReadBytes (cyclomatic 21) src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php:16 — DiffusionGitUploadPackWireProtocol.willReadBytes has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionMercurialWireClientSSHProtocolChannel.decodeStream (cyclomatic 21) · ×1
  • DiffusionMercurialWireClientSSHProtocolChannel.decodeStream (cyclomatic 21) src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php:79 — DiffusionMercurialWireClientSSHProtocolChannel.decodeStream has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorFileQuery.buildWhereClauseParts (cyclomatic 21) · ×1
  • PhabricatorFileQuery.buildWhereClauseParts (cyclomatic 21) src/applications/files/query/PhabricatorFileQuery.php:396 — PhabricatorFileQuery.buildWhereClauseParts has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HeraldAction.loadStandardTargets (cyclomatic 21) · ×1
  • HeraldAction.loadStandardTargets (cyclomatic 21) src/applications/herald/action/HeraldAction.php:206 — HeraldAction.loadStandardTargets has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMetaMTAMail.newMailers (cyclomatic 21) · ×1
  • PhabricatorMetaMTAMail.newMailers (cyclomatic 21) src/applications/metamta/storage/PhabricatorMetaMTAMail.php:558 — PhabricatorMetaMTAMail.newMailers has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMentionRemarkupRule.didMarkupText (cyclomatic 21) · ×1
  • PhabricatorMentionRemarkupRule.didMarkupText (cyclomatic 21) src/applications/people/markup/PhabricatorMentionRemarkupRule.php:57 — PhabricatorMentionRemarkupRule.didMarkupText has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhrictionDocumentQuery.buildWhereClauseParts (cyclomatic 21) · ×1
  • PhrictionDocumentQuery.buildWhereClauseParts (cyclomatic 21) src/applications/phriction/query/PhrictionDocumentQuery.php:199 — PhrictionDocumentQuery.buildWhereClauseParts has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryPullEngine.pullRepositoryWithLock (cyclomatic 21) · ×1
  • PhabricatorRepositoryPullEngine.pullRepositoryWithLock (cyclomatic 21) src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:51 — PhabricatorRepositoryPullEngine.pullRepositoryWithLock has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorSearchHovercardController.handleRequest (cyclomatic 21) · ×1
  • PhabricatorSearchHovercardController.handleRequest (cyclomatic 21) src/applications/search/controller/PhabricatorSearchHovercardController.php:10 — PhabricatorSearchHovercardController.handleRequest has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProfileMenuEngine.buildItemConfigureContent (cyclomatic 21) · ×1
  • PhabricatorProfileMenuEngine.buildItemConfigureContent (cyclomatic 21) src/applications/search/engine/PhabricatorProfileMenuEngine.php:683 — PhabricatorProfileMenuEngine.buildItemConfigureContent has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorSearchResultView.emboldenQuery (cyclomatic 21) · ×1
  • PhabricatorSearchResultView.emboldenQuery (cyclomatic 21) src/applications/search/view/PhabricatorSearchResultView.php:59 — PhabricatorSearchResultView.emboldenQuery has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorSubscriptionsHeraldAction.applySubscribe (cyclomatic 21) · ×1
  • PhabricatorSubscriptionsHeraldAction.applySubscribe (cyclomatic 21) src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php:19 — PhabricatorSubscriptionsHeraldAction.applySubscribe has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIDiffTableOfContentsListView.newComponentView (cyclomatic 21) · ×1
  • PHUIDiffTableOfContentsListView.newComponentView (cyclomatic 21) src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php:387 — PHUIDiffTableOfContentsListView.newComponentView has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildPagingClauseFromMultipleColumns (cyclomatic 21) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildPagingClauseFromMultipleColumns (cyclomatic 21) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:727 — PhabricatorCursorPagedPolicyAwareQuery.buildPagingClauseFromMultipleColumns has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorStandardPageView.willRenderPage (cyclomatic 21) · ×1
  • PhabricatorStandardPageView.willRenderPage (cyclomatic 21) src/view/page/PhabricatorStandardPageView.php:199 — PhabricatorStandardPageView.willRenderPage has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · redraw (cyclomatic 21) · ×1
  • redraw (cyclomatic 21) webroot/rsrc/js/application/diff/DiffTreeView.js:87 — redraw has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthOneTimeLoginController.handleRequest (cyclomatic 20) · ×1
  • PhabricatorAuthOneTimeLoginController.handleRequest (cyclomatic 20) src/applications/auth/controller/PhabricatorAuthOneTimeLoginController.php:10 — PhabricatorAuthOneTimeLoginController.handleRequest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorEmailLoginController.handleRequest (cyclomatic 20) · ×1
  • PhabricatorEmailLoginController.handleRequest (cyclomatic 20) src/applications/auth/controller/PhabricatorEmailLoginController.php:10 — PhabricatorEmailLoginController.handleRequest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthInviteAction.newActionListFromAddresses (cyclomatic 20) · ×1
  • PhabricatorAuthInviteAction.newActionListFromAddresses (cyclomatic 20) src/applications/auth/data/PhabricatorAuthInviteAction.php:94 — PhabricatorAuthInviteAction.newActionListFromAddresses has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthPasswordEngine.checkNewPassword (cyclomatic 20) · ×1
  • PhabricatorAuthPasswordEngine.checkNewPassword (cyclomatic 20) src/applications/auth/engine/PhabricatorAuthPasswordEngine.php:57 — PhabricatorAuthPasswordEngine.checkNewPassword has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCalendarEventCancelController.handleRequest (cyclomatic 20) · ×1
  • PhabricatorCalendarEventCancelController.handleRequest (cyclomatic 20) src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php:6 — PhabricatorCalendarEventCancelController.handleRequest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilCalendarRecurrenceRule.advanceCursorState (cyclomatic 20) · ×1
  • PhutilCalendarRecurrenceRule.advanceCursorState (cyclomatic 20) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:1685 — PhutilCalendarRecurrenceRule.advanceCursorState has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PhabricatorCalendarEventQuery.buildWhereClauseParts (cyclomatic 20) · ×1
  • PhabricatorCalendarEventQuery.buildWhereClauseParts (cyclomatic 20) src/applications/calendar/query/PhabricatorCalendarEventQuery.php:357 — PhabricatorCalendarEventQuery.buildWhereClauseParts has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorConduitAPIController.handleRequest (cyclomatic 20) · ×1
  • PhabricatorConduitAPIController.handleRequest (cyclomatic 20) src/applications/conduit/controller/PhabricatorConduitAPIController.php:10 — PhabricatorConduitAPIController.handleRequest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DarkConsoleServicesPlugin.generateData (cyclomatic 20) · ×1
  • DarkConsoleServicesPlugin.generateData (cyclomatic 20) src/applications/console/plugin/DarkConsoleServicesPlugin.php:47 — DarkConsoleServicesPlugin.generateData has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialGetCommitMessageConduitAPIMethod.execute (cyclomatic 20) · ×1
  • DifferentialGetCommitMessageConduitAPIMethod.execute (cyclomatic 20) src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php:34 — DifferentialGetCommitMessageConduitAPIMethod.execute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialTransactionEditor.buildMailBody (cyclomatic 20) · ×1
  • DifferentialTransactionEditor.buildMailBody (cyclomatic 20) src/applications/differential/editor/DifferentialTransactionEditor.php:662 — DifferentialTransactionEditor.buildMailBody has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionController.buildCrumbList (cyclomatic 20) · ×1
  • DiffusionController.buildCrumbList (cyclomatic 20) src/applications/diffusion/controller/DiffusionController.php:128 — DiffusionController.buildCrumbList has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DiffusionLowLevelResolveRefsQuery.resolveMercurialRefs (cyclomatic 20) · ×1
  • DiffusionLowLevelResolveRefsQuery.resolveMercurialRefs (cyclomatic 20) src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php:243 — DiffusionLowLevelResolveRefsQuery.resolveMercurialRefs has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarbormasterBuildEngine.updateBuildable (cyclomatic 20) · ×1
  • HarbormasterBuildEngine.updateBuildable (cyclomatic 20) src/applications/harbormaster/engine/HarbormasterBuildEngine.php:442 — HarbormasterBuildEngine.updateBuildable has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManiphestTaskStatus.validateConfiguration (cyclomatic 20) · ×1
  • ManiphestTaskStatus.validateConfiguration (cyclomatic 20) src/applications/maniphest/constants/ManiphestTaskStatus.php:261 — ManiphestTaskStatus.validateConfiguration has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhortuneCartCheckoutController.handleCartRequest (cyclomatic 20) · ×1
  • PhortuneCartCheckoutController.handleCartRequest (cyclomatic 20) src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php:14 — PhortuneCartCheckoutController.handleCartRequest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PhabricatorBulkManagementExportWorkflow.newQueries (cyclomatic 20) · ×1
  • PhabricatorBulkManagementExportWorkflow.newQueries (cyclomatic 20) src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php:152 — PhabricatorBulkManagementExportWorkflow.newQueries has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransaction.getIcon (cyclomatic 20) · ×1
  • PhabricatorApplicationTransaction.getIcon (cyclomatic 20) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:473 — PhabricatorApplicationTransaction.getIcon has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PHUIObjectBoxView.getTagContent (cyclomatic 20) · ×1
  • PHUIObjectBoxView.getTagContent (cyclomatic 20) src/view/phui/PHUIObjectBoxView.php:181 — PHUIObjectBoxView.getTagContent has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIObjectItemView.getTagAttributes (cyclomatic 20) · ×1
  • PHUIObjectItemView.getTagAttributes (cyclomatic 20) src/view/phui/PHUIObjectItemView.php:287 — PHUIObjectItemView.getTagAttributes has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · behavior-populate.JX.behavior("differential-populate") (cyclomatic 20) · ×1
  • behavior-populate.JX.behavior("differential-populate") (cyclomatic 20) webroot/rsrc/js/application/differential/behavior-populate.js:13 — behavior-populate.JX.behavior("differential-populate") has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 95, onredraw, get_lists). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · behavior-object-selector.JX.behavior("phabricator-object-selector") (cyclomatic 20) · ×1
  • behavior-object-selector.JX.behavior("phabricator-object-selector") (cyclomatic 20) webroot/rsrc/js/core/behavior-object-selector.js:9 — behavior-object-selector.JX.behavior("phabricator-object-selector") has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (redrawList, onreceive, redrawAttached, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AphrontHTTPHeaderParser.getHeaderContentAsPairs (cyclomatic 19) · ×1
  • AphrontHTTPHeaderParser.getHeaderContentAsPairs (cyclomatic 19) src/aphront/headerparser/AphrontHTTPHeaderParser.php:34 — AphrontHTTPHeaderParser.getHeaderContentAsPairs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorAuthProviderConfigTransaction.getTitle (cyclomatic 19) · ×1
  • PhabricatorAuthProviderConfigTransaction.getTitle (cyclomatic 19) src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php:61 — PhabricatorAuthProviderConfigTransaction.getTitle has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilCalendarRecurrenceRule.resetSource (cyclomatic 19) · ×1
  • PhutilCalendarRecurrenceRule.resetSource (cyclomatic 19) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:566 — PhutilCalendarRecurrenceRule.resetSource has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhabricatorBinariesSetupCheck.executeChecks (cyclomatic 19) · ×1
  • PhabricatorBinariesSetupCheck.executeChecks (cyclomatic 19) src/applications/config/check/PhabricatorBinariesSetupCheck.php:9 — PhabricatorBinariesSetupCheck.executeChecks has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorExtraConfigSetupCheck.executeChecks (cyclomatic 19) · ×1
  • PhabricatorExtraConfigSetupCheck.executeChecks (cyclomatic 19) src/applications/config/check/PhabricatorExtraConfigSetupCheck.php:9 — PhabricatorExtraConfigSetupCheck.executeChecks has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialChangesetRenderer.buildPrimitives (cyclomatic 19) · ×1
  • DifferentialChangesetRenderer.buildPrimitives (cyclomatic 19) src/applications/differential/render/DifferentialChangesetRenderer.php:453 — DifferentialChangesetRenderer.buildPrimitives has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialLocalCommitsView.render (cyclomatic 19) · ×1
  • DifferentialLocalCommitsView.render (cyclomatic 19) src/applications/differential/view/DifferentialLocalCommitsView.php:19 — DifferentialLocalCommitsView.render has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionRepositoryStorageManagementPanel.buildClusterStatusPanel (cyclomatic 19) · ×1
  • DiffusionRepositoryStorageManagementPanel.buildClusterStatusPanel (cyclomatic 19) src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php:79 — DiffusionRepositoryStorageManagementPanel.buildClusterStatusPanel has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorFilesManagementMigrateWorkflow.execute (cyclomatic 19) · ×1
  • PhabricatorFilesManagementMigrateWorkflow.execute (cyclomatic 19) src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php:57 — PhabricatorFilesManagementMigrateWorkflow.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.
D1 · Cyclomatic Complexity · PhabricatorOAuthServerTokenController.handleRequest (cyclomatic 19) · ×1
  • PhabricatorOAuthServerTokenController.handleRequest (cyclomatic 19) src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php:17 — PhabricatorOAuthServerTokenController.handleRequest has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorOwnersPackageQuery.getControllingPackagesForPath (cyclomatic 19) · ×1
  • PhabricatorOwnersPackageQuery.getControllingPackagesForPath (cyclomatic 19) src/applications/owners/query/PhabricatorOwnersPackageQuery.php:369 — PhabricatorOwnersPackageQuery.getControllingPackagesForPath has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPeopleQuery.fillUserCaches (cyclomatic 19) · ×1
  • PhabricatorPeopleQuery.fillUserCaches (cyclomatic 19) src/applications/people/query/PhabricatorPeopleQuery.php:514 — PhabricatorPeopleQuery.fillUserCaches has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhortuneCartCancelController.handleCartRequest (cyclomatic 19) · ×1
  • PhortuneCartCancelController.handleCartRequest (cyclomatic 19) src/applications/phortune/controller/cart/PhortuneCartCancelController.php:14 — PhortuneCartCancelController.handleCartRequest has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPhortuneManagementInvoiceWorkflow.execute (cyclomatic 19) · ×1
  • PhabricatorPhortuneManagementInvoiceWorkflow.execute (cyclomatic 19) src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php:49 — PhabricatorPhortuneManagementInvoiceWorkflow.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.
D1 · Cyclomatic Complexity · PhortunePayPalPaymentProvider.updateCharge (cyclomatic 19) · ×1
  • PhortunePayPalPaymentProvider.updateCharge (cyclomatic 19) src/applications/phortune/provider/PhortunePayPalPaymentProvider.php:194 — PhortunePayPalPaymentProvider.updateCharge has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhrictionDocumentQuery.willFilterPage (cyclomatic 19) · ×1
  • PhrictionDocumentQuery.willFilterPage (cyclomatic 19) src/applications/phriction/query/PhrictionDocumentQuery.php:69 — PhrictionDocumentQuery.willFilterPage has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PhabricatorProjectIconSet.validateConfiguration (cyclomatic 19) · ×1
  • PhabricatorProjectIconSet.validateConfiguration (cyclomatic 19) src/applications/project/icon/PhabricatorProjectIconSet.php:195 — PhabricatorProjectIconSet.validateConfiguration has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryManagementParentsWorkflow.rebuildRepository (cyclomatic 19) · ×1
  • PhabricatorRepositoryManagementParentsWorkflow.rebuildRepository (cyclomatic 19) src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php:49 — PhabricatorRepositoryManagementParentsWorkflow.rebuildRepository has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.execute (cyclomatic 19) · ×1
  • PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.execute (cyclomatic 19) src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:63 — PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.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.
D1 · Cyclomatic Complexity · PhabricatorSearchRelationshipController.handleRequest (cyclomatic 19) · ×1
  • PhabricatorSearchRelationshipController.handleRequest (cyclomatic 19) src/applications/search/controller/PhabricatorSearchRelationshipController.php:6 — PhabricatorSearchRelationshipController.handleRequest has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransactionEditor.addHeadersAndCommentsToMailBody (cyclomatic 19) · ×1
  • PhabricatorApplicationTransactionEditor.addHeadersAndCommentsToMailBody (cyclomatic 19) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3859 — PhabricatorApplicationTransactionEditor.addHeadersAndCommentsToMailBody has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransaction.getRequiredHandlePHIDs (cyclomatic 19) · ×1
  • PhabricatorApplicationTransaction.getRequiredHandlePHIDs (cyclomatic 19) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:329 — PhabricatorApplicationTransaction.getRequiredHandlePHIDs has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhutilProseDifferenceEngine.buildDiff (cyclomatic 19) · ×1
  • PhutilProseDifferenceEngine.buildDiff (cyclomatic 19) src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php:9 — PhutilProseDifferenceEngine.buildDiff has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorDiffInlineCommentQuery.willFilterPage (cyclomatic 19) · ×1
  • PhabricatorDiffInlineCommentQuery.willFilterPage (cyclomatic 19) src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php:144 — PhabricatorDiffInlineCommentQuery.willFilterPage has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorJavelinLinter.lintPath (cyclomatic 19) · ×1
  • PhabricatorJavelinLinter.lintPath (cyclomatic 19) src/infrastructure/lint/linter/PhabricatorJavelinLinter.php:104 — PhabricatorJavelinLinter.lintPath has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorManagementWorkflow.loadUsersFromArguments (cyclomatic 19) · ×1
  • PhabricatorManagementWorkflow.loadUsersFromArguments (cyclomatic 19) src/infrastructure/management/PhabricatorManagementWorkflow.php:70 — PhabricatorManagementWorkflow.loadUsersFromArguments has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicJoinClause (cyclomatic 19) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicJoinClause (cyclomatic 19) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2694 — PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicJoinClause has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PhabricatorRemarkupControl.renderInput (cyclomatic 19) · ×1
  • PhabricatorRemarkupControl.renderInput (cyclomatic 19) src/view/form/control/PhabricatorRemarkupControl.php:52 — PhabricatorRemarkupControl.renderInput has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMainMenuView.render (cyclomatic 19) · ×1
  • PhabricatorMainMenuView.render (cyclomatic 19) src/view/page/menu/PhabricatorMainMenuView.php:51 — PhabricatorMainMenuView.render has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIPagerView.render (cyclomatic 19) · ×1
  • PHUIPagerView.render (cyclomatic 19) src/view/phui/PHUIPagerView.php:119 — PHUIPagerView.render has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-project-boards.JX.behavior("project-boards") (cyclomatic 19) · ×1
  • behavior-project-boards.JX.behavior("project-boards") (cyclomatic 19) webroot/rsrc/js/application/projects/behavior-project-boards.js:13 — behavior-project-boards.JX.behavior("project-boards") has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 19) · ×1
  • (anonymous) (cyclomatic 19) webroot/rsrc/js/application/projects/behavior-project-boards.js:13 — (anonymous) has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 5 function items inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · _getFragmentLocation (cyclomatic 19) · ×1
  • _getFragmentLocation (cyclomatic 19) webroot/rsrc/js/application/diff/DiffChangesetList.js:2643 — _getFragmentLocation has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorDuoAuthFactor.processAddFactorForm (cyclomatic 18) · ×1
  • PhabricatorDuoAuthFactor.processAddFactorForm (cyclomatic 18) src/applications/auth/factor/PhabricatorDuoAuthFactor.php:155 — PhabricatorDuoAuthFactor.processAddFactorForm has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorConfigConsoleController.loadVersions (cyclomatic 18) · ×1
  • PhabricatorConfigConsoleController.loadVersions (cyclomatic 18) src/applications/config/controller/PhabricatorConfigConsoleController.php:139 — PhabricatorConfigConsoleController.loadVersions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorDashboardObjectInstallWorkflow.handleRequest (cyclomatic 18) · ×1
  • PhabricatorDashboardObjectInstallWorkflow.handleRequest (cyclomatic 18) src/applications/dashboard/install/PhabricatorDashboardObjectInstallWorkflow.php:10 — PhabricatorDashboardObjectInstallWorkflow.handleRequest has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialTransactionEditor.didApplyTransactions (cyclomatic 18) · ×1
  • DifferentialTransactionEditor.didApplyTransactions (cyclomatic 18) src/applications/differential/editor/DifferentialTransactionEditor.php:1529 — DifferentialTransactionEditor.didApplyTransactions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialCommitMessageParser.parseCorpus (cyclomatic 18) · ×1
  • DifferentialCommitMessageParser.parseCorpus (cyclomatic 18) src/applications/differential/parser/DifferentialCommitMessageParser.php:136 — DifferentialCommitMessageParser.parseCorpus has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialRevisionListView.render (cyclomatic 18) · ×1
  • DifferentialRevisionListView.render (cyclomatic 18) src/applications/differential/view/DifferentialRevisionListView.php:50 — DifferentialRevisionListView.render has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionLintSaveRunner.run (cyclomatic 18) · ×1
  • DiffusionLintSaveRunner.run (cyclomatic 18) src/applications/diffusion/DiffusionLintSaveRunner.php:45 — DiffusionLintSaveRunner.run has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionRefTableController.handleRequest (cyclomatic 18) · ×1
  • DiffusionRefTableController.handleRequest (cyclomatic 18) src/applications/diffusion/controller/DiffusionRefTableController.php:9 — DiffusionRefTableController.handleRequest has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionRepositoryProfilePictureController.handleRequest (cyclomatic 18) · ×1
  • DiffusionRepositoryProfilePictureController.handleRequest (cyclomatic 18) src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:6 — DiffusionRepositoryProfilePictureController.handleRequest has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionSubversionWireProtocol.writeData (cyclomatic 18) · ×1
  • DiffusionSubversionWireProtocol.writeData (cyclomatic 18) src/applications/diffusion/protocol/DiffusionSubversionWireProtocol.php:31 — DiffusionSubversionWireProtocol.writeData has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: DiffusionSubversionWireProtocol.isReadOnlyCommand (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DiffusionCommitGraphView.newObjectItemViews (cyclomatic 18) · ×1
  • DiffusionCommitGraphView.newObjectItemViews (cyclomatic 18) src/applications/diffusion/view/DiffusionCommitGraphView.php:105 — DiffusionCommitGraphView.newObjectItemViews has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorChartStackedAreaDataset.newChartDisplayData (cyclomatic 18) · ×1
  • PhabricatorChartStackedAreaDataset.newChartDisplayData (cyclomatic 18) src/applications/fact/chart/PhabricatorChartStackedAreaDataset.php:19 — PhabricatorChartStackedAreaDataset.newChartDisplayData has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorChartRenderingEngine.newTabularView (cyclomatic 18) · ×1
  • PhabricatorChartRenderingEngine.newTabularView (cyclomatic 18) src/applications/fact/engine/PhabricatorChartRenderingEngine.php:112 — PhabricatorChartRenderingEngine.newTabularView has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PhabricatorFileDataController.handleRequest (cyclomatic 18) · ×1
  • PhabricatorFileDataController.handleRequest (cyclomatic 18) src/applications/files/controller/PhabricatorFileDataController.php:17 — PhabricatorFileDataController.handleRequest has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorFileQuery.loadPage (cyclomatic 18) · ×1
  • PhabricatorFileQuery.loadPage (cyclomatic 18) src/applications/files/query/PhabricatorFileQuery.php:166 — PhabricatorFileQuery.loadPage has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HarbormasterUIEventListener.handlePropertyEvent (cyclomatic 18) · ×1
  • HarbormasterUIEventListener.handlePropertyEvent (cyclomatic 18) src/applications/harbormaster/event/HarbormasterUIEventListener.php:18 — HarbormasterUIEventListener.handlePropertyEvent has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldRuleController.saveRule (cyclomatic 18) · ×1
  • HeraldRuleController.saveRule (cyclomatic 18) src/applications/herald/controller/HeraldRuleController.php:263 — HeraldRuleController.saveRule has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldEngine.applyRules (cyclomatic 18) · ×1
  • HeraldEngine.applyRules (cyclomatic 18) src/applications/herald/engine/HeraldEngine.php:126 — HeraldEngine.applyRules has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldEngine.applyEffects (cyclomatic 18) · ×1
  • HeraldEngine.applyEffects (cyclomatic 18) src/applications/herald/engine/HeraldEngine.php:258 — HeraldEngine.applyEffects has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMacroQuery.buildWhereClauseParts (cyclomatic 18) · ×1
  • PhabricatorMacroQuery.buildWhereClauseParts (cyclomatic 18) src/applications/macro/query/PhabricatorMacroQuery.php:103 — PhabricatorMacroQuery.buildWhereClauseParts has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorMailSMTPAdapter.sendMessage (cyclomatic 18) · ×1
  • PhabricatorMailSMTPAdapter.sendMessage (cyclomatic 18) REDACTED:47 — PhabricatorMailSMTPAdapter.sendMessage has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorNotificationServersConfigType.validateStoredValue (cyclomatic 18) · ×1
  • PhabricatorNotificationServersConfigType.validateStoredValue (cyclomatic 18) REDACTED:8 — PhabricatorNotificationServersConfigType.validateStoredValue has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NuanceGitHubImportCursor.pullDataFromSource (cyclomatic 18) · ×1
  • NuanceGitHubImportCursor.pullDataFromSource (cyclomatic 18) src/applications/nuance/cursor/NuanceGitHubImportCursor.php:56 — NuanceGitHubImportCursor.pullDataFromSource has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorOAuthServerAuthController.handleRequest (cyclomatic 18) · ×1
  • PhabricatorOAuthServerAuthController.handleRequest (cyclomatic 18) src/applications/oauthserver/controller/PhabricatorOAuthServerAuthController.php:12 — PhabricatorOAuthServerAuthController.handleRequest has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorPolicyFilter.applyExtendedPolicyChecks (cyclomatic 18) · ×1
  • PhabricatorPolicyFilter.applyExtendedPolicyChecks (cyclomatic 18) src/applications/policy/filter/PhabricatorPolicyFilter.php:302 — PhabricatorPolicyFilter.applyExtendedPolicyChecks has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryGraphCache.loadLastModifiedCommitID (cyclomatic 18) · ×1
  • PhabricatorRepositoryGraphCache.loadLastModifiedCommitID (cyclomatic 18) src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php:75 — PhabricatorRepositoryGraphCache.loadLastModifiedCommitID has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProfileMenuItemView.newListItemView (cyclomatic 18) · ×1
  • PhabricatorProfileMenuItemView.newListItemView (cyclomatic 18) src/applications/search/engine/PhabricatorProfileMenuItemView.php:138 — PhabricatorProfileMenuItemView.newListItemView has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransaction.shouldHideForMail (cyclomatic 18) · ×1
  • PhabricatorApplicationTransaction.shouldHideForMail (cyclomatic 18) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:728 — PhabricatorApplicationTransaction.shouldHideForMail has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhabricatorSSHPassthruCommand.execute (cyclomatic 18) · ×1
  • PhabricatorSSHPassthruCommand.execute (cyclomatic 18) src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php:87 — PhabricatorSSHPassthruCommand.execute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIListItemView.getTagContent (cyclomatic 18) · ×1
  • PHUIListItemView.getTagContent (cyclomatic 18) src/view/phui/PHUIListItemView.php:286 — PHUIListItemView.getTagContent has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUITimelineView.buildEvents (cyclomatic 18) · ×1
  • PHUITimelineView.buildEvents (cyclomatic 18) src/view/phui/PHUITimelineView.php:101 — PHUITimelineView.buildEvents has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-form.JX.behavior("aphront-form-disable-on-submit") (cyclomatic 18) · ×1
  • behavior-form.JX.behavior("aphront-form-disable-on-submit") (cyclomatic 18) webroot/rsrc/js/core/behavior-form.js:6 — behavior-form.JX.behavior("aphront-form-disable-on-submit") has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 18, a function literal at line 57, a function literal at line 12, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 18) · ×1
  • (anonymous) (cyclomatic 18) webroot/rsrc/js/core/behavior-form.js:6 — (anonymous) has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 18, a function literal at line 57, a function literal at line 12, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · getSelectableItems (cyclomatic 18) · ×1
  • getSelectableItems (cyclomatic 18) webroot/rsrc/js/application/diff/DiffChangeset.js:435 — getSelectableItems has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorConfigClusterDatabasesController.buildClusterDatabaseStatus (cyclomatic 17) · ×1
  • PhabricatorConfigClusterDatabasesController.buildClusterDatabaseStatus (cyclomatic 17) src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:36 — PhabricatorConfigClusterDatabasesController.buildClusterDatabaseStatus has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConpherenceViewController.handleRequest (cyclomatic 17) · ×1
  • ConpherenceViewController.handleRequest (cyclomatic 17) src/applications/conpherence/controller/ConpherenceViewController.php:12 — ConpherenceViewController.handleRequest has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConpherenceThreadSearchEngine.renderResultList (cyclomatic 17) · ×1
  • ConpherenceThreadSearchEngine.renderResultList (cyclomatic 17) src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:94 — ConpherenceThreadSearchEngine.renderResultList has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialChangesetParser.newDocumentEngine (cyclomatic 17) · ×1
  • DifferentialChangesetParser.newDocumentEngine (cyclomatic 17) src/applications/differential/parser/DifferentialChangesetParser.php:1746 — DifferentialChangesetParser.newDocumentEngine has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialChangesetOneUpMailRenderer.renderPrimitives (cyclomatic 17) · ×1
  • DifferentialChangesetOneUpMailRenderer.renderPrimitives (cyclomatic 17) src/applications/differential/render/DifferentialChangesetOneUpMailRenderer.php:43 — DifferentialChangesetOneUpMailRenderer.renderPrimitives has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialRevisionUpdateHistoryView.render (cyclomatic 17) · ×1
  • DifferentialRevisionUpdateHistoryView.render (cyclomatic 17) src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php:38 — DifferentialRevisionUpdateHistoryView.render has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionCompareController.handleRequest (cyclomatic 17) · ×1
  • DiffusionCompareController.handleRequest (cyclomatic 17) src/applications/diffusion/controller/DiffusionCompareController.php:9 — DiffusionCompareController.handleRequest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiffusionSourceLinkRemarkupRule.didMarkupText (cyclomatic 17) · ×1
  • DiffusionSourceLinkRemarkupRule.didMarkupText (cyclomatic 17) src/applications/diffusion/remarkup/DiffusionSourceLinkRemarkupRule.php:46 — DiffusionSourceLinkRemarkupRule.didMarkupText has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DivinerPHPAtomizer.executeAtomize (cyclomatic 17) · ×1
  • DivinerPHPAtomizer.executeAtomize (cyclomatic 17) src/applications/diviner/atomizer/DivinerPHPAtomizer.php:9 — DivinerPHPAtomizer.executeAtomize has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PhabricatorJupyterDocumentEngine.newCells (cyclomatic 17) · ×1
  • PhabricatorJupyterDocumentEngine.newCells (cyclomatic 17) src/applications/files/document/PhabricatorJupyterDocumentEngine.php:307 — PhabricatorJupyterDocumentEngine.newCells has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeraldRuleController.setupEditorBehavior (cyclomatic 17) · ×1
  • HeraldRuleController.setupEditorBehavior (cyclomatic 17) src/applications/herald/controller/HeraldRuleController.php:400 — HeraldRuleController.setupEditorBehavior has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPeopleQuery.buildWhereClauseParts (cyclomatic 17) · ×1
  • PhabricatorPeopleQuery.buildWhereClauseParts (cyclomatic 17) src/applications/people/query/PhabricatorPeopleQuery.php:242 — PhabricatorPeopleQuery.buildWhereClauseParts has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorPeopleQuery.rebuildAvailabilityCache (cyclomatic 17) · ×1
  • PhabricatorPeopleQuery.rebuildAvailabilityCache (cyclomatic 17) src/applications/people/query/PhabricatorPeopleQuery.php:385 — PhabricatorPeopleQuery.rebuildAvailabilityCache has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhameLiveController.setupLiveEnvironment (cyclomatic 17) · ×1
  • PhameLiveController.setupLiveEnvironment (cyclomatic 17) src/applications/phame/controller/PhameLiveController.php:30 — PhameLiveController.setupLiveEnvironment has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhluxEditController.handleRequest (cyclomatic 17) · ×1
  • PhluxEditController.handleRequest (cyclomatic 17) src/applications/phlux/controller/PhluxEditController.php:5 — PhluxEditController.handleRequest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhortuneMerchantProviderEditController.handleMerchantRequest (cyclomatic 17) · ×1
  • PhortuneMerchantProviderEditController.handleMerchantRequest (cyclomatic 17) src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:10 — PhortuneMerchantProviderEditController.handleMerchantRequest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhortuneOrderSummaryView.newMessagesView (cyclomatic 17) · ×1
  • PhortuneOrderSummaryView.newMessagesView (cyclomatic 17) src/applications/phortune/view/PhortuneOrderSummaryView.php:49 — PhortuneOrderSummaryView.newMessagesView has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectBoardReorderController.handleRequest (cyclomatic 17) · ×1
  • PhabricatorProjectBoardReorderController.handleRequest (cyclomatic 17) src/applications/project/controller/PhabricatorProjectBoardReorderController.php:6 — PhabricatorProjectBoardReorderController.handleRequest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectEditPictureController.handleRequest (cyclomatic 17) · ×1
  • PhabricatorProjectEditPictureController.handleRequest (cyclomatic 17) src/applications/project/controller/PhabricatorProjectEditPictureController.php:6 — PhabricatorProjectEditPictureController.handleRequest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectUserListView.render (cyclomatic 17) · ×1
  • PhabricatorProjectUserListView.render (cyclomatic 17) src/applications/project/view/PhabricatorProjectUserListView.php:55 — PhabricatorProjectUserListView.render has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositorySvnCommitChangeParserWorker.parseRecursiveListFileData (cyclomatic 17) · ×1
  • PhabricatorRepositorySvnCommitChangeParserWorker.parseRecursiveListFileData (cyclomatic 17) src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php:676 — PhabricatorRepositorySvnCommitChangeParserWorker.parseRecursiveListFileData has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorApplicationTransactionEditor.filterTransactions (cyclomatic 17) · ×1
  • PhabricatorApplicationTransactionEditor.filterTransactions (cyclomatic 17) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2772 — PhabricatorApplicationTransactionEditor.filterTransactions 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. This is NOT this file's highest cyclomatic complexity: PhabricatorApplicationTransactionEditor.applyInternalEffects (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · PhutilDaemonHandle.update (cyclomatic 17) · ×1
  • PhutilDaemonHandle.update (cyclomatic 17) src/infrastructure/daemon/PhutilDaemonHandle.php:136 — PhutilDaemonHandle.update has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilDefaultSyntaxHighlighterEngine.getHighlightFuture (cyclomatic 17) · ×1
  • PhutilDefaultSyntaxHighlighterEngine.getHighlightFuture (cyclomatic 17) src/infrastructure/markup/syntax/engine/PhutilDefaultSyntaxHighlighterEngine.php:42 — PhutilDefaultSyntaxHighlighterEngine.getHighlightFuture has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhutilXHPASTSyntaxHighlighterFuture.findInterestingSymbols (cyclomatic 17) · ×1
  • PhutilXHPASTSyntaxHighlighterFuture.findInterestingSymbols (cyclomatic 17) src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:164 — PhutilXHPASTSyntaxHighlighterFuture.findInterestingSymbols has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PHUICalendarMonthView.render (cyclomatic 17) · ×1
  • PHUICalendarMonthView.render (cyclomatic 17) src/view/phui/calendar/PHUICalendarMonthView.php:53 — PHUICalendarMonthView.render has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-batch-selector.JX.behavior("maniphest-batch-selector") (cyclomatic 17) · ×1
  • behavior-batch-selector.JX.behavior("maniphest-batch-selector") (cyclomatic 17) webroot/rsrc/js/application/maniphest/behavior-batch-selector.js:9 — behavior-batch-selector.JX.behavior("maniphest-batch-selector") has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 96, clear_selection, change, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · sortHandler (cyclomatic 17) · ×1
  • sortHandler (cyclomatic 17) webroot/rsrc/js/core/Prefab.js:192 — sortHandler has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 221). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 17) · ×1
  • (anonymous) (cyclomatic 17) webroot/rsrc/js/application/maniphest/behavior-batch-selector.js:9 — (anonymous) has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 96, clear_selection, change, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · _getInlinesByType (cyclomatic 17) · ×1
  • _getInlinesByType (cyclomatic 17) webroot/rsrc/js/application/diff/DiffChangesetList.js:1968 — _getInlinesByType has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhutilICSParser.parseICSProperty (cyclomatic 16) · ×1
  • PhutilICSParser.parseICSProperty (cyclomatic 16) src/applications/calendar/parser/ics/PhutilICSParser.php:191 — PhutilICSParser.parseICSProperty has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorConduitMethodQuery.filterMethods (cyclomatic 16) · ×1
  • PhabricatorConduitMethodQuery.filterMethods (cyclomatic 16) src/applications/conduit/query/PhabricatorConduitMethodQuery.php:57 — PhabricatorConduitMethodQuery.filterMethods has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorPathSetupCheck.executeChecks (cyclomatic 16) · ×1
  • PhabricatorPathSetupCheck.executeChecks (cyclomatic 16) src/applications/config/check/PhabricatorPathSetupCheck.php:9 — PhabricatorPathSetupCheck.executeChecks has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConpherenceTransactionRenderer.renderTransactions (cyclomatic 16) · ×1
  • ConpherenceTransactionRenderer.renderTransactions (cyclomatic 16) src/applications/conpherence/ConpherenceTransactionRenderer.php:5 — ConpherenceTransactionRenderer.renderTransactions has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConpherenceRoomPictureController.handleRequest (cyclomatic 16) · ×1
  • ConpherenceRoomPictureController.handleRequest (cyclomatic 16) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:6 — ConpherenceRoomPictureController.handleRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialDiffCreateController.handleRequest (cyclomatic 16) · ×1
  • DifferentialDiffCreateController.handleRequest (cyclomatic 16) src/applications/differential/controller/DifferentialDiffCreateController.php:5 — DifferentialDiffCreateController.handleRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialTransactionEditor.expandCustomRemarkupBlockTransactions (cyclomatic 16) · ×1
  • DifferentialTransactionEditor.expandCustomRemarkupBlockTransactions (cyclomatic 16) src/applications/differential/editor/DifferentialTransactionEditor.php:807 — DifferentialTransactionEditor.expandCustomRemarkupBlockTransactions has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialDiffExtractionEngine.isDiffChangedBeforeCommit (cyclomatic 16) · ×1
  • DifferentialDiffExtractionEngine.isDiffChangedBeforeCommit (cyclomatic 16) src/applications/differential/engine/DifferentialDiffExtractionEngine.php:119 — DifferentialDiffExtractionEngine.isDiffChangedBeforeCommit has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DifferentialRevisionReviewTransaction.applyReviewerEffect (cyclomatic 16) · ×1
  • DifferentialRevisionReviewTransaction.applyReviewerEffect (cyclomatic 16) src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php:163 — DifferentialRevisionReviewTransaction.applyReviewerEffect has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DrydockManagementLeaseWorkflow.execute (cyclomatic 16) · ×1
  • DrydockManagementLeaseWorkflow.execute (cyclomatic 16) src/applications/drydock/management/DrydockManagementLeaseWorkflow.php:44 — DrydockManagementLeaseWorkflow.execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorTransactionFactEngine.groupTransactions (cyclomatic 16) · ×1
  • PhabricatorTransactionFactEngine.groupTransactions (cyclomatic 16) src/applications/fact/engine/PhabricatorTransactionFactEngine.php:21 — PhabricatorTransactionFactEngine.groupTransactions has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorFeedTransactionQuery.loadPage (cyclomatic 16) · ×1
  • PhabricatorFeedTransactionQuery.loadPage (cyclomatic 16) src/applications/feed/query/PhabricatorFeedTransactionQuery.php:41 — PhabricatorFeedTransactionQuery.loadPage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileAllocateConduitAPIMethod.execute (cyclomatic 16) · ×1
  • FileAllocateConduitAPIMethod.execute (cyclomatic 16) src/applications/files/conduit/FileAllocateConduitAPIMethod.php:28 — FileAllocateConduitAPIMethod.execute has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HeraldRuleController.handleRequest (cyclomatic 16) · ×1
  • HeraldRuleController.handleRequest (cyclomatic 16) src/applications/herald/controller/HeraldRuleController.php:5 — HeraldRuleController.handleRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorMetaMTAMemberQuery.execute (cyclomatic 16) · ×1
  • PhabricatorMetaMTAMemberQuery.execute (cyclomatic 16) src/applications/metamta/query/PhabricatorMetaMTAMemberQuery.php:26 — PhabricatorMetaMTAMemberQuery.execute has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PhabricatorPeopleSearchEngine.renderResultList (cyclomatic 16) · ×1
  • PhabricatorPeopleSearchEngine.renderResultList (cyclomatic 16) src/applications/people/query/PhabricatorPeopleSearchEngine.php:233 — PhabricatorPeopleSearchEngine.renderResultList has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhameBlogProfilePictureController.handleRequest (cyclomatic 16) · ×1
  • PhameBlogProfilePictureController.handleRequest (cyclomatic 16) src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:6 — PhameBlogProfilePictureController.handleRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorProjectColumnQuery.didFilterPage (cyclomatic 16) · ×1
  • PhabricatorProjectColumnQuery.didFilterPage (cyclomatic 16) src/applications/project/query/PhabricatorProjectColumnQuery.php:88 — PhabricatorProjectColumnQuery.didFilterPage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryPullEngine.executeGitUpdate (cyclomatic 16) · ×1
  • PhabricatorRepositoryPullEngine.executeGitUpdate (cyclomatic 16) src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:275 — PhabricatorRepositoryPullEngine.executeGitUpdate has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorRepositoryRefEngine.updateCursors (cyclomatic 16) · ×1
  • PhabricatorRepositoryRefEngine.updateCursors (cyclomatic 16) src/applications/repository/engine/PhabricatorRepositoryRefEngine.php:258 — PhabricatorRepositoryRefEngine.updateCursors has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorElasticFulltextStorageEngine.buildSpec (cyclomatic 16) · ×1
  • PhabricatorElasticFulltextStorageEngine.buildSpec (cyclomatic 16) src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php:108 — PhabricatorElasticFulltextStorageEngine.buildSpec has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PhabricatorEmailAddressesSettingsPanel.returnNewAddressResponse (cyclomatic 16) · ×1
  • PhabricatorEmailAddressesSettingsPanel.returnNewAddressResponse (cyclomatic 16) src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:158 — PhabricatorEmailAddressesSettingsPanel.returnNewAddressResponse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhabricatorInternationalizationManagementExtractWorkflow.extractFiles (cyclomatic 16) · ×1
  • PhabricatorInternationalizationManagementExtractWorkflow.extractFiles (cyclomatic 16) src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php:127 — PhabricatorInternationalizationManagementExtractWorkflow.extractFiles has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PhutilRemarkupListBlockRule.getMatchingLineCount (cyclomatic 16) · ×1
  • PhutilRemarkupListBlockRule.getMatchingLineCount (cyclomatic 16) src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php:13 — PhutilRemarkupListBlockRule.getMatchingLineCount has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PHUIButtonView.getTagAttributes (cyclomatic 16) · ×1
  • PHUIButtonView.getTagAttributes (cyclomatic 16) src/view/phui/PHUIButtonView.php:172 — PHUIButtonView.getTagAttributes has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · behavior-desktop-notifications-control.JX.behavior("desktop-notifications-control") (cyclomatic 16) · ×1
  • behavior-desktop-notifications-control.JX.behavior("desktop-notifications-control") (cyclomatic 16) webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js:10 — behavior-desktop-notifications-control.JX.behavior("desktop-notifications-control") has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (updateFormStatus, updateBrowserStatus, a function literal at line 82, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · behavior-policy-control.JX.behavior("policy-control") (cyclomatic 16) · ×1
  • behavior-policy-control.JX.behavior("policy-control") (cyclomatic 16) webroot/rsrc/js/application/policy/behavior-policy-control.js:13 — behavior-policy-control.JX.behavior("policy-control") has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 30, add_policy, render_option, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · behavior-time-typeahead.JX.behavior("time-typeahead") · ×1
  • behavior-time-typeahead.JX.behavior("time-typeahead")::getNewValue (cyclomatic 16) webroot/rsrc/js/core/behavior-time-typeahead.js:82 — behavior-time-typeahead.JX.behavior("time-typeahead")::getNewValue has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · behavior-watch-anchor.JX.behavior("phabricator-watch-anchor") · ×1
  • behavior-watch-anchor.JX.behavior("phabricator-watch-anchor")::seek_anchor (cyclomatic 16) webroot/rsrc/js/core/behavior-watch-anchor.js:34 — behavior-watch-anchor.JX.behavior("phabricator-watch-anchor")::seek_anchor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _onresults (cyclomatic 16) · ×1
  • _onresults (cyclomatic 16) webroot/rsrc/js/phuix/PHUIXAutocomplete.js:230 — _onresults 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. This is NOT this file's highest cyclomatic complexity: _activate (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _onmenu (cyclomatic 16) · ×1
  • _onmenu (cyclomatic 16) webroot/rsrc/js/application/diff/DiffChangesetList.js:900 — _onmenu has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 1112, a function literal at line 972, add_link, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · _newHoverMap (cyclomatic 16) · ×1
  • _newHoverMap (cyclomatic 16) webroot/rsrc/js/application/diff/DiffChangesetList.js:1539 — _newHoverMap has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · PhabricatorAuthRegisterController.handleRequest (cognitive 208) · ×1
  • PhabricatorAuthRegisterController.handleRequest (cognitive 208) src/applications/auth/controller/PhabricatorAuthRegisterController.php:10 — PhabricatorAuthRegisterController.handleRequest has cognitive complexity 208 (threshold 15). Drivers by points: if/else 91 (187 pts), boolean chains 10, error handling 2 (6 pts), ternaries 4 (5 pts) (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.
D2 · Cognitive Complexity · DifferentialChangesetTwoUpRenderer.renderTextChange (cognitive 174) · ×1
  • DifferentialChangesetTwoUpRenderer.renderTextChange (cognitive 174) src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:31 — DifferentialChangesetTwoUpRenderer.renderTextChange has cognitive complexity 174 (threshold 15). Drivers by points: if/else 45 (132 pts), ternaries 4 (16 pts), loops 5 (14 pts), boolean chains 12 (nesting depth added 108). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorApplicationTransaction.getTitle (cognitive 163) · ×1
  • PhabricatorApplicationTransaction.getTitle (cognitive 163) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:943 — PhabricatorApplicationTransaction.getTitle has cognitive complexity 163 (threshold 15). Drivers by points: if/else 62 (141 pts), boolean chains 11, loops 3 (8 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 85). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhutilSearchQueryCompiler.tokenizeQuery (cognitive 154) · ×1
  • PhutilSearchQueryCompiler.tokenizeQuery (cognitive 154) src/applications/search/compiler/PhutilSearchQueryCompiler.php:104 — PhutilSearchQueryCompiler.tokenizeQuery has cognitive complexity 154 (threshold 15). Drivers by points: if/else 51 (130 pts), loops 5 (10 pts), match/switch 3 (8 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · PhabricatorStorageManagementWorkflow.doAdjustSchemata (cognitive 154) · ×1
  • PhabricatorStorageManagementWorkflow.doAdjustSchemata (cognitive 154) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:159 — PhabricatorStorageManagementWorkflow.doAdjustSchemata has cognitive complexity 154 (threshold 15). Drivers by points: if/else 41 (125 pts), match/switch 3 (15 pts), loops 5 (8 pts), boolean chains 3, error handling 1 (3 pts) (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.
D2 · Cognitive Complexity · DiffusionCommitController.handleRequest (cognitive 152) · ×1
  • DiffusionCommitController.handleRequest (cognitive 152) src/applications/diffusion/controller/DiffusionCommitController.php:17 — DiffusionCommitController.handleRequest has cognitive complexity 152 (threshold 15). Drivers by points: if/else 44 (114 pts), loops 4 (25 pts), match/switch 1 (7 pts), boolean chains 6 (nesting depth added 97). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DifferentialChangesetParser.render (cognitive 150) · ×1
  • DifferentialChangesetParser.render (cognitive 150) src/applications/differential/parser/DifferentialChangesetParser.php:749 — DifferentialChangesetParser.render has cognitive complexity 150 (threshold 15). Drivers by points: if/else 57 (120 pts), loops 11 (21 pts), boolean chains 8, match/switch 1 (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.
D2 · Cognitive Complexity · PhabricatorRepositorySvnCommitChangeParserWorker.parseCommitChanges (cognitive 149) · ×1
  • PhabricatorRepositorySvnCommitChangeParserWorker.parseCommitChanges (cognitive 149) src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php:6 — PhabricatorRepositorySvnCommitChangeParserWorker.parseCommitChanges has cognitive complexity 149 (threshold 15). Drivers by points: if/else 36 (113 pts), loops 17 (28 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 91). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorStorageManagementWorkflow.doUpgradeSchemata (cognitive 126) · ×1
  • PhabricatorStorageManagementWorkflow.doUpgradeSchemata (cognitive 126) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:918 — PhabricatorStorageManagementWorkflow.doUpgradeSchemata has cognitive complexity 126 (threshold 15). Drivers by points: if/else 34 (96 pts), loops 12 (26 pts), boolean chains 4 (nesting depth added 76). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorRepositoryMercurialCommitChangeParserWorker.parseCommitChanges (cognitive 123) · ×1
  • PhabricatorRepositoryMercurialCommitChangeParserWorker.parseCommitChanges (cognitive 123) src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryMercurialCommitChangeParserWorker.php:6 — PhabricatorRepositoryMercurialCommitChangeParserWorker.parseCommitChanges has cognitive complexity 123 (threshold 15). Drivers by points: if/else 43 (97 pts), loops 15 (18 pts), ternaries 3 (6 pts), boolean chains 2 (nesting depth added 60). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HarbormasterBuildLogRenderController.handleRequest (cognitive 117) · ×1
  • HarbormasterBuildLogRenderController.handleRequest (cognitive 117) src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:10 — HarbormasterBuildLogRenderController.handleRequest has cognitive complexity 117 (threshold 15). Drivers by points: if/else 43 (89 pts), loops 15 (23 pts), boolean chains 5 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetEngine.detectCopiedCode (cognitive 115) · ×1
  • DifferentialChangesetEngine.detectCopiedCode (cognitive 115) src/applications/differential/engine/DifferentialChangesetEngine.php:162 — DifferentialChangesetEngine.detectCopiedCode has cognitive complexity 115 (threshold 15). Drivers by points: if/else 15 (71 pts), loops 12 (35 pts), ternaries 2 (9 pts) (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationSearchController.processSearchRequest (cognitive 112) · ×1
  • PhabricatorApplicationSearchController.processSearchRequest (cognitive 112) src/applications/search/controller/PhabricatorApplicationSearchController.php:95 — PhabricatorApplicationSearchController.processSearchRequest has cognitive complexity 112 (threshold 15). Drivers by points: if/else 40 (78 pts), loops 5 (16 pts), boolean chains 8, error handling 4 (8 pts), ternaries 1 (2 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitQuery.buildWhereClauseParts (cognitive 111) · ×1
  • DiffusionCommitQuery.buildWhereClauseParts (cognitive 111) src/applications/diffusion/query/DiffusionCommitQuery.php:536 — DiffusionCommitQuery.buildWhereClauseParts has cognitive complexity 111 (threshold 15). Drivers by points: if/else 48 (96 pts), loops 5 (12 pts), error handling 1 (3 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionMercurialWireClientSSHProtocolChannel.decodeStream (cognitive 111) · ×1
  • DiffusionMercurialWireClientSSHProtocolChannel.decodeStream (cognitive 111) src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php:79 — DiffusionMercurialWireClientSSHProtocolChannel.decodeStream has cognitive complexity 111 (threshold 15). Drivers by points: if/else 30 (109 pts), boolean chains 1, loops 1 (nesting depth added 79). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorStorageManagementWorkflow.findAdjustments (cognitive 111) · ×1
  • PhabricatorStorageManagementWorkflow.findAdjustments (cognitive 111) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:534 — PhabricatorStorageManagementWorkflow.findAdjustments has cognitive complexity 111 (threshold 15). Drivers by points: if/else 25 (86 pts), loops 8 (22 pts), boolean chains 3 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionURIEditor.validateTransaction (cognitive 105) · ×1
  • DiffusionURIEditor.validateTransaction (cognitive 105) src/applications/diffusion/editor/DiffusionURIEditor.php:156 — DiffusionURIEditor.validateTransaction has cognitive complexity 105 (threshold 15). Drivers by points: if/else 23 (81 pts), loops 7 (16 pts), match/switch 2 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 71). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AphrontTableView.render (cognitive 105) · ×1
  • AphrontTableView.render (cognitive 105) src/view/control/AphrontTableView.php:131 — AphrontTableView.render has cognitive complexity 105 (threshold 15). Drivers by points: if/else 30 (76 pts), loops 12 (26 pts), boolean chains 3 (nesting depth added 60). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · qsprintf.xsprintf_query (cognitive 102) · ×1
  • qsprintf.xsprintf_query (cognitive 102) src/infrastructure/storage/xsprintf/qsprintf.php:90 — qsprintf.xsprintf_query has cognitive complexity 102 (threshold 15). Drivers by points: if/else 28 (61 pts), loops 8 (24 pts), match/switch 6 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldEngine.getRuleMatchResult (cognitive 100) · ×1
  • HeraldEngine.getRuleMatchResult (cognitive 100) src/applications/herald/engine/HeraldEngine.php:379 — HeraldEngine.getRuleMatchResult has cognitive complexity 100 (threshold 15). Drivers by points: if/else 21 (63 pts), error handling 4 (28 pts), loops 1 (6 pts), boolean chains 3 (nesting depth added 71). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorManiphestTaskFactEngine.newDatapointsForObject (cognitive 99) · ×1
  • PhabricatorManiphestTaskFactEngine.newDatapointsForObject (cognitive 99) src/applications/fact/engine/PhabricatorManiphestTaskFactEngine.php:86 — PhabricatorManiphestTaskFactEngine.newDatapointsForObject has cognitive complexity 99 (threshold 15). Drivers by points: if/else 24 (68 pts), loops 8 (20 pts), match/switch 2 (7 pts), boolean chains 4 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarImportEngine.importEventDocument (cognitive 97) · ×1
  • PhabricatorCalendarImportEngine.importEventDocument (cognitive 97) src/applications/calendar/import/PhabricatorCalendarImportEngine.php:55 — PhabricatorCalendarImportEngine.importEventDocument has cognitive complexity 97 (threshold 15). Drivers by points: if/else 29 (61 pts), loops 18 (28 pts), error handling 1 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.applyTransactions (cognitive 97) · ×1
  • PhabricatorApplicationTransactionEditor.applyTransactions (cognitive 97) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1175 — PhabricatorApplicationTransactionEditor.applyTransactions has cognitive complexity 97 (threshold 15). Drivers by points: if/else 39 (73 pts), loops 12 (21 pts), error handling 2, boolean chains 1 (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.
D2 · Cognitive Complexity · PhabricatorInlineCommentAdjustmentEngine.execute (cognitive 97) · ×1
  • PhabricatorInlineCommentAdjustmentEngine.execute (cognitive 97) src/infrastructure/diff/engine/PhabricatorInlineCommentAdjustmentEngine.php:60 — PhabricatorInlineCommentAdjustmentEngine.execute has cognitive complexity 97 (threshold 15). Drivers by points: if/else 37 (77 pts), loops 13 (17 pts), ternaries 1 (3 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.
D2 · Cognitive Complexity · DiffusionCommitHookEngine.findMercurialChangegroupRefUpdates (cognitive 92) · ×1
  • DiffusionCommitHookEngine.findMercurialChangegroupRefUpdates (cognitive 92) src/applications/diffusion/engine/DiffusionCommitHookEngine.php:743 — DiffusionCommitHookEngine.findMercurialChangegroupRefUpdates has cognitive complexity 92 (threshold 15). Drivers by points: if/else 21 (60 pts), loops 10 (28 pts), boolean chains 4 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngine.buildEditResponse (cognitive 92) · ×1
  • PhabricatorEditEngine.buildEditResponse (cognitive 92) src/applications/transactions/editengine/PhabricatorEditEngine.php:1033 — PhabricatorEditEngine.buildEditResponse has cognitive complexity 92 (threshold 15). Drivers by points: if/else 30 (63 pts), loops 9 (23 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · (anonymous) (cognitive 91) · ×1
  • (anonymous) (cognitive 91) webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:16 — (anonymous) has cognitive complexity 91 (threshold 15). Drivers by points: if/else 66 (76 pts), loops 8, boolean chains 5, ternaries 2 (nesting depth added 10). Most of this is not in the body itself: 1 of the 91 points is its own statement and the rest belongs to 50 function items inside it that branch (redraw_inlines, render_image_info, resize_selection, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DiffusionSubversionWireProtocol.writeData (cognitive 89) · ×1
  • DiffusionSubversionWireProtocol.writeData (cognitive 89) src/applications/diffusion/protocol/DiffusionSubversionWireProtocol.php:31 — DiffusionSubversionWireProtocol.writeData has cognitive complexity 89 (threshold 15). Drivers by points: if/else 26 (88 pts), loops 1 (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceRule.newDaysSet (cognitive 88) · ×1
  • PhutilCalendarRecurrenceRule.newDaysSet (cognitive 88) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:1178 — PhutilCalendarRecurrenceRule.newDaysSet has cognitive complexity 88 (threshold 15). Drivers by points: if/else 30 (76 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorStorageManagementDumpWorkflow.didExecute (cognitive 88) · ×1
  • PhabricatorStorageManagementDumpWorkflow.didExecute (cognitive 88) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php:64 — PhabricatorStorageManagementDumpWorkflow.didExecute has cognitive complexity 88 (threshold 15). Drivers by points: if/else 40 (69 pts), loops 7 (11 pts), error handling 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-pholio-mock-view.JX.behavior("pholio-mock-view") (cognitive 88) · ×1
  • behavior-pholio-mock-view.JX.behavior("pholio-mock-view") (cognitive 88) webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:16 — behavior-pholio-mock-view.JX.behavior("pholio-mock-view") has cognitive complexity 88 (threshold 15). Drivers by points: if/else 64 (74 pts), loops 7, boolean chains 5, ternaries 2 (nesting depth added 10). Most of this is not in the body itself: 1 of the 88 points is its own statement and the rest belongs to 29 function items inside it that branch (redraw_inlines, render_image_info, resize_selection, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DifferentialChangesetOneUpRenderer.renderDocumentEngineBlocks (cognitive 87) · ×1
  • DifferentialChangesetOneUpRenderer.renderDocumentEngineBlocks (cognitive 87) src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:270 — DifferentialChangesetOneUpRenderer.renderDocumentEngineBlocks has cognitive complexity 87 (threshold 15). Drivers by points: if/else 30 (69 pts), loops 8 (15 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · DifferentialRevisionViewController.handleRequest (cognitive 86) · ×1
  • DifferentialRevisionViewController.handleRequest (cognitive 86) src/applications/differential/controller/DifferentialRevisionViewController.php:43 — DifferentialRevisionViewController.handleRequest has cognitive complexity 86 (threshold 15). Drivers by points: if/else 45 (57 pts), loops 16 (24 pts), boolean chains 4, ternaries 1 (nesting depth added 20). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhrictionDocumentController.handleRequest (cognitive 86) · ×1
  • PhrictionDocumentController.handleRequest (cognitive 86) src/applications/phriction/controller/PhrictionDocumentController.php:13 — PhrictionDocumentController.handleRequest has cognitive complexity 86 (threshold 15). Drivers by points: if/else 41 (84 pts), boolean chains 1, loops 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorFilesManagementIntegrityWorkflow.execute (cognitive 85) · ×1
  • PhabricatorFilesManagementIntegrityWorkflow.execute (cognitive 85) src/applications/files/management/PhabricatorFilesManagementIntegrityWorkflow.php:53 — PhabricatorFilesManagementIntegrityWorkflow.execute has cognitive complexity 85 (threshold 15). Drivers by points: if/else 39 (74 pts), boolean chains 7, error handling 1 (3 pts), loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIDiffGraphView.renderRawGraph (cognitive 85) · ×1
  • PHUIDiffGraphView.renderRawGraph (cognitive 85) src/infrastructure/diff/view/PHUIDiffGraphView.php:36 — PHUIDiffGraphView.renderRawGraph has cognitive complexity 85 (threshold 15). Drivers by points: if/else 19 (58 pts), loops 9 (26 pts), boolean chains 1 (nesting depth added 56). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DifferentialHunkParser.makeContextDiff (cognitive 84) · ×1
  • DifferentialHunkParser.makeContextDiff (cognitive 84) src/applications/differential/parser/DifferentialHunkParser.php:665 — DifferentialHunkParser.makeContextDiff has cognitive complexity 84 (threshold 15). Drivers by points: if/else 17 (73 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhortunePaymentMethodCreateController.handleRequest (cognitive 84) · ×1
  • PhortunePaymentMethodCreateController.handleRequest (cognitive 84) src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodCreateController.php:6 — PhortunePaymentMethodCreateController.handleRequest has cognitive complexity 84 (threshold 15). Drivers by points: if/else 33 (69 pts), error handling 3 (11 pts), boolean chains 2, loops 2 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DifferentialChangesetOneUpRenderer.renderPrimitives (cognitive 83) · ×1
  • DifferentialChangesetOneUpRenderer.renderPrimitives (cognitive 83) src/applications/differential/render/DifferentialChangesetOneUpRenderer.php:47 — DifferentialChangesetOneUpRenderer.renderPrimitives has cognitive complexity 83 (threshold 15). Drivers by points: if/else 28 (79 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorProjectColumnBulkMoveController.handleRequest (cognitive 83) · ×1
  • PhabricatorProjectColumnBulkMoveController.handleRequest (cognitive 83) src/applications/project/controller/PhabricatorProjectColumnBulkMoveController.php:6 — PhabricatorProjectColumnBulkMoveController.handleRequest has cognitive complexity 83 (threshold 15). Drivers by points: if/else 37 (75 pts), loops 4 (8 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementReparseWorkflow.execute (cognitive 82) · ×1
  • PhabricatorRepositoryManagementReparseWorkflow.execute (cognitive 82) src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php:81 — PhabricatorRepositoryManagementReparseWorkflow.execute has cognitive complexity 82 (threshold 15). Drivers by points: if/else 33 (68 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (3 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · PhutilRemarkupListBlockRule.renderTree (cognitive 81) · ×1
  • PhutilRemarkupListBlockRule.renderTree (cognitive 81) src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php:428 — PhutilRemarkupListBlockRule.renderTree has cognitive complexity 81 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 4 (12 pts), match/switch 3 (9 pts), ternaries 1 (5 pts), boolean chains 1 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorFactObjectController.handleRequest (cognitive 80) · ×1
  • PhabricatorFactObjectController.handleRequest (cognitive 80) src/applications/fact/controller/PhabricatorFactObjectController.php:6 — PhabricatorFactObjectController.handleRequest has cognitive complexity 80 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 19 (39 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.
D2 · Cognitive Complexity · repository-crossreference.JX.behavior("repository-crossreference") (cognitive 80) · ×1
  • repository-crossreference.JX.behavior("repository-crossreference") (cognitive 80) webroot/rsrc/js/application/repository/repository-crossreference.js:9 — repository-crossreference.JX.behavior("repository-crossreference") has cognitive complexity 80 (threshold 15). Drivers by points: if/else 42 (55 pts), boolean chains 14, loops 6 (8 pts), error handling 3 (nesting depth added 15). Most of this is not in the body itself: 2 of the 80 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 325, openSearch, a function literal at line 58, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PhabricatorTypeaheadModularDatasourceController.handleRequest (cognitive 77) · ×1
  • PhabricatorTypeaheadModularDatasourceController.handleRequest (cognitive 77) src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php:10 — PhabricatorTypeaheadModularDatasourceController.handleRequest has cognitive complexity 77 (threshold 15). Drivers by points: if/else 26 (62 pts), loops 3 (5 pts), ternaries 1 (4 pts), error handling 1 (3 pts), match/switch 1 (3 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConpherenceThreadSearchEngine.loadContextMessages (cognitive 76) · ×1
  • ConpherenceThreadSearchEngine.loadContextMessages (cognitive 76) src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:233 — ConpherenceThreadSearchEngine.loadContextMessages has cognitive complexity 76 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 19 (34 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionServeController.serveRequest (cognitive 76) · ×1
  • DiffusionServeController.serveRequest (cognitive 76) src/applications/diffusion/controller/DiffusionServeController.php:176 — DiffusionServeController.serveRequest has cognitive complexity 76 (threshold 15). Drivers by points: if/else 33 (58 pts), boolean chains 7, error handling 3 (7 pts), match/switch 2 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryBasicsManagementPanel.buildRepositoryStatus (cognitive 76) · ×1
  • DiffusionRepositoryBasicsManagementPanel.buildRepositoryStatus (cognitive 76) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:336 — DiffusionRepositoryBasicsManagementPanel.buildRepositoryStatus has cognitive complexity 76 (threshold 15). Drivers by points: if/else 31 (56 pts), match/switch 5 (13 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSQLPatchList.buildAllPatches (cognitive 74) · ×1
  • PhabricatorSQLPatchList.buildAllPatches (cognitive 74) src/infrastructure/storage/patch/PhabricatorSQLPatchList.php:49 — PhabricatorSQLPatchList.buildAllPatches has cognitive complexity 74 (threshold 15). Drivers by points: if/else 19 (57 pts), loops 7 (13 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthSessionEngine.newHighSecurityToken (cognitive 71) · ×1
  • PhabricatorAuthSessionEngine.newHighSecurityToken (cognitive 71) src/applications/auth/engine/PhabricatorAuthSessionEngine.php:446 — PhabricatorAuthSessionEngine.newHighSecurityToken has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (55 pts), loops 7 (15 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · PhabricatorProfileMenuEngine.buildResponse (cognitive 71) · ×1
  • PhabricatorProfileMenuEngine.buildResponse (cognitive 71) src/applications/search/engine/PhabricatorProfileMenuEngine.php:102 — PhabricatorProfileMenuEngine.buildResponse has cognitive complexity 71 (threshold 15). Drivers by points: if/else 34 (58 pts), match/switch 3 (6 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildFerretWhereClause (cognitive 71) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildFerretWhereClause (cognitive 71) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2208 — PhabricatorCursorPagedPolicyAwareQuery.buildFerretWhereClause has cognitive complexity 71 (threshold 15). Drivers by points: if/else 36 (68 pts), boolean chains 2, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMetaMTAMailViewController.buildDeliveryProperties (cognitive 69) · ×1
  • PhabricatorMetaMTAMailViewController.buildDeliveryProperties (cognitive 69) src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php:216 — PhabricatorMetaMTAMailViewController.buildDeliveryProperties has cognitive complexity 69 (threshold 15). Drivers by points: if/else 28 (54 pts), loops 4 (12 pts), match/switch 1 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMailManagementShowOutboundWorkflow.execute (cognitive 68) · ×1
  • PhabricatorMailManagementShowOutboundWorkflow.execute (cognitive 68) src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php:29 — PhabricatorMailManagementShowOutboundWorkflow.execute has cognitive complexity 68 (threshold 15). Drivers by points: if/else 25 (50 pts), loops 8 (18 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConduitAPIController.authenticateUser (cognitive 67) · ×1
  • PhabricatorConduitAPIController.authenticateUser (cognitive 67) src/applications/conduit/controller/PhabricatorConduitAPIController.php:167 — PhabricatorConduitAPIController.authenticateUser has cognitive complexity 67 (threshold 15). Drivers by points: if/else 35 (64 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · PhabricatorConfigClusterRepositoriesController.buildClusterRepositoryStatus (cognitive 67) · ×1
  • PhabricatorConfigClusterRepositoriesController.buildClusterRepositoryStatus (cognitive 67) src/applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php:46 — PhabricatorConfigClusterRepositoriesController.buildClusterRepositoryStatus has cognitive complexity 67 (threshold 15). Drivers by points: if/else 23 (55 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorOwnersPackage.findLongestPathsPerPackage (cognitive 67) · ×1
  • PhabricatorOwnersPackage.findLongestPathsPerPackage (cognitive 67) src/applications/owners/storage/PhabricatorOwnersPackage.php:378 — PhabricatorOwnersPackage.findLongestPathsPerPackage has cognitive complexity 67 (threshold 15). Drivers by points: if/else 12 (38 pts), loops 12 (29 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.
D2 · Cognitive Complexity · PhabricatorMentionRemarkupRule.didMarkupText (cognitive 67) · ×1
  • PhabricatorMentionRemarkupRule.didMarkupText (cognitive 67) src/applications/people/markup/PhabricatorMentionRemarkupRule.php:57 — PhabricatorMentionRemarkupRule.didMarkupText has cognitive complexity 67 (threshold 15). Drivers by points: if/else 21 (57 pts), loops 5 (10 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.
D2 · Cognitive Complexity · PhabricatorBoardLayoutEngine.layoutBoard (cognitive 67) · ×1
  • PhabricatorBoardLayoutEngine.layoutBoard (cognitive 67) src/applications/project/engine/PhabricatorBoardLayoutEngine.php:422 — PhabricatorBoardLayoutEngine.layoutBoard has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 13 (29 pts), boolean chains 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialReviewersView.render (cognitive 66) · ×1
  • DifferentialReviewersView.render (cognitive 66) src/applications/differential/view/DifferentialReviewersView.php:26 — DifferentialReviewersView.render has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (59 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionBrowseQueryConduitAPIMethod.getGitResult (cognitive 66) · ×1
  • DiffusionBrowseQueryConduitAPIMethod.getGitResult (cognitive 66) src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:35 — DiffusionBrowseQueryConduitAPIMethod.getGitResult has cognitive complexity 66 (threshold 15). Drivers by points: if/else 28 (53 pts), loops 3 (7 pts), boolean chains 3, error handling 1 (2 pts), ternaries 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.
D2 · Cognitive Complexity · PhabricatorRepositoryPullLocalDaemon.run (cognitive 66) · ×1
  • PhabricatorRepositoryPullLocalDaemon.run (cognitive 66) src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:38 — PhabricatorRepositoryPullLocalDaemon.run has cognitive complexity 66 (threshold 15). Drivers by points: if/else 14 (45 pts), loops 8 (20 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementThawWorkflow.execute (cognitive 66) · ×1
  • PhabricatorRepositoryManagementThawWorkflow.execute (cognitive 66) src/applications/repository/management/PhabricatorRepositoryManagementThawWorkflow.php:49 — PhabricatorRepositoryManagementThawWorkflow.execute has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (50 pts), loops 4 (8 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngineConfigurationQuery.loadPage (cognitive 66) · ×1
  • PhabricatorEditEngineConfigurationQuery.loadPage (cognitive 66) src/applications/transactions/query/PhabricatorEditEngineConfigurationQuery.php:71 — PhabricatorEditEngineConfigurationQuery.loadPage has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (44 pts), loops 13 (22 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDatabaseRefParser.newRefs (cognitive 66) · ×1
  • PhabricatorDatabaseRefParser.newRefs (cognitive 66) src/infrastructure/cluster/PhabricatorDatabaseRefParser.php:37 — PhabricatorDatabaseRefParser.newRefs has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (56 pts), loops 6 (10 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIDiffInlineCommentDetailView.render (cognitive 66) · ×1
  • PHUIDiffInlineCommentDetailView.render (cognitive 66) src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php:78 — PHUIDiffInlineCommentDetailView.render has cognitive complexity 66 (threshold 15). Drivers by points: if/else 37 (50 pts), boolean chains 9, ternaries 1 (3 pts), loops 1 (2 pts), match/switch 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.
D2 · Cognitive Complexity · PhabricatorPolicyAwareQuery.execute (cognitive 66) · ×1
  • PhabricatorPolicyAwareQuery.execute (cognitive 66) src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:204 — PhabricatorPolicyAwareQuery.execute has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (52 pts), loops 4 (8 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorController.willBeginExecution (cognitive 65) · ×1
  • PhabricatorController.willBeginExecution (cognitive 65) src/applications/base/controller/PhabricatorController.php:64 — PhabricatorController.willBeginExecution has cognitive complexity 65 (threshold 15). Drivers by points: if/else 29 (56 pts), boolean chains 8, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarEventQuery.willFilterPage (cognitive 65) · ×1
  • PhabricatorCalendarEventQuery.willFilterPage (cognitive 65) src/applications/calendar/query/PhabricatorCalendarEventQuery.php:515 — PhabricatorCalendarEventQuery.willFilterPage has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 13 (32 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerAtomQuery.willFilterPage (cognitive 65) · ×1
  • DivinerAtomQuery.willFilterPage (cognitive 65) src/applications/diviner/query/DivinerAtomQuery.php:139 — DivinerAtomQuery.willFilterPage has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (46 pts), loops 8 (19 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIObjectItemView.getTagContent (cognitive 65) · ×1
  • PHUIObjectItemView.getTagContent (cognitive 65) src/view/phui/PHUIObjectItemView.php:383 — PHUIObjectItemView.getTagContent has cognitive complexity 65 (threshold 15). Drivers by points: if/else 34 (41 pts), loops 6 (12 pts), ternaries 3 (7 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DivinerAtomController.handleRequest (cognitive 64) · ×1
  • DivinerAtomController.handleRequest (cognitive 64) src/applications/diviner/controller/DivinerAtomController.php:9 — DivinerAtomController.handleRequest has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 8 (21 pts), ternaries 3 (7 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorPeopleNewController.handleRequest (cognitive 64) · ×1
  • PhabricatorPeopleNewController.handleRequest (cognitive 64) src/applications/people/controller/PhabricatorPeopleNewController.php:6 — PhabricatorPeopleNewController.handleRequest has cognitive complexity 64 (threshold 15). Drivers by points: if/else 27 (56 pts), boolean chains 3, error handling 1 (3 pts), match/switch 1, 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.
D2 · Cognitive Complexity · PhabricatorProjectBoardViewController.handleRequest (cognitive 64) · ×1
  • PhabricatorProjectBoardViewController.handleRequest (cognitive 64) src/applications/project/controller/PhabricatorProjectBoardViewController.php:10 — PhabricatorProjectBoardViewController.handleRequest has cognitive complexity 64 (threshold 15). Drivers by points: if/else 26 (48 pts), loops 8 (14 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultimeterSampleController.handleRequest (cognitive 63) · ×1
  • MultimeterSampleController.handleRequest (cognitive 63) src/applications/multimeter/controller/MultimeterSampleController.php:9 — MultimeterSampleController.handleRequest has cognitive complexity 63 (threshold 15). Drivers by points: if/else 28 (57 pts), loops 4, ternaries 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhrequentTimeBlock.getObjectTimeRanges (cognitive 63) · ×1
  • PhrequentTimeBlock.getObjectTimeRanges (cognitive 63) src/applications/phrequent/storage/PhrequentTimeBlock.php:22 — PhrequentTimeBlock.getObjectTimeRanges has cognitive complexity 63 (threshold 15). Drivers by points: if/else 12 (38 pts), loops 9 (16 pts), ternaries 2 (6 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · PholioMockEditController.handleRequest (cognitive 62) · ×1
  • PholioMockEditController.handleRequest (cognitive 62) src/applications/pholio/controller/PholioMockEditController.php:5 — PholioMockEditController.handleRequest has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (44 pts), ternaries 3 (10 pts), loops 4 (7 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.
D2 · Cognitive Complexity · HarbormasterBuildEngine.updateBuildSteps (cognitive 61) · ×1
  • HarbormasterBuildEngine.updateBuildSteps (cognitive 61) src/applications/harbormaster/engine/HarbormasterBuildEngine.php:165 — HarbormasterBuildEngine.updateBuildSteps has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (41 pts), loops 8 (18 pts), boolean chains 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialHunkParser.parseHunksForHighlightMasks (cognitive 60) · ×1
  • DifferentialHunkParser.parseHunksForHighlightMasks (cognitive 60) src/applications/differential/parser/DifferentialHunkParser.php:566 — DifferentialHunkParser.parseHunksForHighlightMasks has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (47 pts), boolean chains 9, loops 3 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevision.newReviewerForceAcceptMap (cognitive 60) · ×1
  • DifferentialRevision.newReviewerForceAcceptMap (cognitive 60) src/applications/differential/storage/DifferentialRevision.php:253 — DifferentialRevision.newReviewerForceAcceptMap has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 11 (18 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · PassphraseCredentialEditController.handleRequest (cognitive 60) · ×1
  • PassphraseCredentialEditController.handleRequest (cognitive 60) src/applications/passphrase/controller/PassphraseCredentialEditController.php:5 — PassphraseCredentialEditController.handleRequest has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (49 pts), error handling 3 (8 pts), boolean chains 2, ternaries 1 (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.
D2 · Cognitive Complexity · PhrictionRemarkupRule.didMarkupText (cognitive 60) · ×1
  • PhrictionRemarkupRule.didMarkupText (cognitive 60) src/applications/phriction/markup/PhrictionRemarkupRule.php:86 — PhrictionRemarkupRule.didMarkupText has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (46 pts), loops 8 (13 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-fancy-datepicker.JX.behavior("fancy-datepicker") (cognitive 59) · ×1
  • behavior-fancy-datepicker.JX.behavior("fancy-datepicker") (cognitive 59) webroot/rsrc/js/core/behavior-fancy-datepicker.js:10 — behavior-fancy-datepicker.JX.behavior("fancy-datepicker") has cognitive complexity 59 (threshold 15). Drivers by points: if/else 30 (38 pts), boolean chains 8, loops 7, match/switch 4 (6 pts) (nesting depth added 10). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 14 function items inside it that branch (render_day, write_date, getValidDate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-dark-console.JX.behavior("dark-console") (cognitive 59) · ×1
  • behavior-dark-console.JX.behavior("dark-console") (cognitive 59) webroot/rsrc/js/core/darkconsole/behavior-dark-console.js:13 — behavior-dark-console.JX.behavior("dark-console") has cognitive complexity 59 (threshold 15). Drivers by points: if/else 33 (47 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts), match/switch 1 (2 pts), ternaries 1 (nesting depth added 17). Most of this is not in the body itself: 9 of the 59 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 355, render_request, a function literal at line 263, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PhabricatorAuthEditController.handleRequest (cognitive 58) · ×1
  • PhabricatorAuthEditController.handleRequest (cognitive 58) src/applications/auth/controller/config/PhabricatorAuthEditController.php:6 — PhabricatorAuthEditController.handleRequest has cognitive complexity 58 (threshold 15). Drivers by points: if/else 28 (49 pts), loops 2 (5 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetTwoUpRenderer.renderDocumentEngineBlocks (cognitive 58) · ×1
  • DifferentialChangesetTwoUpRenderer.renderDocumentEngineBlocks (cognitive 58) src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:368 — DifferentialChangesetTwoUpRenderer.renderDocumentEngineBlocks has cognitive complexity 58 (threshold 15). Drivers by points: if/else 27 (50 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryStorageManagementPanel.buildClusterStatusPanel (cognitive 58) · ×1
  • DiffusionRepositoryStorageManagementPanel.buildClusterStatusPanel (cognitive 58) src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php:79 — DiffusionRepositoryStorageManagementPanel.buildClusterStatusPanel has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (48 pts), error handling 1 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorSearchManagementIndexWorkflow.execute (cognitive 58) · ×1
  • PhabricatorSearchManagementIndexWorkflow.execute (cognitive 58) src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:74 — PhabricatorSearchManagementIndexWorkflow.execute has cognitive complexity 58 (threshold 15). Drivers by points: if/else 26 (38 pts), boolean chains 11, loops 4 (7 pts), error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthManagementStripWorkflow.execute (cognitive 57) · ×1
  • PhabricatorAuthManagementStripWorkflow.execute (cognitive 57) src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:54 — PhabricatorAuthManagementStripWorkflow.execute has cognitive complexity 57 (threshold 15). Drivers by points: if/else 25 (41 pts), loops 5 (10 pts), boolean chains 6 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryQuery.willFilterPage (cognitive 57) · ×1
  • PhabricatorRepositoryQuery.willFilterPage (cognitive 57) src/applications/repository/query/PhabricatorRepositoryQuery.php:236 — PhabricatorRepositoryQuery.willFilterPage has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 9 (18 pts), match/switch 2 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPeopleInviteSendController.handleRequest (cognitive 56) · ×1
  • PhabricatorPeopleInviteSendController.handleRequest (cognitive 56) src/applications/people/controller/PhabricatorPeopleInviteSendController.php:6 — PhabricatorPeopleInviteSendController.handleRequest has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (44 pts), loops 3 (9 pts), ternaries 2, boolean chains 1 (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.
D2 · Cognitive Complexity · AphrontMultipartParser.continueParse (cognitive 55) · ×1
  • AphrontMultipartParser.continueParse (cognitive 55) src/aphront/multipartparser/AphrontMultipartParser.php:62 — AphrontMultipartParser.continueParse has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (52 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationQuery.loadPage (cognitive 55) · ×1
  • PhabricatorApplicationQuery.loadPage (cognitive 55) src/applications/meta/query/PhabricatorApplicationQuery.php:71 — PhabricatorApplicationQuery.loadPage has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 9 (18 pts), match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorWorkerManagementWorkflow.loadTasks (cognitive 55) · ×1
  • PhabricatorWorkerManagementWorkflow.loadTasks (cognitive 55) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php:69 — PhabricatorWorkerManagementWorkflow.loadTasks has cognitive complexity 55 (threshold 15). Drivers by points: if/else 34 (45 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PHUIDiffTableOfContentsListView.render (cognitive 55) · ×1
  • PHUIDiffTableOfContentsListView.render (cognitive 55) src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php:53 — PHUIDiffTableOfContentsListView.render has cognitive complexity 55 (threshold 15). Drivers by points: if/else 29 (51 pts), loops 4 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuildViewController.handleRequest (cognitive 54) · ×1
  • HarbormasterBuildViewController.handleRequest (cognitive 54) src/applications/harbormaster/controller/HarbormasterBuildViewController.php:10 — HarbormasterBuildViewController.handleRequest has cognitive complexity 54 (threshold 15). Drivers by points: if/else 28 (48 pts), loops 3 (5 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.
D2 · Cognitive Complexity · LegalpadDocumentSignController.handleRequest (cognitive 54) · ×1
  • LegalpadDocumentSignController.handleRequest (cognitive 54) src/applications/legalpad/controller/LegalpadDocumentSignController.php:24 — LegalpadDocumentSignController.handleRequest has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 4, match/switch 2 (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.
D2 · Cognitive Complexity · ManiphestReportController.renderOpenTasks (cognitive 54) · ×1
  • ManiphestReportController.renderOpenTasks (cognitive 54) src/applications/maniphest/controller/ManiphestReportController.php:487 — ManiphestReportController.renderOpenTasks has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 9 (19 pts), match/switch 3 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTransactionEditor.buildMoveTransaction (cognitive 54) · ×1
  • ManiphestTransactionEditor.buildMoveTransaction (cognitive 54) src/applications/maniphest/editor/ManiphestTransactionEditor.php:438 — ManiphestTransactionEditor.buildMoveTransaction has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (42 pts), loops 7 (10 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorObjectListQuery.execute (cognitive 54) · ×1
  • PhabricatorObjectListQuery.execute (cognitive 54) src/applications/phid/query/PhabricatorObjectListQuery.php:56 — PhabricatorObjectListQuery.execute has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 11 (21 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngine.buildCommentResponse (cognitive 54) · ×1
  • PhabricatorEditEngine.buildCommentResponse (cognitive 54) src/applications/transactions/editengine/PhabricatorEditEngine.php:1875 — PhabricatorEditEngine.buildCommentResponse has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (38 pts), loops 4 (8 pts), error handling 4 (5 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceSet.getEventsBetween (cognitive 53) · ×1
  • PhutilCalendarRecurrenceSet.getEventsBetween (cognitive 53) src/applications/calendar/parser/data/PhutilCalendarRecurrenceSet.php:23 — PhutilCalendarRecurrenceSet.getEventsBetween has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 5 (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.
D2 · Cognitive Complexity · DifferentialRevisionReviewersTransaction.renderReviewerEditTitle (cognitive 53) · ×1
  • DifferentialRevisionReviewersTransaction.renderReviewerEditTitle (cognitive 53) src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:165 — DifferentialRevisionReviewersTransaction.renderReviewerEditTitle has cognitive complexity 53 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 4, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProfileMenuEngine.buildItemConfigureContent (cognitive 53) · ×1
  • PhabricatorProfileMenuEngine.buildItemConfigureContent (cognitive 53) src/applications/search/engine/PhabricatorProfileMenuEngine.php:683 — PhabricatorProfileMenuEngine.buildItemConfigureContent has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (49 pts), loops 3, boolean chains 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionView.renderEvent (cognitive 53) · ×1
  • PhabricatorApplicationTransactionView.renderEvent (cognitive 53) src/applications/transactions/view/PhabricatorApplicationTransactionView.php:422 — PhabricatorApplicationTransactionView.renderEvent has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (44 pts), boolean chains 9 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PHUIHeaderView.getTagContent (cognitive 53) · ×1
  • PHUIHeaderView.getTagContent (cognitive 53) src/view/phui/PHUIHeaderView.php:190 — PHUIHeaderView.getTagContent has cognitive complexity 53 (threshold 15). Drivers by points: if/else 25 (40 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (3 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.
D2 · Cognitive Complexity · DifferentialChangesetViewController.handleRequest (cognitive 52) · ×1
  • DifferentialChangesetViewController.handleRequest (cognitive 52) src/applications/differential/controller/DifferentialChangesetViewController.php:9 — DifferentialChangesetViewController.handleRequest has cognitive complexity 52 (threshold 15). Drivers by points: if/else 33 (42 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorPolicyFilter.checkCapability (cognitive 52) · ×1
  • PhabricatorPolicyFilter.checkCapability (cognitive 52) src/applications/policy/filter/PhabricatorPolicyFilter.php:502 — PhabricatorPolicyFilter.checkCapability has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27 (50 pts), boolean chains 1, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateCard (cognitive 52) · ×1
  • updateCard (cognitive 52) webroot/rsrc/js/application/projects/WorkboardBoard.js:601 — updateCard has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 12 (18 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionGitUploadPackWireProtocol.willReadBytes (cognitive 51) · ×1
  • DiffusionGitUploadPackWireProtocol.willReadBytes (cognitive 51) src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php:16 — DiffusionGitUploadPackWireProtocol.willReadBytes has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 4 (6 pts), match/switch 2 (4 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · DiffusionCommitQuery.didFilterPage (cognitive 51) · ×1
  • DiffusionCommitQuery.didFilterPage (cognitive 51) src/applications/diffusion/query/DiffusionCommitQuery.php:361 — DiffusionCommitQuery.didFilterPage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 10 (24 pts), error handling 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIDiffTableOfContentsListView.newComponentView (cognitive 51) · ×1
  • PHUIDiffTableOfContentsListView.newComponentView (cognitive 51) src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php:387 — PHUIDiffTableOfContentsListView.newComponentView has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (45 pts), boolean chains 3, loops 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildSpacesWhereClause (cognitive 51) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildSpacesWhereClause (cognitive 51) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:3139 — PhabricatorCursorPagedPolicyAwareQuery.buildSpacesWhereClause has cognitive complexity 51 (threshold 15). Drivers by points: if/else 25 (43 pts), boolean chains 4, loops 2 (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.
D2 · Cognitive Complexity · behavior-menu.JX.behavior("conpherence-menu") (cognitive 51) · ×1
  • behavior-menu.JX.behavior("conpherence-menu") (cognitive 51) REDACTED:17 — behavior-menu.JX.behavior("conpherence-menu") has cognitive complexity 51 (threshold 15). Drivers by points: if/else 33 (40 pts), boolean chains 6, error handling 3 (5 pts) (nesting depth added 9). None of this is in the body itself: all 51 points belong to 15 function items inside it that branch (onDeviceChange, redrawThread, didLoadThreads, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 51) · ×1
  • (anonymous) (cognitive 51) REDACTED:17 — (anonymous) has cognitive complexity 51 (threshold 15). Drivers by points: if/else 33 (40 pts), boolean chains 6, error handling 3 (5 pts) (nesting depth added 9). None of this is in the body itself: all 51 points belong to 30 function items inside it that branch (onDeviceChange, redrawThread, didLoadThreads, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PhutilSpriteSheet.generate (cognitive 50) · ×1
  • PhutilSpriteSheet.generate (cognitive 50) src/aphront/sprite/PhutilSpriteSheet.php:57 — PhutilSpriteSheet.generate has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 11 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthManagementRevokeWorkflow.execute (cognitive 50) · ×1
  • PhabricatorAuthManagementRevokeWorkflow.execute (cognitive 50) src/applications/auth/management/PhabricatorAuthManagementRevokeWorkflow.php:50 — PhabricatorAuthManagementRevokeWorkflow.execute has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (41 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionBrowseQueryConduitAPIMethod.getSVNResult (cognitive 50) · ×1
  • DiffusionBrowseQueryConduitAPIMethod.getSVNResult (cognitive 50) src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:363 — DiffusionBrowseQueryConduitAPIMethod.getSVNResult has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (45 pts), loops 3, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortuneCartCancelController.handleCartRequest (cognitive 50) · ×1
  • PhortuneCartCancelController.handleCartRequest (cognitive 50) src/applications/phortune/controller/cart/PhortuneCartCancelController.php:14 — PhortuneCartCancelController.handleCartRequest has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (38 pts), error handling 3 (8 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilProseDifferenceEngine.buildDiff (cognitive 50) · ×1
  • PhutilProseDifferenceEngine.buildDiff (cognitive 50) src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php:9 — PhutilProseDifferenceEngine.buildDiff has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 3 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorCalendarNotificationEngine.sendNotifications (cognitive 49) · ×1
  • PhabricatorCalendarNotificationEngine.sendNotifications (cognitive 49) src/applications/calendar/notifications/PhabricatorCalendarNotificationEngine.php:73 — PhabricatorCalendarNotificationEngine.sendNotifications has cognitive complexity 49 (threshold 15). Drivers by points: loops 16 (26 pts), if/else 10 (20 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorConfigClusterDatabasesController.buildClusterDatabaseStatus (cognitive 49) · ×1
  • PhabricatorConfigClusterDatabasesController.buildClusterDatabaseStatus (cognitive 49) src/applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php:36 — PhabricatorConfigClusterDatabasesController.buildClusterDatabaseStatus has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (44 pts), match/switch 1 (4 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConpherenceThreadSearchEngine.renderResultList (cognitive 49) · ×1
  • ConpherenceThreadSearchEngine.renderResultList (cognitive 49) src/applications/conpherence/query/ConpherenceThreadSearchEngine.php:94 — ConpherenceThreadSearchEngine.renderResultList has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 6 (19 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetRenderer.processPrimitivesForOneUp (cognitive 49) · ×1
  • DifferentialChangesetRenderer.processPrimitivesForOneUp (cognitive 49) src/applications/differential/render/DifferentialChangesetRenderer.php:567 — DifferentialChangesetRenderer.processPrimitivesForOneUp has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (47 pts), boolean chains 1, loops 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.
D2 · Cognitive Complexity · PhabricatorSlowvoteEditController.handleRequest (cognitive 49) · ×1
  • PhabricatorSlowvoteEditController.handleRequest (cognitive 49) src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php:6 — PhabricatorSlowvoteEditController.handleRequest has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (40 pts), loops 3 (9 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.
D2 · Cognitive Complexity · PhabricatorEditEngine.buildResponse (cognitive 49) · ×1
  • PhabricatorEditEngine.buildResponse (cognitive 49) src/applications/transactions/editengine/PhabricatorEditEngine.php:882 — PhabricatorEditEngine.buildResponse has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (43 pts), boolean chains 4, match/switch 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuditTransaction.getTitle (cognitive 48) · ×1
  • PhabricatorAuditTransaction.getTitle (cognitive 48) src/applications/audit/storage/PhabricatorAuditTransaction.php:162 — PhabricatorAuditTransaction.getTitle has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (42 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorEmailLoginController.handleRequest (cognitive 48) · ×1
  • PhabricatorEmailLoginController.handleRequest (cognitive 48) src/applications/auth/controller/PhabricatorEmailLoginController.php:10 — PhabricatorEmailLoginController.handleRequest has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (43 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DarkConsoleServicesPlugin.generateData (cognitive 48) · ×1
  • DarkConsoleServicesPlugin.generateData (cognitive 48) src/applications/console/plugin/DarkConsoleServicesPlugin.php:47 — DarkConsoleServicesPlugin.generateData has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (36 pts), loops 2 (4 pts), match/switch 1 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoorkeeperAsanaFeedWorker.publishFeedStory (cognitive 48) · ×1
  • DoorkeeperAsanaFeedWorker.publishFeedStory (cognitive 48) src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php:27 — DoorkeeperAsanaFeedWorker.publishFeedStory has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (37 pts), loops 7 (8 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhrictionEditController.handleRequest (cognitive 48) · ×1
  • PhrictionEditController.handleRequest (cognitive 48) src/applications/phriction/controller/PhrictionEditController.php:6 — PhrictionEditController.handleRequest has cognitive complexity 48 (threshold 15). Drivers by points: if/else 28 (42 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetParser.replaceTabsWithSpaces (cognitive 47) · ×1
  • DifferentialChangesetParser.replaceTabsWithSpaces (cognitive 47) src/applications/differential/parser/DifferentialChangesetParser.php:1615 — DifferentialChangesetParser.replaceTabsWithSpaces has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 5 (10 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLowLevelResolveRefsQuery.resolveGitRefs (cognitive 47) · ×1
  • DiffusionLowLevelResolveRefsQuery.resolveGitRefs (cognitive 47) src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php:60 — DiffusionLowLevelResolveRefsQuery.resolveGitRefs has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 6 (10 pts), match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorChartRenderingEngine.newTabularView (cognitive 47) · ×1
  • PhabricatorChartRenderingEngine.newTabularView (cognitive 47) src/applications/fact/engine/PhabricatorChartRenderingEngine.php:112 — PhabricatorChartRenderingEngine.newTabularView has cognitive complexity 47 (threshold 15). Drivers by points: loops 13 (32 pts), if/else 5 (15 pts) (nesting depth added 29). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · HeraldNewController.handleRequest (cognitive 47) · ×1
  • HeraldNewController.handleRequest (cognitive 47) src/applications/herald/controller/HeraldNewController.php:5 — HeraldNewController.handleRequest has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (47 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorMetaMTAMail.loadActors (cognitive 47) · ×1
  • PhabricatorMetaMTAMail.loadActors (cognitive 47) src/applications/metamta/storage/PhabricatorMetaMTAMail.php:895 — PhabricatorMetaMTAMail.loadActors has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 10 (15 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · PhabricatorDifferenceEngine.applyIntralineDiff (cognitive 47) · ×1
  • PhabricatorDifferenceEngine.applyIntralineDiff (cognitive 47) src/infrastructure/diff/PhabricatorDifferenceEngine.php:172 — PhabricatorDifferenceEngine.applyIntralineDiff has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 7, loops 2 (4 pts), match/switch 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.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildFerretJoinClause (cognitive 47) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildFerretJoinClause (cognitive 47) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1995 — PhabricatorCursorPagedPolicyAwareQuery.buildFerretJoinClause has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarEventQuery.loadPage (cognitive 46) · ×1
  • PhabricatorCalendarEventQuery.loadPage (cognitive 46) src/applications/calendar/query/PhabricatorCalendarEventQuery.php:161 — PhabricatorCalendarEventQuery.loadPage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 8 (10 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldAdapter.doesConditionMatch (cognitive 46) · ×1
  • HeraldAdapter.doesConditionMatch (cognitive 46) src/applications/herald/adapter/HeraldAdapter.php:444 — HeraldAdapter.doesConditionMatch has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 3 (6 pts), error handling 2 (5 pts), match/switch 1 (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ManiphestReportController.renderBurn (cognitive 46) · ×1
  • ManiphestReportController.renderBurn (cognitive 46) src/applications/maniphest/controller/ManiphestReportController.php:74 — ManiphestReportController.renderBurn has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (35 pts), loops 4, boolean chains 3, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPeopleQuery.rebuildAvailabilityCache (cognitive 46) · ×1
  • PhabricatorPeopleQuery.rebuildAvailabilityCache (cognitive 46) src/applications/people/query/PhabricatorPeopleQuery.php:385 — PhabricatorPeopleQuery.rebuildAvailabilityCache has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 7 (16 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · PhabricatorBoardLayoutEngine.queueAddPosition (cognitive 46) · ×1
  • PhabricatorBoardLayoutEngine.queueAddPosition (cognitive 46) src/applications/project/engine/PhabricatorBoardLayoutEngine.php:138 — PhabricatorBoardLayoutEngine.queueAddPosition has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (37 pts), loops 4 (9 pts) (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.
D2 · Cognitive Complexity · PhabricatorDiffInlineCommentQuery.willFilterPage (cognitive 46) · ×1
  • PhabricatorDiffInlineCommentQuery.willFilterPage (cognitive 46) src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php:144 — PhabricatorDiffInlineCommentQuery.willFilterPage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _update (cognitive 46) · ×1
  • _update (cognitive 46) webroot/rsrc/js/phuix/PHUIXAutocomplete.js:428 — _update has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 5, ternaries 1 (3 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPeopleProfilePictureController.handleRequest (cognitive 45) · ×1
  • PhabricatorPeopleProfilePictureController.handleRequest (cognitive 45) src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:6 — PhabricatorPeopleProfilePictureController.handleRequest has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (41 pts), loops 3, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyFilter.apply (cognitive 45) · ×1
  • PhabricatorPolicyFilter.apply (cognitive 45) src/applications/policy/filter/PhabricatorPolicyFilter.php:156 — PhabricatorPolicyFilter.apply has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 7 (11 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilRemarkupListBlockRule.markupText (cognitive 45) · ×1
  • PhutilRemarkupListBlockRule.markupText (cognitive 45) src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php:88 — PhutilRemarkupListBlockRule.markupText has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 4 (5 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.
D2 · Cognitive Complexity · PhutilICSParser.parseICSProperty (cognitive 44) · ×1
  • PhutilICSParser.parseICSProperty (cognitive 44) src/applications/calendar/parser/ics/PhutilICSParser.php:191 — PhutilICSParser.parseICSProperty has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (37 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConpherenceUpdateController.handleRequest (cognitive 44) · ×1
  • ConpherenceUpdateController.handleRequest (cognitive 44) src/applications/conpherence/controller/ConpherenceUpdateController.php:6 — ConpherenceUpdateController.handleRequest has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (31 pts), match/switch 4 (7 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionServeController.isVCSRequest (cognitive 44) · ×1
  • DiffusionServeController.isVCSRequest (cognitive 44) src/applications/diffusion/controller/DiffusionServeController.php:40 — DiffusionServeController.isVCSRequest has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (44 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ManiphestTaskDetailController.newChangesView (cognitive 44) · ×1
  • ManiphestTaskDetailController.newChangesView (cognitive 44) src/applications/maniphest/controller/ManiphestTaskDetailController.php:545 — ManiphestTaskDetailController.newChangesView has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 5 (7 pts), ternaries 2 (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.
D2 · Cognitive Complexity · PhrictionDocumentQuery.buildWhereClauseParts (cognitive 44) · ×1
  • PhrictionDocumentQuery.buildWhereClauseParts (cognitive 44) src/applications/phriction/query/PhrictionDocumentQuery.php:199 — PhrictionDocumentQuery.buildWhereClauseParts has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorBulkManagementExportWorkflow.newQueries (cognitive 44) · ×1
  • PhabricatorBulkManagementExportWorkflow.newQueries (cognitive 44) src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php:152 — PhabricatorBulkManagementExportWorkflow.newQueries has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 5 (8 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-aphlict-dropdown.JX.behavior("aphlict-dropdown") (cognitive 44) · ×1
  • behavior-aphlict-dropdown.JX.behavior("aphlict-dropdown") (cognitive 44) webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js:14 — behavior-aphlict-dropdown.JX.behavior("aphlict-dropdown") has cognitive complexity 44 (threshold 15). Drivers by points: if/else 32 (39 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 4 of the 44 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 178, set_visible, update_counts, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · _onjumpkey (cognitive 44) · ×1
  • _onjumpkey (cognitive 44) webroot/rsrc/js/application/diff/DiffChangesetList.js:650 — _onjumpkey has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 7, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _getInlinesByType (cognitive 44) · ×1
  • _getInlinesByType (cognitive 44) webroot/rsrc/js/application/diff/DiffChangesetList.js:1968 — _getInlinesByType has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 3 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 44) · ×1
  • (anonymous) (cognitive 44) webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js:14 — (anonymous) has cognitive complexity 44 (threshold 15). Drivers by points: if/else 32 (39 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 4 of the 44 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 178, set_visible, update_counts, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PhabricatorConfigConsoleController.loadVersions (cognitive 43) · ×1
  • PhabricatorConfigConsoleController.loadVersions (cognitive 43) src/applications/config/controller/PhabricatorConfigConsoleController.php:139 — PhabricatorConfigConsoleController.loadVersions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (38 pts), loops 4 (5 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HeraldRuleQuery.willFilterPage (cognitive 43) · ×1
  • HeraldRuleQuery.willFilterPage (cognitive 43) src/applications/herald/query/HeraldRuleQuery.php:89 — HeraldRuleQuery.willFilterPage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 8 (14 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransaction.shouldHide (cognitive 43) · ×1
  • PhabricatorApplicationTransaction.shouldHide (cognitive 43) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:588 — PhabricatorApplicationTransaction.shouldHide has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (35 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildPagingClauseFromMultipleColumns (cognitive 43) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildPagingClauseFromMultipleColumns (cognitive 43) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:727 — PhabricatorCursorPagedPolicyAwareQuery.buildPagingClauseFromMultipleColumns has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (33 pts), match/switch 1 (3 pts), ternaries 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUITimelineEventView.render (cognitive 43) · ×1
  • PHUITimelineEventView.render (cognitive 43) src/view/phui/PHUITimelineEventView.php:318 — PHUITimelineEventView.render has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (26 pts), loops 6 (9 pts), ternaries 3 (5 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.
D2 · Cognitive Complexity · PhabricatorExtraConfigSetupCheck.executeChecks (cognitive 42) · ×1
  • PhabricatorExtraConfigSetupCheck.executeChecks (cognitive 42) src/applications/config/check/PhabricatorExtraConfigSetupCheck.php:9 — PhabricatorExtraConfigSetupCheck.executeChecks has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 4 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPathSetupCheck.executeChecks (cognitive 42) · ×1
  • PhabricatorPathSetupCheck.executeChecks (cognitive 42) src/applications/config/check/PhabricatorPathSetupCheck.php:9 — PhabricatorPathSetupCheck.executeChecks has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HarbormasterBuildUnitMessage.newUnitMessageDetailsView (cognitive 42) · ×1
  • HarbormasterBuildUnitMessage.newUnitMessageDetailsView (cognitive 42) src/applications/harbormaster/storage/build/HarbormasterBuildUnitMessage.php:174 — HarbormasterBuildUnitMessage.newUnitMessageDetailsView has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (41 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.
D2 · Cognitive Complexity · PhabricatorMetaMTAReceivedMail.processReceivedMail (cognitive 42) · ×1
  • PhabricatorMetaMTAReceivedMail.processReceivedMail (cognitive 42) src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php:146 — PhabricatorMetaMTAReceivedMail.processReceivedMail has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (7 pts), error handling 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PassphraseQueryConduitAPIMethod.execute (cognitive 42) · ×1
  • PassphraseQueryConduitAPIMethod.execute (cognitive 42) src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php:31 — PassphraseQueryConduitAPIMethod.execute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyFilter.applyExtendedPolicyChecks (cognitive 42) · ×1
  • PhabricatorPolicyFilter.applyExtendedPolicyChecks (cognitive 42) src/applications/policy/filter/PhabricatorPolicyFilter.php:302 — PhabricatorPolicyFilter.applyExtendedPolicyChecks has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 8 (15 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectIconSet.validateConfiguration (cognitive 42) · ×1
  • PhabricatorProjectIconSet.validateConfiguration (cognitive 42) src/applications/project/icon/PhabricatorProjectIconSet.php:195 — PhabricatorProjectIconSet.validateConfiguration has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransactionSearchConduitAPIMethod.execute (cognitive 42) · ×1
  • TransactionSearchConduitAPIMethod.execute (cognitive 42) src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php:102 — TransactionSearchConduitAPIMethod.execute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 3 (9 pts), loops 4 (6 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · PhabricatorInternationalizationManagementExtractWorkflow.extractFiles (cognitive 42) · ×1
  • PhabricatorInternationalizationManagementExtractWorkflow.extractFiles (cognitive 42) src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php:127 — PhabricatorInternationalizationManagementExtractWorkflow.extractFiles has cognitive complexity 42 (threshold 15). Drivers by points: match/switch 3 (16 pts), if/else 3 (13 pts), loops 5 (8 pts), error handling 2 (5 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.
D2 · Cognitive Complexity · PhabricatorAphlictManagementWorkflow.parseLaunchArguments (cognitive 41) · ×1
  • PhabricatorAphlictManagementWorkflow.parseLaunchArguments (cognitive 41) src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:27 — PhabricatorAphlictManagementWorkflow.parseLaunchArguments has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (21 pts), error handling 5 (6 pts), boolean chains 5, loops 4 (5 pts), match/switch 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarEventCancelController.handleRequest (cognitive 41) · ×1
  • PhabricatorCalendarEventCancelController.handleRequest (cognitive 41) src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php:6 — PhabricatorCalendarEventCancelController.handleRequest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 2 (6 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialHunkParser.generateIntraLineDiffs (cognitive 41) · ×1
  • DifferentialHunkParser.generateIntraLineDiffs (cognitive 41) src/applications/differential/parser/DifferentialHunkParser.php:270 — DifferentialHunkParser.generateIntraLineDiffs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DifferentialChangesetRenderer.buildPrimitives (cognitive 41) · ×1
  • DifferentialChangesetRenderer.buildPrimitives (cognitive 41) src/applications/differential/render/DifferentialChangesetRenderer.php:453 — DifferentialChangesetRenderer.buildPrimitives has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitQuery.willFilterPage (cognitive 41) · ×1
  • DiffusionCommitQuery.willFilterPage (cognitive 41) src/applications/diffusion/query/DiffusionCommitQuery.php:293 — DiffusionCommitQuery.willFilterPage has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5 (16 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorChartStackedAreaDataset.newChartDisplayData (cognitive 41) · ×1
  • PhabricatorChartStackedAreaDataset.newChartDisplayData (cognitive 41) src/applications/fact/chart/PhabricatorChartStackedAreaDataset.php:19 — PhabricatorChartStackedAreaDataset.newChartDisplayData has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 9 (15 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFeedTransactionQuery.loadPage (cognitive 41) · ×1
  • PhabricatorFeedTransactionQuery.loadPage (cognitive 41) src/applications/feed/query/PhabricatorFeedTransactionQuery.php:41 — PhabricatorFeedTransactionQuery.loadPage has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorMetaMTAMail.newMailers (cognitive 41) · ×1
  • PhabricatorMetaMTAMail.newMailers (cognitive 41) src/applications/metamta/storage/PhabricatorMetaMTAMail.php:558 — PhabricatorMetaMTAMail.newMailers has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 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.
D2 · Cognitive Complexity · PhortuneMerchantProviderEditController.handleMerchantRequest (cognitive 41) · ×1
  • PhortuneMerchantProviderEditController.handleMerchantRequest (cognitive 41) src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:10 — PhortuneMerchantProviderEditController.handleMerchantRequest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 2 (7 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyEditController.handleRequest (cognitive 41) · ×1
  • PhabricatorPolicyEditController.handleRequest (cognitive 41) src/applications/policy/controller/PhabricatorPolicyEditController.php:6 — PhabricatorPolicyEditController.handleRequest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 4 (6 pts), match/switch 2 (4 pts), error handling 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.
D2 · Cognitive Complexity · PhabricatorProjectDatasource.loadResults (cognitive 41) · ×1
  • PhabricatorProjectDatasource.loadResults (cognitive 41) src/applications/project/typeahead/PhabricatorProjectDatasource.php:18 — PhabricatorProjectDatasource.loadResults has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryGraphCache.loadLastModifiedCommitID (cognitive 41) · ×1
  • PhabricatorRepositoryGraphCache.loadLastModifiedCommitID (cognitive 41) src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php:75 — PhabricatorRepositoryGraphCache.loadLastModifiedCommitID has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryQuery.buildWhereClauseParts (cognitive 41) · ×1
  • PhabricatorRepositoryQuery.buildWhereClauseParts (cognitive 41) src/applications/repository/query/PhabricatorRepositoryQuery.php:533 — PhabricatorRepositoryQuery.buildWhereClauseParts has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-comment-actions.JX.behavior("comment-actions") (cognitive 41) · ×1
  • behavior-comment-actions.JX.behavior("comment-actions") (cognitive 41) webroot/rsrc/js/application/transactions/behavior-comment-actions.js:12 — behavior-comment-actions.JX.behavior("comment-actions") has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 13). Most of this is not in the body itself: 2 of the 41 points are its own statements and the rest belongs to 11 function items inside it that branch (add_row, ondevicechange, find_option, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 41) · ×1
  • (anonymous) (cognitive 41) webroot/rsrc/js/application/transactions/behavior-comment-actions.js:12 — (anonymous) has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 13). Most of this is not in the body itself: 2 of the 41 points are its own statements and the rest belongs to 15 function items inside it that branch (add_row, ondevicechange, find_option, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PhabricatorAuthStartController.handleRequest (cognitive 40) · ×1
  • PhabricatorAuthStartController.handleRequest (cognitive 40) src/applications/auth/controller/PhabricatorAuthStartController.php:10 — PhabricatorAuthStartController.handleRequest has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (30 pts), loops 5 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRefTableController.handleRequest (cognitive 40) · ×1
  • DiffusionRefTableController.handleRequest (cognitive 40) src/applications/diffusion/controller/DiffusionRefTableController.php:9 — DiffusionRefTableController.handleRequest has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 6 (9 pts), ternaries 2 (8 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.
D2 · Cognitive Complexity · PhameLiveController.setupLiveEnvironment (cognitive 40) · ×1
  • PhameLiveController.setupLiveEnvironment (cognitive 40) src/applications/phame/controller/PhameLiveController.php:30 — PhameLiveController.setupLiveEnvironment has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhrictionTransactionEditor.validateTransaction (cognitive 40) · ×1
  • PhrictionTransactionEditor.validateTransaction (cognitive 40) src/applications/phriction/editor/PhrictionTransactionEditor.php:348 — PhrictionTransactionEditor.validateTransaction has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (37 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementParentsWorkflow.rebuildRepository (cognitive 40) · ×1
  • PhabricatorRepositoryManagementParentsWorkflow.rebuildRepository (cognitive 40) src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php:49 — PhabricatorRepositoryManagementParentsWorkflow.rebuildRepository has cognitive complexity 40 (threshold 15). Drivers by points: loops 13 (24 pts), if/else 7 (16 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorSearchHovercardController.handleRequest (cognitive 40) · ×1
  • PhabricatorSearchHovercardController.handleRequest (cognitive 40) src/applications/search/controller/PhabricatorSearchHovercardController.php:10 — PhabricatorSearchHovercardController.handleRequest has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 8 (12 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCacheEngine.updateObject (cognitive 40) · ×1
  • PhabricatorCacheEngine.updateObject (cognitive 40) src/applications/system/engine/PhabricatorCacheEngine.php:9 — PhabricatorCacheEngine.updateObject has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 5 (10 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorInlineCommentController.processRequest (cognitive 40) · ×1
  • PhabricatorInlineCommentController.processRequest (cognitive 40) src/infrastructure/diff/PhabricatorInlineCommentController.php:93 — PhabricatorInlineCommentController.processRequest has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (36 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorStorageManagementRenamespaceWorkflow.didExecute (cognitive 40) · ×1
  • PhabricatorStorageManagementRenamespaceWorkflow.didExecute (cognitive 40) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php:57 — PhabricatorStorageManagementRenamespaceWorkflow.didExecute has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (33 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthInviteAction.newActionListFromAddresses (cognitive 39) · ×1
  • PhabricatorAuthInviteAction.newActionListFromAddresses (cognitive 39) src/applications/auth/data/PhabricatorAuthInviteAction.php:94 — PhabricatorAuthInviteAction.newActionListFromAddresses has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 7 (10 pts), match/switch 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionUpdateHistoryView.render (cognitive 39) · ×1
  • DifferentialRevisionUpdateHistoryView.render (cognitive 39) src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php:38 — DifferentialRevisionUpdateHistoryView.render has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 3 (9 pts), loops 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhrictionDocumentQuery.willFilterPage (cognitive 39) · ×1
  • PhrictionDocumentQuery.willFilterPage (cognitive 39) src/applications/phriction/query/PhrictionDocumentQuery.php:69 — PhrictionDocumentQuery.willFilterPage has cognitive complexity 39 (threshold 15). Drivers by points: loops 9 (20 pts), if/else 9 (19 pts) (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · behavior-commit-graph.JX.behavior("diffusion-commit-graph") (cognitive 39) · ×1
  • behavior-commit-graph.JX.behavior("diffusion-commit-graph") (cognitive 39) webroot/rsrc/js/application/diffusion/behavior-commit-graph.js:8 — behavior-commit-graph.JX.behavior("diffusion-commit-graph") has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (10 pts), loops 5 (9 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 39) · ×1
  • (anonymous) (cognitive 39) webroot/rsrc/js/application/diffusion/behavior-commit-graph.js:8 — (anonymous) has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (10 pts), loops 5 (9 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuditManagementDeleteWorkflow.execute (cognitive 38) · ×1
  • PhabricatorAuditManagementDeleteWorkflow.execute (cognitive 38) src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:62 — PhabricatorAuditManagementDeleteWorkflow.execute has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 6 (9 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CelerityResourceController.serveResource (cognitive 38) · ×1
  • CelerityResourceController.serveResource (cognitive 38) src/applications/celerity/controller/CelerityResourceController.php:27 — CelerityResourceController.serveResource has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (25 pts), error handling 2 (6 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDashboardTabsPanelType.renderPanelContent (cognitive 38) · ×1
  • PhabricatorDashboardTabsPanelType.renderPanelContent (cognitive 38) src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php:46 — PhabricatorDashboardTabsPanelType.renderPanelContent has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 3, loops 3, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialGetCommitMessageConduitAPIMethod.execute (cognitive 38) · ×1
  • DifferentialGetCommitMessageConduitAPIMethod.execute (cognitive 38) src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php:34 — DifferentialGetCommitMessageConduitAPIMethod.execute has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryProfilePictureController.handleRequest (cognitive 38) · ×1
  • DiffusionRepositoryProfilePictureController.handleRequest (cognitive 38) src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:6 — DiffusionRepositoryProfilePictureController.handleRequest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 2, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFeedStory.loadAllFromRows (cognitive 38) · ×1
  • PhabricatorFeedStory.loadAllFromRows (cognitive 38) src/applications/feed/story/PhabricatorFeedStory.php:41 — PhabricatorFeedStory.loadAllFromRows has cognitive complexity 38 (threshold 15). Drivers by points: loops 14 (20 pts), if/else 8 (15 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · HeraldEngine.applyRules (cognitive 38) · ×1
  • HeraldEngine.applyRules (cognitive 38) src/applications/herald/engine/HeraldEngine.php:126 — HeraldEngine.applyRules has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (10 pts), error handling 4 (8 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEmailAddressesSettingsPanel.returnNewAddressResponse (cognitive 38) · ×1
  • PhabricatorEmailAddressesSettingsPanel.returnNewAddressResponse (cognitive 38) src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:158 — PhabricatorEmailAddressesSettingsPanel.returnNewAddressResponse has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (34 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicJoinClause (cognitive 38) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicJoinClause (cognitive 38) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2694 — PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicJoinClause has cognitive complexity 38 (threshold 15). Drivers by points: loops 7 (24 pts), if/else 3 (7 pts), match/switch 2 (7 pts) (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorConfigDatabaseIssueController.handleRequest (cognitive 37) · ×1
  • PhabricatorConfigDatabaseIssueController.handleRequest (cognitive 37) src/applications/config/controller/services/PhabricatorConfigDatabaseIssueController.php:6 — PhabricatorConfigDatabaseIssueController.handleRequest has cognitive complexity 37 (threshold 15). Drivers by points: loops 11 (33 pts), if/else 3 (4 pts) (nesting depth added 23). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DiffusionLowLevelResolveRefsQuery.resolveMercurialRefs (cognitive 37) · ×1
  • DiffusionLowLevelResolveRefsQuery.resolveMercurialRefs (cognitive 37) src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php:243 — DiffusionLowLevelResolveRefsQuery.resolveMercurialRefs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 9 (16 pts), error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitGraphView.newObjectItemViews (cognitive 37) · ×1
  • DiffusionCommitGraphView.newObjectItemViews (cognitive 37) src/applications/diffusion/view/DiffusionCommitGraphView.php:105 — DiffusionCommitGraphView.newObjectItemViews has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 6 (12 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorOwnersPackageQuery.getControllingPackagesForPath (cognitive 37) · ×1
  • PhabricatorOwnersPackageQuery.getControllingPackagesForPath (cognitive 37) src/applications/owners/query/PhabricatorOwnersPackageQuery.php:369 — PhabricatorOwnersPackageQuery.getControllingPackagesForPath has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 6 (10 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectColumnQuery.didFilterPage (cognitive 37) · ×1
  • PhabricatorProjectColumnQuery.didFilterPage (cognitive 37) src/applications/project/query/PhabricatorProjectColumnQuery.php:88 — PhabricatorProjectColumnQuery.didFilterPage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 4 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectQuery.willFilterPage (cognitive 37) · ×1
  • PhabricatorProjectQuery.willFilterPage (cognitive 37) src/applications/project/query/PhabricatorProjectQuery.php:239 — PhabricatorProjectQuery.willFilterPage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (26 pts), loops 6 (8 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryPullEngine.pullRepositoryWithLock (cognitive 37) · ×1
  • PhabricatorRepositoryPullEngine.pullRepositoryWithLock (cognitive 37) src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:51 — PhabricatorRepositoryPullEngine.pullRepositoryWithLock has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 1 (2 pts), error handling 1, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryRefEngine.updateCursors (cognitive 37) · ×1
  • PhabricatorRepositoryRefEngine.updateCursors (cognitive 37) src/applications/repository/engine/PhabricatorRepositoryRefEngine.php:258 — PhabricatorRepositoryRefEngine.updateCursors has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 6 (11 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationSearchEngine.buildConduitResponse (cognitive 37) · ×1
  • PhabricatorApplicationSearchEngine.buildConduitResponse (cognitive 37) src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1144 — PhabricatorApplicationSearchEngine.buildConduitResponse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 11 (17 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilRemarkupCodeBlockRule.markupText (cognitive 37) · ×1
  • PhutilRemarkupCodeBlockRule.markupText (cognitive 37) src/infrastructure/markup/blockrule/PhutilRemarkupCodeBlockRule.php:46 — PhutilRemarkupCodeBlockRule.markupText has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (30 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorActionView.render (cognitive 37) · ×1
  • PhabricatorActionView.render (cognitive 37) src/view/layout/PhabricatorActionView.php:198 — PhabricatorActionView.render has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26 (34 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · start (cognitive 37) · ×1
  • start (cognitive 37) webroot/rsrc/js/core/DragAndDropFileUpload.js:75 — start has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (31 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 4 of the 37 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 185, a function literal at line 105, contains, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ConpherenceTransactionRenderer.renderTransactions (cognitive 36) · ×1
  • ConpherenceTransactionRenderer.renderTransactions (cognitive 36) src/applications/conpherence/ConpherenceTransactionRenderer.php:5 — ConpherenceTransactionRenderer.renderTransactions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 2, boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DifferentialTransactionEditor.buildMailBody (cognitive 36) · ×1
  • DifferentialTransactionEditor.buildMailBody (cognitive 36) src/applications/differential/editor/DifferentialTransactionEditor.php:662 — DifferentialTransactionEditor.buildMailBody has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, error handling 1 (3 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialTransaction.getTitleForFeed (cognitive 36) · ×1
  • DifferentialTransaction.getTitleForFeed (cognitive 36) src/applications/differential/storage/DifferentialTransaction.php:281 — DifferentialTransaction.getTitleForFeed has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DifferentialRevisionListView.render (cognitive 36) · ×1
  • DifferentialRevisionListView.render (cognitive 36) src/applications/differential/view/DifferentialRevisionListView.php:50 — DifferentialRevisionListView.render has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionReviewTransaction.applyReviewerEffect (cognitive 36) · ×1
  • DifferentialRevisionReviewTransaction.applyReviewerEffect (cognitive 36) src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php:163 — DifferentialRevisionReviewTransaction.applyReviewerEffect has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitController.buildPropertyListView (cognitive 36) · ×1
  • DiffusionCommitController.buildPropertyListView (cognitive 36) src/applications/diffusion/controller/DiffusionCommitController.php:524 — DiffusionCommitController.buildPropertyListView has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (25 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorFileViewController.buildPropertyViews (cognitive 36) · ×1
  • PhabricatorFileViewController.buildPropertyViews (cognitive 36) src/applications/files/controller/PhabricatorFileViewController.php:218 — PhabricatorFileViewController.buildPropertyViews has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuildEngine.updateBuildable (cognitive 36) · ×1
  • HarbormasterBuildEngine.updateBuildable (cognitive 36) src/applications/harbormaster/engine/HarbormasterBuildEngine.php:442 — HarbormasterBuildEngine.updateBuildable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectEditPictureController.handleRequest (cognitive 36) · ×1
  • PhabricatorProjectEditPictureController.handleRequest (cognitive 36) src/applications/project/controller/PhabricatorProjectEditPictureController.php:6 — PhabricatorProjectEditPictureController.handleRequest has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 2, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepository.generateURI (cognitive 36) · ×1
  • PhabricatorRepository.generateURI (cognitive 36) src/applications/repository/storage/PhabricatorRepository.php:681 — PhabricatorRepository.generateURI has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 9, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSubscriptionsHeraldAction.applySubscribe (cognitive 36) · ×1
  • PhabricatorSubscriptionsHeraldAction.applySubscribe (cognitive 36) src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php:19 — PhabricatorSubscriptionsHeraldAction.applySubscribe has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 4 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilXHPASTSyntaxHighlighterFuture.applyXHPHighlight (cognitive 36) · ×1
  • PhutilXHPASTSyntaxHighlighterFuture.applyXHPHighlight (cognitive 36) src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:31 — PhutilXHPASTSyntaxHighlighterFuture.applyXHPHighlight has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorStandardPageView.willRenderPage (cognitive 36) · ×1
  • PhabricatorStandardPageView.willRenderPage (cognitive 36) src/view/page/PhabricatorStandardPageView.php:199 — PhabricatorStandardPageView.willRenderPage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (28 pts), ternaries 2 (8 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redraw (cognitive 36) · ×1
  • redraw (cognitive 36) webroot/rsrc/js/application/diff/DiffTreeView.js:87 — redraw has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 8 (9 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuditTransaction.getTitleForFeed (cognitive 35) · ×1
  • PhabricatorAuditTransaction.getTitleForFeed (cognitive 35) src/applications/audit/storage/PhabricatorAuditTransaction.php:297 — PhabricatorAuditTransaction.getTitleForFeed has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (30 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorAuthLoginController.handleRequest (cognitive 35) · ×1
  • PhabricatorAuthLoginController.handleRequest (cognitive 35) src/applications/auth/controller/PhabricatorAuthLoginController.php:28 — PhabricatorAuthLoginController.handleRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 1, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDuoAuthFactor.processAddFactorForm (cognitive 35) · ×1
  • PhabricatorDuoAuthFactor.processAddFactorForm (cognitive 35) src/applications/auth/factor/PhabricatorDuoAuthFactor.php:155 — PhabricatorDuoAuthFactor.processAddFactorForm has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 2 (8 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceRule.newYearMap (cognitive 35) · ×1
  • PhutilCalendarRecurrenceRule.newYearMap (cognitive 35) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:1349 — PhutilCalendarRecurrenceRule.newYearMap has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 5, boolean chains 2, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorWebServerSetupCheck.executeChecks (cognitive 35) · ×1
  • PhabricatorWebServerSetupCheck.executeChecks (cognitive 35) REDACTED:9 — PhabricatorWebServerSetupCheck.executeChecks has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 5, error handling 3, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorConfigEditController.handleRequest (cognitive 35) · ×1
  • PhabricatorConfigEditController.handleRequest (cognitive 35) src/applications/config/controller/settings/PhabricatorConfigEditController.php:6 — PhabricatorConfigEditController.handleRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24 (29 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConpherenceRoomPictureController.handleRequest (cognitive 35) · ×1
  • ConpherenceRoomPictureController.handleRequest (cognitive 35) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:6 — ConpherenceRoomPictureController.handleRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (33 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.
D2 · Cognitive Complexity · DifferentialTransactionEditor.updateReviewStatus (cognitive 35) · ×1
  • DifferentialTransactionEditor.updateReviewStatus (cognitive 35) src/applications/differential/editor/DifferentialTransactionEditor.php:403 — DifferentialTransactionEditor.updateReviewStatus has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerAtomQuery.buildWhereClause (cognitive 35) · ×1
  • DivinerAtomQuery.buildWhereClause (cognitive 35) src/applications/diviner/query/DivinerAtomQuery.php:302 — DivinerAtomQuery.buildWhereClause has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (30 pts), loops 2 (4 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.
D2 · Cognitive Complexity · PhabricatorFileQuery.loadPage (cognitive 35) · ×1
  • PhabricatorFileQuery.loadPage (cognitive 35) src/applications/files/query/PhabricatorFileQuery.php:166 — PhabricatorFileQuery.loadPage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 6 (10 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMailEmailEngine.newMessage (cognitive 35) · ×1
  • PhabricatorMailEmailEngine.newMessage (cognitive 35) src/applications/metamta/engine/PhabricatorMailEmailEngine.php:6 — PhabricatorMailEmailEngine.newMessage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (27 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMetaMTAMemberQuery.execute (cognitive 35) · ×1
  • PhabricatorMetaMTAMemberQuery.execute (cognitive 35) src/applications/metamta/query/PhabricatorMetaMTAMemberQuery.php:26 — PhabricatorMetaMTAMemberQuery.execute has cognitive complexity 35 (threshold 15). Drivers by points: loops 10 (24 pts), if/else 4 (9 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhameBlogProfilePictureController.handleRequest (cognitive 35) · ×1
  • PhameBlogProfilePictureController.handleRequest (cognitive 35) src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:6 — PhameBlogProfilePictureController.handleRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (33 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.
D2 · Cognitive Complexity · PhrequentUserTimeQuery.didFilterPage (cognitive 35) · ×1
  • PhrequentUserTimeQuery.didFilterPage (cognitive 35) src/applications/phrequent/query/PhrequentUserTimeQuery.php:159 — PhrequentUserTimeQuery.didFilterPage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectSearchEngine.buildQueryFromParameters (cognitive 35) · ×1
  • PhabricatorProjectSearchEngine.buildQueryFromParameters (cognitive 35) src/applications/project/query/PhabricatorProjectSearchEngine.php:130 — PhabricatorProjectSearchEngine.buildQueryFromParameters has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSearchRelationshipController.handleRequest (cognitive 35) · ×1
  • PhabricatorSearchRelationshipController.handleRequest (cognitive 35) src/applications/search/controller/PhabricatorSearchRelationshipController.php:6 — PhabricatorSearchRelationshipController.handleRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 2 (5 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUICalendarMonthView.render (cognitive 35) · ×1
  • PHUICalendarMonthView.render (cognitive 35) src/view/phui/calendar/PHUICalendarMonthView.php:53 — PHUICalendarMonthView.render has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 7 (12 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _getFragmentLocation (cognitive 35) · ×1
  • _getFragmentLocation (cognitive 35) webroot/rsrc/js/application/diff/DiffChangesetList.js:2643 — _getFragmentLocation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (31 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConfigSchemaQuery.loadActualSchemaForServer (cognitive 34) · ×1
  • PhabricatorConfigSchemaQuery.loadActualSchemaForServer (cognitive 34) src/applications/config/schema/PhabricatorConfigSchemaQuery.php:64 — PhabricatorConfigSchemaQuery.loadActualSchemaForServer has cognitive complexity 34 (threshold 15). Drivers by points: loops 8 (16 pts), if/else 6 (14 pts), error handling 2 (4 pts) (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DifferentialRevisionViewController.getOldDiffID (cognitive 34) · ×1
  • DifferentialRevisionViewController.getOldDiffID (cognitive 34) src/applications/differential/controller/DifferentialRevisionViewController.php:1321 — DifferentialRevisionViewController.getOldDiffID has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DifferentialChangesetParser.newDocumentEngine (cognitive 34) · ×1
  • DifferentialChangesetParser.newDocumentEngine (cognitive 34) src/applications/differential/parser/DifferentialChangesetParser.php:1746 — DifferentialChangesetParser.newDocumentEngine has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerPHPAtomizer.executeAtomize (cognitive 34) · ×1
  • DivinerPHPAtomizer.executeAtomize (cognitive 34) src/applications/diviner/atomizer/DivinerPHPAtomizer.php:9 — DivinerPHPAtomizer.executeAtomize has cognitive complexity 34 (threshold 15). Drivers by points: loops 8 (21 pts), if/else 3 (7 pts), match/switch 1 (6 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorFilesManagementRebuildWorkflow.execute (cognitive 34) · ×1
  • PhabricatorFilesManagementRebuildWorkflow.execute (cognitive 34) src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php:30 — PhabricatorFilesManagementRebuildWorkflow.execute has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (5 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · PhabricatorFile.newFromFileDownload (cognitive 34) · ×1
  • PhabricatorFile.newFromFileDownload (cognitive 34) src/applications/files/storage/PhabricatorFile.php:589 — PhabricatorFile.newFromFileDownload has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestConduitAPIMethod.applyRequest (cognitive 34) · ×1
  • ManiphestConduitAPIMethod.applyRequest (cognitive 34) src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php:53 — ManiphestConduitAPIMethod.applyRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (30 pts), loops 2 (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.
D2 · Cognitive Complexity · NuanceGitHubImportCursor.pullDataFromSource (cognitive 34) · ×1
  • NuanceGitHubImportCursor.pullDataFromSource (cognitive 34) src/applications/nuance/cursor/NuanceGitHubImportCursor.php:56 — NuanceGitHubImportCursor.pullDataFromSource has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (8 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortuneMerchantPictureController.handleMerchantRequest (cognitive 34) · ×1
  • PhortuneMerchantPictureController.handleMerchantRequest (cognitive 34) src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:10 — PhortuneMerchantPictureController.handleMerchantRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (32 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.
D2 · Cognitive Complexity · PhrequentTrackController.processRequest (cognitive 34) · ×1
  • PhrequentTrackController.processRequest (cognitive 34) src/applications/phrequent/controller/PhrequentTrackController.php:14 — PhrequentTrackController.processRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorProjectTriggerSearchEngine.renderResultList (cognitive 34) · ×1
  • PhabricatorProjectTriggerSearchEngine.renderResultList (cognitive 34) src/applications/project/query/PhabricatorProjectTriggerSearchEngine.php:72 — PhabricatorProjectTriggerSearchEngine.renderResultList has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.addHeadersAndCommentsToMailBody (cognitive 34) · ×1
  • PhabricatorApplicationTransactionEditor.addHeadersAndCommentsToMailBody (cognitive 34) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3859 — PhabricatorApplicationTransactionEditor.addHeadersAndCommentsToMailBody has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 4, boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilRemarkupSimpleTableBlockRule.markupText (cognitive 34) · ×1
  • PhutilRemarkupSimpleTableBlockRule.markupText (cognitive 34) src/infrastructure/markup/blockrule/PhutilRemarkupSimpleTableBlockRule.php:19 — PhutilRemarkupSimpleTableBlockRule.markupText has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (7 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.
D2 · Cognitive Complexity · render.phutil_escape_html (cognitive 34) · ×1
  • render.phutil_escape_html (cognitive 34) src/infrastructure/markup/render.php:107 — render.phutil_escape_html has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 1 (6 pts), loops 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.
D2 · Cognitive Complexity · DiffusionCommitHookEngine.findGitChangeFlags (cognitive 33) · ×1
  • DiffusionCommitHookEngine.findGitChangeFlags (cognitive 33) src/applications/diffusion/engine/DiffusionCommitHookEngine.php:526 — DiffusionCommitHookEngine.findGitChangeFlags has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 1, loops 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DiffusionRepositoryClusterEngine.synchronizeWorkingCopyBeforeRead (cognitive 33) · ×1
  • DiffusionRepositoryClusterEngine.synchronizeWorkingCopyBeforeRead (cognitive 33) src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:153 — DiffusionRepositoryClusterEngine.synchronizeWorkingCopyBeforeRead has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 2 (6 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldTranscriptController.buildActionTranscriptPanel (cognitive 33) · ×1
  • HeraldTranscriptController.buildActionTranscriptPanel (cognitive 33) src/applications/herald/controller/HeraldTranscriptController.php:226 — HeraldTranscriptController.buildActionTranscriptPanel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (8 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhluxEditController.handleRequest (cognitive 33) · ×1
  • PhluxEditController.handleRequest (cognitive 33) src/applications/phlux/controller/PhluxEditController.php:5 — PhluxEditController.handleRequest has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPhortuneManagementInvoiceWorkflow.execute (cognitive 33) · ×1
  • PhabricatorPhortuneManagementInvoiceWorkflow.execute (cognitive 33) src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php:49 — PhabricatorPhortuneManagementInvoiceWorkflow.execute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 7, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepository.getAlmanacServiceRefs (cognitive 33) · ×1
  • PhabricatorRepository.getAlmanacServiceRefs (cognitive 33) src/applications/repository/storage/PhabricatorRepository.php:1858 — PhabricatorRepository.getAlmanacServiceRefs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositorySvnCommitChangeParserWorker.parseRecursiveListFileData (cognitive 33) · ×1
  • PhabricatorRepositorySvnCommitChangeParserWorker.parseRecursiveListFileData (cognitive 33) src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php:676 — PhabricatorRepositorySvnCommitChangeParserWorker.parseRecursiveListFileData has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationSearchController.newQueryListView (cognitive 33) · ×1
  • PhabricatorApplicationSearchController.newQueryListView (cognitive 33) src/applications/search/controller/PhabricatorApplicationSearchController.php:621 — PhabricatorApplicationSearchController.newQueryListView has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (31 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.
D2 · Cognitive Complexity · PhabricatorFerretFulltextEngineExtension.indexFulltextObject (cognitive 33) · ×1
  • PhabricatorFerretFulltextEngineExtension.indexFulltextObject (cognitive 33) src/applications/search/engineextension/PhabricatorFerretFulltextEngineExtension.php:19 — PhabricatorFerretFulltextEngineExtension.indexFulltextObject has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 5 (6 pts), match/switch 2 (4 pts), error handling 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDatabaseRef.queryRefs (cognitive 33) · ×1
  • PhabricatorDatabaseRef.queryRefs (cognitive 33) src/infrastructure/cluster/PhabricatorDatabaseRef.php:342 — PhabricatorDatabaseRef.queryRefs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (24 pts), error handling 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhutilRemarkupListBlockRule.getMatchingLineCount (cognitive 33) · ×1
  • PhutilRemarkupListBlockRule.getMatchingLineCount (cognitive 33) src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php:13 — PhutilRemarkupListBlockRule.getMatchingLineCount has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 4, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 33) · ×1
  • (anonymous) (cognitive 33) webroot/rsrc/js/application/policy/behavior-policy-control.js:13 — (anonymous) has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (6 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 17). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 13 function items inside it that branch (a function literal at line 30, add_policy, render_option, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DifferentialLocalCommitsView.render (cognitive 32) · ×1
  • DifferentialLocalCommitsView.render (cognitive 32) src/applications/differential/view/DifferentialLocalCommitsView.php:19 — DifferentialLocalCommitsView.render has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFilesManagementMigrateWorkflow.execute (cognitive 32) · ×1
  • PhabricatorFilesManagementMigrateWorkflow.execute (cognitive 32) src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php:57 — PhabricatorFilesManagementMigrateWorkflow.execute has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (25 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTaskQuery.buildWhereClauseParts (cognitive 32) · ×1
  • ManiphestTaskQuery.buildWhereClauseParts (cognitive 32) src/applications/maniphest/query/ManiphestTaskQuery.php:354 — ManiphestTaskQuery.buildWhereClauseParts has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (25 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PhutilDaemonOverseer.run (cognitive 32) · ×1
  • PhutilDaemonOverseer.run (cognitive 32) src/infrastructure/daemon/PhutilDaemonOverseer.php:162 — PhutilDaemonOverseer.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (3 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.
D2 · Cognitive Complexity · PhabricatorTaskmasterDaemon.run (cognitive 32) · ×1
  • PhabricatorTaskmasterDaemon.run (cognitive 32) src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:5 — PhabricatorTaskmasterDaemon.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (4 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhutilRemarkupBlockRule.renderRemarkupTable (cognitive 32) · ×1
  • PhutilRemarkupBlockRule.renderRemarkupTable (cognitive 32) src/infrastructure/markup/blockrule/PhutilRemarkupBlockRule.php:105 — PhutilRemarkupBlockRule.renderRemarkupTable has cognitive complexity 32 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 5 (10 pts), ternaries 1 (5 pts) (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorMainMenuView.render (cognitive 32) · ×1
  • PhabricatorMainMenuView.render (cognitive 32) src/view/page/menu/PhabricatorMainMenuView.php:51 — PhabricatorMainMenuView.render has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 6 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthProviderConfigTransaction.getTitle (cognitive 31) · ×1
  • PhabricatorAuthProviderConfigTransaction.getTitle (cognitive 31) src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php:61 — PhabricatorAuthProviderConfigTransaction.getTitle has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (30 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorConduitAPIController.handleRequest (cognitive 31) · ×1
  • PhabricatorConduitAPIController.handleRequest (cognitive 31) src/applications/conduit/controller/PhabricatorConduitAPIController.php:10 — PhabricatorConduitAPIController.handleRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 2 (3 pts), boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · PhabricatorBinariesSetupCheck.executeChecks (cognitive 31) · ×1
  • PhabricatorBinariesSetupCheck.executeChecks (cognitive 31) src/applications/config/check/PhabricatorBinariesSetupCheck.php:9 — PhabricatorBinariesSetupCheck.executeChecks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 2 (4 pts), match/switch 2 (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.
D2 · Cognitive Complexity · PhabricatorDashboardPanelsTransaction.validateTransactions (cognitive 31) · ×1
  • PhabricatorDashboardPanelsTransaction.validateTransactions (cognitive 31) src/applications/dashboard/xaction/dashboard/PhabricatorDashboardPanelsTransaction.php:22 — PhabricatorDashboardPanelsTransaction.validateTransactions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (6 pts), error handling 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialCommitMessageParser.parseCorpus (cognitive 31) · ×1
  • DifferentialCommitMessageParser.parseCorpus (cognitive 31) src/applications/differential/parser/DifferentialCommitMessageParser.php:136 — DifferentialCommitMessageParser.parseCorpus has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 4 (5 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.
D2 · Cognitive Complexity · DifferentialLineAdjustmentMap.mapLine (cognitive 31) · ×1
  • DifferentialLineAdjustmentMap.mapLine (cognitive 31) src/applications/differential/parser/DifferentialLineAdjustmentMap.php:65 — DifferentialLineAdjustmentMap.mapLine has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DiffusionLintSaveRunner.run (cognitive 31) · ×1
  • DiffusionLintSaveRunner.run (cognitive 31) src/applications/diffusion/DiffusionLintSaveRunner.php:45 — DiffusionLintSaveRunner.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (26 pts), error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryURIViewController.buildPropertySection (cognitive 31) · ×1
  • DiffusionRepositoryURIViewController.buildPropertySection (cognitive 31) src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php:178 — DiffusionRepositoryURIViewController.buildPropertySection has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (31 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.
D2 · Cognitive Complexity · HeraldEngine.isForbidden (cognitive 31) · ×1
  • HeraldEngine.isForbidden (cognitive 31) src/applications/herald/engine/HeraldEngine.php:790 — HeraldEngine.isForbidden has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (8 pts), error handling 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LegalpadDocumentSignatureAddController.handleRequest (cognitive 31) · ×1
  • LegalpadDocumentSignatureAddController.handleRequest (cognitive 31) src/applications/legalpad/controller/LegalpadDocumentSignatureAddController.php:5 — LegalpadDocumentSignatureAddController.handleRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (31 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorLipsumGenerateWorkflow.execute (cognitive 31) · ×1
  • PhabricatorLipsumGenerateWorkflow.execute (cognitive 31) src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php:31 — PhabricatorLipsumGenerateWorkflow.execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 4 (8 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTaskStatus.validateConfiguration (cognitive 31) · ×1
  • ManiphestTaskStatus.validateConfiguration (cognitive 31) src/applications/maniphest/constants/ManiphestTaskStatus.php:261 — ManiphestTaskStatus.validateConfiguration has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPeopleSearchEngine.renderResultList (cognitive 31) · ×1
  • PhabricatorPeopleSearchEngine.renderResultList (cognitive 31) src/applications/people/query/PhabricatorPeopleSearchEngine.php:233 — PhabricatorPeopleSearchEngine.renderResultList has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPeopleDatasource.loadResults (cognitive 31) · ×1
  • PhabricatorPeopleDatasource.loadResults (cognitive 31) src/applications/people/typeahead/PhabricatorPeopleDatasource.php:18 — PhabricatorPeopleDatasource.loadResults has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectBoardReorderController.handleRequest (cognitive 31) · ×1
  • PhabricatorProjectBoardReorderController.handleRequest (cognitive 31) src/applications/project/controller/PhabricatorProjectBoardReorderController.php:6 — PhabricatorProjectBoardReorderController.handleRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectQuery.buildWhereClauseParts (cognitive 31) · ×1
  • PhabricatorProjectQuery.buildWhereClauseParts (cognitive 31) src/applications/project/query/PhabricatorProjectQuery.php:457 — PhabricatorProjectQuery.buildWhereClauseParts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23 (25 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorSearchResultView.emboldenQuery (cognitive 31) · ×1
  • PhabricatorSearchResultView.emboldenQuery (cognitive 31) src/applications/search/view/PhabricatorSearchResultView.php:59 — PhabricatorSearchResultView.emboldenQuery has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 6 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.mergePHIDOrEdgeTransactions (cognitive 31) · ×1
  • PhabricatorApplicationTransactionEditor.mergePHIDOrEdgeTransactions (cognitive 31) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2481 — PhabricatorApplicationTransactionEditor.mergePHIDOrEdgeTransactions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (5 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorJavelinLinter.lintPath (cognitive 31) · ×1
  • PhabricatorJavelinLinter.lintPath (cognitive 31) src/infrastructure/lint/linter/PhabricatorJavelinLinter.php:104 — PhabricatorJavelinLinter.lintPath has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorManagementWorkflow.loadUsersFromArguments (cognitive 31) · ×1
  • PhabricatorManagementWorkflow.loadUsersFromArguments (cognitive 31) src/infrastructure/management/PhabricatorManagementWorkflow.php:70 — PhabricatorManagementWorkflow.loadUsersFromArguments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 7 (13 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilXHPASTSyntaxHighlighterFuture.findInterestingSymbols (cognitive 31) · ×1
  • PhutilXHPASTSyntaxHighlighterFuture.findInterestingSymbols (cognitive 31) src/infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php:164 — PhutilXHPASTSyntaxHighlighterFuture.findInterestingSymbols has cognitive complexity 31 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 6 (14 pts), boolean chains 2 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicWhereClause (cognitive 31) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicWhereClause (cognitive 31) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2814 — PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicWhereClause has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (12 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · PhabricatorSourceCodeView.render (cognitive 31) · ×1
  • PhabricatorSourceCodeView.render (cognitive 31) src/view/layout/PhabricatorSourceCodeView.php:72 — PhabricatorSourceCodeView.render has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarEventViewController.buildPropertySection (cognitive 30) · ×1
  • PhabricatorCalendarEventViewController.buildPropertySection (cognitive 30) src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:275 — PhabricatorCalendarEventViewController.buildPropertySection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (5 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorConfigManagementSetWorkflow.execute (cognitive 30) · ×1
  • PhabricatorConfigManagementSetWorkflow.execute (cognitive 30) src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php:32 — PhabricatorConfigManagementSetWorkflow.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 2 (6 pts), error handling 3 (5 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.
D2 · Cognitive Complexity · PhabricatorDashboardObjectInstallWorkflow.handleRequest (cognitive 30) · ×1
  • PhabricatorDashboardObjectInstallWorkflow.handleRequest (cognitive 30) src/applications/dashboard/install/PhabricatorDashboardObjectInstallWorkflow.php:10 — PhabricatorDashboardObjectInstallWorkflow.handleRequest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialQueryConduitAPIMethod.execute (cognitive 30) · ×1
  • DifferentialQueryConduitAPIMethod.execute (cognitive 30) src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php:65 — DifferentialQueryConduitAPIMethod.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (25 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DifferentialTransactionEditor.expandTransaction (cognitive 30) · ×1
  • DifferentialTransactionEditor.expandTransaction (cognitive 30) src/applications/differential/editor/DifferentialTransactionEditor.php:152 — DifferentialTransactionEditor.expandTransaction has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialDiffExtractionEngine.isDiffChangedBeforeCommit (cognitive 30) · ×1
  • DifferentialDiffExtractionEngine.isDiffChangedBeforeCommit (cognitive 30) src/applications/differential/engine/DifferentialDiffExtractionEngine.php:119 — DifferentialDiffExtractionEngine.isDiffChangedBeforeCommit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4, error handling 1 (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.
D2 · Cognitive Complexity · DiffusionLocalRepositoryFilter.execute (cognitive 30) · ×1
  • DiffusionLocalRepositoryFilter.execute (cognitive 30) src/applications/diffusion/data/DiffusionLocalRepositoryFilter.php:50 — DiffusionLocalRepositoryFilter.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 3 (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.
D2 · Cognitive Complexity · PhabricatorFactDatapointQuery.execute (cognitive 30) · ×1
  • PhabricatorFactDatapointQuery.execute (cognitive 30) src/applications/fact/query/PhabricatorFactDatapointQuery.php:34 — PhabricatorFactDatapointQuery.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTaskSearchEngine.buildQueryFromParameters (cognitive 30) · ×1
  • ManiphestTaskSearchEngine.buildQueryFromParameters (cognitive 30) src/applications/maniphest/query/ManiphestTaskSearchEngine.php:190 — ManiphestTaskSearchEngine.buildQueryFromParameters has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorPeopleQuery.fillUserCaches (cognitive 30) · ×1
  • PhabricatorPeopleQuery.fillUserCaches (cognitive 30) src/applications/people/query/PhabricatorPeopleQuery.php:514 — PhabricatorPeopleQuery.fillUserCaches has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 7 (10 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryPullEngine.executeGitUpdate (cognitive 30) · ×1
  • PhabricatorRepositoryPullEngine.executeGitUpdate (cognitive 30) src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:275 — PhabricatorRepositoryPullEngine.executeGitUpdate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 2 (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.
D2 · Cognitive Complexity · PhabricatorRepositoryPushMailWorker.renderRefs (cognitive 30) · ×1
  • PhabricatorRepositoryPushMailWorker.renderRefs (cognitive 30) src/applications/repository/worker/PhabricatorRepositoryPushMailWorker.php:135 — PhabricatorRepositoryPushMailWorker.renderRefs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorApplicationTransaction.getTitleForFeed (cognitive 30) · ×1
  • PhabricatorApplicationTransaction.getTitleForFeed (cognitive 30) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1335 — PhabricatorApplicationTransaction.getTitleForFeed has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhutilRemarkupLiteralBlockRule.getMatchingLineCount (cognitive 30) · ×1
  • PhutilRemarkupLiteralBlockRule.getMatchingLineCount (cognitive 30) src/infrastructure/markup/blockrule/PhutilRemarkupLiteralBlockRule.php:9 — PhutilRemarkupLiteralBlockRule.getMatchingLineCount has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUITimelineEventView.renderExtra (cognitive 30) · ×1
  • PHUITimelineEventView.renderExtra (cognitive 30) src/view/phui/PHUITimelineEventView.php:560 — PHUITimelineEventView.renderExtra has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _onmenu (cognitive 30) · ×1
  • _onmenu (cognitive 30) webroot/rsrc/js/application/diff/DiffChangesetList.js:900 — _onmenu has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (27 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 972, a function literal at line 1112, add_link, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · getSelectableItems (cognitive 30) · ×1
  • getSelectableItems (cognitive 30) webroot/rsrc/js/application/diff/DiffChangeset.js:435 — getSelectableItems has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthPasswordEngine.checkNewPassword (cognitive 29) · ×1
  • PhabricatorAuthPasswordEngine.checkNewPassword (cognitive 29) src/applications/auth/engine/PhabricatorAuthPasswordEngine.php:57 — PhabricatorAuthPasswordEngine.checkNewPassword has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPasswordAuthProvider.processLoginRequest (cognitive 29) · ×1
  • PhabricatorPasswordAuthProvider.processLoginRequest (cognitive 29) src/applications/auth/provider/PhabricatorPasswordAuthProvider.php:251 — PhabricatorPasswordAuthProvider.processLoginRequest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 1 (3 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceRule.advanceCursorState (cognitive 29) · ×1
  • PhutilCalendarRecurrenceRule.advanceCursorState (cognitive 29) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:1685 — PhutilCalendarRecurrenceRule.advanceCursorState has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (10 pts), match/switch 3 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConduitMethodQuery.filterMethods (cognitive 29) · ×1
  • PhabricatorConduitMethodQuery.filterMethods (cognitive 29) src/applications/conduit/query/PhabricatorConduitMethodQuery.php:57 — PhabricatorConduitMethodQuery.filterMethods has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (9 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDashboardPanelTabsController.handleMoveOperation (cognitive 29) · ×1
  • PhabricatorDashboardPanelTabsController.handleMoveOperation (cognitive 29) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:301 — PhabricatorDashboardPanelTabsController.handleMoveOperation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionGitUploadPackWireProtocol.newProtocolRefMessage (cognitive 29) · ×1
  • DiffusionGitUploadPackWireProtocol.newProtocolRefMessage (cognitive 29) src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php:165 — DiffusionGitUploadPackWireProtocol.newProtocolRefMessage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLowLevelGitRefQuery.executeQuery (cognitive 29) · ×1
  • DiffusionLowLevelGitRefQuery.executeQuery (cognitive 29) src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php:16 — DiffusionLowLevelGitRefQuery.executeQuery has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionSourceLinkRemarkupRule.didMarkupText (cognitive 29) · ×1
  • DiffusionSourceLinkRemarkupRule.didMarkupText (cognitive 29) src/applications/diffusion/remarkup/DiffusionSourceLinkRemarkupRule.php:46 — DiffusionSourceLinkRemarkupRule.didMarkupText has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldAction.loadStandardTargets (cognitive 29) · ×1
  • HeraldAction.loadStandardTargets (cognitive 29) src/applications/herald/action/HeraldAction.php:206 — HeraldAction.loadStandardTargets has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationEditController.handleRequest (cognitive 29) · ×1
  • PhabricatorApplicationEditController.handleRequest (cognitive 29) src/applications/meta/controller/PhabricatorApplicationEditController.php:6 — PhabricatorApplicationEditController.handleRequest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorMailReplyHandler.expandRecipientPHIDs (cognitive 29) · ×1
  • PhabricatorMailReplyHandler.expandRecipientPHIDs (cognitive 29) src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php:281 — PhabricatorMailReplyHandler.expandRecipientPHIDs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 4 (10 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhrictionRemarkupRule.markupDocumentLink (cognitive 29) · ×1
  • PhrictionRemarkupRule.markupDocumentLink (cognitive 29) src/applications/phriction/markup/PhrictionRemarkupRule.php:18 — PhrictionRemarkupRule.markupDocumentLink has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 1 (3 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.
D2 · Cognitive Complexity · PhutilDaemonHandle.update (cognitive 29) · ×1
  • PhutilDaemonHandle.update (cognitive 29) src/infrastructure/daemon/PhutilDaemonHandle.php:136 — PhutilDaemonHandle.update has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorObjectGraph.newGraphTable (cognitive 29) · ×1
  • PhabricatorObjectGraph.newGraphTable (cognitive 29) src/infrastructure/graph/PhabricatorObjectGraph.php:163 — PhabricatorObjectGraph.newGraphTable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (8 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · markup.javelin_tag (cognitive 29) · ×1
  • markup.javelin_tag (cognitive 29) src/infrastructure/javelin/markup.php:3 — markup.javelin_tag has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilRemarkupEngine.splitTextIntoBlocks (cognitive 29) · ×1
  • PhutilRemarkupEngine.splitTextIntoBlocks (cognitive 29) src/infrastructure/markup/remarkup/PhutilRemarkupEngine.php:156 — PhutilRemarkupEngine.splitTextIntoBlocks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 6 (9 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.validateEdgeLogicConstraints (cognitive 29) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.validateEdgeLogicConstraints (cognitive 29) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:3000 — PhabricatorCursorPagedPolicyAwareQuery.validateEdgeLogicConstraints has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (8 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSQLPatchList.getPHPPatchAttributes (cognitive 29) · ×1
  • PhabricatorSQLPatchList.getPHPPatchAttributes (cognitive 29) src/infrastructure/storage/patch/PhabricatorSQLPatchList.php:260 — PhabricatorSQLPatchList.getPHPPatchAttributes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (24 pts), match/switch 1 (4 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIObjectBoxView.getTagContent (cognitive 29) · ×1
  • PHUIObjectBoxView.getTagContent (cognitive 29) src/view/phui/PHUIObjectBoxView.php:181 — PHUIObjectBoxView.getTagContent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIPagerView.render (cognitive 29) · ×1
  • PHUIPagerView.render (cognitive 29) src/view/phui/PHUIPagerView.php:119 — PHUIPagerView.render has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUITimelineView.buildEvents (cognitive 29) · ×1
  • PHUITimelineView.buildEvents (cognitive 29) src/view/phui/PHUITimelineView.php:101 — PHUITimelineView.buildEvents has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-populate.JX.behavior("differential-populate") (cognitive 29) · ×1
  • behavior-populate.JX.behavior("differential-populate") (cognitive 29) webroot/rsrc/js/application/differential/behavior-populate.js:13 — behavior-populate.JX.behavior("differential-populate") has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 95, onredraw, get_lists). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-lightbox-attachments.JX.behavior("lightbox-attachments") (cognitive 29) · ×1
  • behavior-lightbox-attachments.JX.behavior("lightbox-attachments") (cognitive 29) webroot/rsrc/js/core/behavior-lightbox-attachments.js:12 — behavior-lightbox-attachments.JX.behavior("lightbox-attachments") has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 3, loops 2, match/switch 1, ternaries 1 (nesting depth added 3). None of this is in the body itself: all 29 points belong to 6 function items inside it that branch (activateLightbox, lightBoxHandleKeyDown, loadLightBox, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AphrontHTTPHeaderParser.getHeaderContentAsPairs (cognitive 28) · ×1
  • AphrontHTTPHeaderParser.getHeaderContentAsPairs (cognitive 28) src/aphront/headerparser/AphrontHTTPHeaderParser.php:34 — AphrontHTTPHeaderParser.getHeaderContentAsPairs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPHPPreflightSetupCheck.executeChecks (cognitive 28) · ×1
  • PhabricatorPHPPreflightSetupCheck.executeChecks (cognitive 28) src/applications/config/check/PhabricatorPHPPreflightSetupCheck.php:13 — PhabricatorPHPPreflightSetupCheck.executeChecks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialDiffCreateController.handleRequest (cognitive 28) · ×1
  • DifferentialDiffCreateController.handleRequest (cognitive 28) src/applications/differential/controller/DifferentialDiffCreateController.php:5 — DifferentialDiffCreateController.handleRequest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (25 pts), error handling 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.
D2 · Cognitive Complexity · DifferentialTransactionEditor.didApplyTransactions (cognitive 28) · ×1
  • DifferentialTransactionEditor.didApplyTransactions (cognitive 28) src/applications/differential/editor/DifferentialTransactionEditor.php:1529 — DifferentialTransactionEditor.didApplyTransactions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionQuery.buildWhereClause (cognitive 28) · ×1
  • DifferentialRevisionQuery.buildWhereClause (cognitive 28) src/applications/differential/query/DifferentialRevisionQuery.php:630 — DifferentialRevisionQuery.buildWhereClause has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (26 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DifferentialChangesetOneUpMailRenderer.renderPrimitives (cognitive 28) · ×1
  • DifferentialChangesetOneUpMailRenderer.renderPrimitives (cognitive 28) src/applications/differential/render/DifferentialChangesetOneUpMailRenderer.php:43 — DifferentialChangesetOneUpMailRenderer.renderPrimitives has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4, match/switch 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.
D2 · Cognitive Complexity · DifferentialRevisionReviewTransaction.isViewerReviewerStatusFully (cognitive 28) · ×1
  • DifferentialRevisionReviewTransaction.isViewerReviewerStatusFully (cognitive 28) src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php:97 — DifferentialRevisionReviewTransaction.isViewerReviewerStatusFully has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionBlameController.handleRequest (cognitive 28) · ×1
  • DiffusionBlameController.handleRequest (cognitive 28) src/applications/diffusion/controller/DiffusionBlameController.php:9 — DiffusionBlameController.handleRequest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 4 (5 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCompareController.handleRequest (cognitive 28) · ×1
  • DiffusionCompareController.handleRequest (cognitive 28) src/applications/diffusion/controller/DiffusionCompareController.php:9 — DiffusionCompareController.handleRequest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldRuleController.setupEditorBehavior (cognitive 28) · ×1
  • HeraldRuleController.setupEditorBehavior (cognitive 28) src/applications/herald/controller/HeraldRuleController.php:400 — HeraldRuleController.setupEditorBehavior has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 8 (11 pts), error handling 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTransactionEditor.getLockValidationErrors (cognitive 28) · ×1
  • ManiphestTransactionEditor.getLockValidationErrors (cognitive 28) src/applications/maniphest/editor/ManiphestTransactionEditor.php:774 — ManiphestTransactionEditor.getLockValidationErrors has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.execute (cognitive 28) · ×1
  • PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.execute (cognitive 28) src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:63 — PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementUnpublishWorkflow.unpublishEdgeTransaction (cognitive 28) · ×1
  • PhabricatorRepositoryManagementUnpublishWorkflow.unpublishEdgeTransaction (cognitive 28) src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php:154 — PhabricatorRepositoryManagementUnpublishWorkflow.unpublishEdgeTransaction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryGitCommitChangeParserWorker.parseCommitChanges (cognitive 28) · ×1
  • PhabricatorRepositoryGitCommitChangeParserWorker.parseCommitChanges (cognitive 28) src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php:6 — PhabricatorRepositoryGitCommitChangeParserWorker.parseCommitChanges has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 6, match/switch 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionView.buildEvents (cognitive 28) · ×1
  • PhabricatorApplicationTransactionView.buildEvents (cognitive 28) src/applications/transactions/view/PhabricatorApplicationTransactionView.php:129 — PhabricatorApplicationTransactionView.buildEvents has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilRemarkupTableBlockRule.newTable (cognitive 28) · ×1
  • PhutilRemarkupTableBlockRule.newTable (cognitive 28) src/infrastructure/markup/blockrule/PhutilRemarkupTableBlockRule.php:63 — PhutilRemarkupTableBlockRule.newTable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildApplicationSearchJoinClause (cognitive 28) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildApplicationSearchJoinClause (cognitive 28) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1535 — PhabricatorCursorPagedPolicyAwareQuery.buildApplicationSearchJoinClause has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRemarkupControl.renderInput (cognitive 28) · ×1
  • PhabricatorRemarkupControl.renderInput (cognitive 28) src/view/form/control/PhabricatorRemarkupControl.php:52 — PhabricatorRemarkupControl.renderInput has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (26 pts), loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _newHoverMap (cognitive 28) · ×1
  • _newHoverMap (cognitive 28) webroot/rsrc/js/application/diff/DiffChangesetList.js:1539 — _newHoverMap has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 5, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryController.handleRequest (cognitive 27) · ×1
  • DiffusionRepositoryController.handleRequest (cognitive 27) src/applications/diffusion/controller/DiffusionRepositoryController.php:13 — DiffusionRepositoryController.handleRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionSymbolController.handleRequest (cognitive 27) · ×1
  • DiffusionSymbolController.handleRequest (cognitive 27) src/applications/diffusion/controller/DiffusionSymbolController.php:5 — DiffusionSymbolController.handleRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (22 pts), error handling 1 (2 pts), loops 2, 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.
D2 · Cognitive Complexity · DivinerSymbolRemarkupRule.didMarkupText (cognitive 27) · ×1
  • DivinerSymbolRemarkupRule.didMarkupText (cognitive 27) src/applications/diviner/markup/DivinerSymbolRemarkupRule.php:87 — DivinerSymbolRemarkupRule.didMarkupText has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoorkeeperImportEngine.execute (cognitive 27) · ×1
  • DoorkeeperImportEngine.execute (cognitive 27) src/applications/doorkeeper/engine/DoorkeeperImportEngine.php:65 — DoorkeeperImportEngine.execute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (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.
D2 · Cognitive Complexity · PhabricatorJupyterDocumentEngine.newCells (cognitive 27) · ×1
  • PhabricatorJupyterDocumentEngine.newCells (cognitive 27) src/applications/files/document/PhabricatorJupyterDocumentEngine.php:307 — PhabricatorJupyterDocumentEngine.newCells has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (9 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFile.readPropertiesFromParameters (cognitive 27) · ×1
  • PhabricatorFile.readPropertiesFromParameters (cognitive 27) src/applications/files/storage/PhabricatorFile.php:1453 — PhabricatorFile.readPropertiesFromParameters has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (25 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.
D2 · Cognitive Complexity · HarbormasterPlanViewController.buildArtifactList (cognitive 27) · ×1
  • HarbormasterPlanViewController.buildArtifactList (cognitive 27) src/applications/harbormaster/controller/HarbormasterPlanViewController.php:284 — HarbormasterPlanViewController.buildArtifactList has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldEngine.applyEffects (cognitive 27) · ×1
  • HeraldEngine.applyEffects (cognitive 27) src/applications/herald/engine/HeraldEngine.php:258 — HeraldEngine.applyEffects has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorNotificationServersConfigType.validateStoredValue (cognitive 27) · ×1
  • PhabricatorNotificationServersConfigType.validateStoredValue (cognitive 27) REDACTED:8 — PhabricatorNotificationServersConfigType.validateStoredValue has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PholioInlineController.handleRequest (cognitive 27) · ×1
  • PholioInlineController.handleRequest (cognitive 27) src/applications/pholio/controller/PholioInlineController.php:5 — PholioInlineController.handleRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectEditController.handleRequest (cognitive 27) · ×1
  • PhabricatorProjectEditController.handleRequest (cognitive 27) src/applications/project/controller/PhabricatorProjectEditController.php:17 — PhabricatorProjectEditController.handleRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (27 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorProjectQuery.loadSlugs (cognitive 27) · ×1
  • PhabricatorProjectQuery.loadSlugs (cognitive 27) src/applications/project/query/PhabricatorProjectQuery.php:799 — PhabricatorProjectQuery.loadSlugs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectUserListView.render (cognitive 27) · ×1
  • PhabricatorProjectUserListView.render (cognitive 27) src/applications/project/view/PhabricatorProjectUserListView.php:55 — PhabricatorProjectUserListView.render has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationSearchController.processExportRequest (cognitive 27) · ×1
  • PhabricatorApplicationSearchController.processExportRequest (cognitive 27) src/applications/search/controller/PhabricatorApplicationSearchController.php:399 — PhabricatorApplicationSearchController.processExportRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (26 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.combineTransactions (cognitive 27) · ×1
  • PhabricatorApplicationTransactionEditor.combineTransactions (cognitive 27) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2430 — PhabricatorApplicationTransactionEditor.combineTransactions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 3 (5 pts), 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.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.filterTransactions (cognitive 27) · ×1
  • PhabricatorApplicationTransactionEditor.filterTransactions (cognitive 27) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2772 — PhabricatorApplicationTransactionEditor.filterTransactions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorTypeaheadCompositeDatasource.loadResultsForPhase (cognitive 27) · ×1
  • PhabricatorTypeaheadCompositeDatasource.loadResultsForPhase (cognitive 27) src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php:67 — PhabricatorTypeaheadCompositeDatasource.loadResultsForPhase has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorTypeaheadDatasource.renderTokens (cognitive 27) · ×1
  • PhabricatorTypeaheadDatasource.renderTokens (cognitive 27) src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php:274 — PhabricatorTypeaheadDatasource.renderTokens has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 6 (11 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEdgeQuery.execute (cognitive 27) · ×1
  • PhabricatorEdgeQuery.execute (cognitive 27) src/infrastructure/edges/query/PhabricatorEdgeQuery.php:167 — PhabricatorEdgeQuery.execute has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 6 (12 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhutilPygmentizeParser.parse (cognitive 27) · ×1
  • PhutilPygmentizeParser.parse (cognitive 27) src/infrastructure/parser/PhutilPygmentizeParser.php:20 — PhutilPygmentizeParser.parse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSSHPassthruCommand.execute (cognitive 27) · ×1
  • PhabricatorSSHPassthruCommand.execute (cognitive 27) src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php:87 — PhabricatorSSHPassthruCommand.execute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-line-linker.JX.behavior("phabricator-line-linker") (cognitive 27) · ×1
  • behavior-line-linker.JX.behavior("phabricator-line-linker") (cognitive 27) webroot/rsrc/js/core/behavior-line-linker.js:10 — behavior-line-linker.JX.behavior("phabricator-line-linker") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (19 pts), loops 3 (4 pts), error handling 2 (3 pts), ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 4 function items inside it that branch (highlight, a function literal at line 39, a function literal at line 138, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 27) · ×1
  • (anonymous) (cognitive 27) webroot/rsrc/js/core/behavior-line-linker.js:10 — (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (19 pts), loops 3 (4 pts), error handling 2 (3 pts), ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (highlight, a function literal at line 39, a function literal at line 138, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PhabricatorCalendarEventSearchEngine.getQueryDateRange (cognitive 26) · ×1
  • PhabricatorCalendarEventSearchEngine.getQueryDateRange (cognitive 26) src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:149 — PhabricatorCalendarEventSearchEngine.getQueryDateRange has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDashboardPanelTabsController.handleRequest (cognitive 26) · ×1
  • PhabricatorDashboardPanelTabsController.handleRequest (cognitive 26) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:17 — PhabricatorDashboardPanelTabsController.handleRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetHTMLRenderer.renderShowContextLinks (cognitive 26) · ×1
  • DifferentialChangesetHTMLRenderer.renderShowContextLinks (cognitive 26) src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:499 — DifferentialChangesetHTMLRenderer.renderShowContextLinks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (26 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLintController.handleRequest (cognitive 26) · ×1
  • DiffusionLintController.handleRequest (cognitive 26) src/applications/diffusion/controller/DiffusionLintController.php:9 — DiffusionLintController.handleRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (25 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DiffusionSetPasswordSettingsPanel.processRequest (cognitive 26) · ×1
  • DiffusionSetPasswordSettingsPanel.processRequest (cognitive 26) src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php:33 — DiffusionSetPasswordSettingsPanel.processRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (22 pts), error handling 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrydockLandRepositoryOperation.getBarrierToLanding (cognitive 26) · ×1
  • DrydockLandRepositoryOperation.getBarrierToLanding (cognitive 26) src/applications/drydock/operation/DrydockLandRepositoryOperation.php:225 — DrydockLandRepositoryOperation.getBarrierToLanding has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFileQuery.buildWhereClauseParts (cognitive 26) · ×1
  • PhabricatorFileQuery.buildWhereClauseParts (cognitive 26) src/applications/files/query/PhabricatorFileQuery.php:396 — PhabricatorFileQuery.buildWhereClauseParts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21 (24 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HarbormasterUIEventListener.handlePropertyEvent (cognitive 26) · ×1
  • HarbormasterUIEventListener.handlePropertyEvent (cognitive 26) src/applications/harbormaster/event/HarbormasterUIEventListener.php:18 — HarbormasterUIEventListener.handlePropertyEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 5 (9 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldRuleController.handleRequest (cognitive 26) · ×1
  • HeraldRuleController.handleRequest (cognitive 26) src/applications/herald/controller/HeraldRuleController.php:5 — HeraldRuleController.handleRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · HeraldRuleController.saveRule (cognitive 26) · ×1
  • HeraldRuleController.saveRule (cognitive 26) src/applications/herald/controller/HeraldRuleController.php:263 — HeraldRuleController.saveRule has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 4 (7 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTaskStatusTransaction.getTitle (cognitive 26) · ×1
  • ManiphestTaskStatusTransaction.getTitle (cognitive 26) src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:49 — ManiphestTaskStatusTransaction.getTitle has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 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. This shape REPEATS in the file: one other method here (ManiphestTaskStatusTransaction.getTitleForFeed) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ManiphestTaskStatusTransaction.getTitleForFeed (cognitive 26) · ×1
  • ManiphestTaskStatusTransaction.getTitleForFeed (cognitive 26) src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php:119 — ManiphestTaskStatusTransaction.getTitleForFeed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 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. This shape REPEATS in the file: one other method here (ManiphestTaskStatusTransaction.getTitle) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PhamePostListView.getTagContent (cognitive 26) · ×1
  • PhamePostListView.getTagContent (cognitive 26) src/applications/phame/view/PhamePostListView.php:49 — PhamePostListView.getTagContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhrictionDocumentController.renderDocumentChildren (cognitive 26) · ×1
  • PhrictionDocumentController.renderDocumentChildren (cognitive 26) src/applications/phriction/controller/PhrictionDocumentController.php:510 — PhrictionDocumentController.renderDocumentChildren has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 5 (8 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyQuery.loadPage (cognitive 26) · ×1
  • PhabricatorPolicyQuery.loadPage (cognitive 26) src/applications/policy/query/PhabricatorPolicyQuery.php:58 — PhabricatorPolicyQuery.loadPage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectTransaction.getTitle (cognitive 26) · ×1
  • PhabricatorProjectTransaction.getTitle (cognitive 26) src/applications/project/storage/PhabricatorProjectTransaction.php:77 — PhabricatorProjectTransaction.getTitle has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorSearchController.handleRequest (cognitive 26) · ×1
  • PhabricatorSearchController.handleRequest (cognitive 26) src/applications/search/controller/PhabricatorSearchController.php:12 — PhabricatorSearchController.handleRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorEditEngineSubtype.validateConfiguration (cognitive 26) · ×1
  • PhabricatorEditEngineSubtype.validateConfiguration (cognitive 26) src/applications/transactions/editengine/PhabricatorEditEngineSubtype.php:148 — PhabricatorEditEngineSubtype.validateConfiguration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMainMenuView.renderNotificationMenu (cognitive 26) · ×1
  • PhabricatorMainMenuView.renderNotificationMenu (cognitive 26) src/view/page/menu/PhabricatorMainMenuView.php:365 — PhabricatorMainMenuView.renderNotificationMenu has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIListItemView.getTagContent (cognitive 26) · ×1
  • PHUIListItemView.getTagContent (cognitive 26) src/view/phui/PHUIListItemView.php:286 — PHUIListItemView.getTagContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-object-selector.JX.behavior("phabricator-object-selector") (cognitive 26) · ×1
  • behavior-object-selector.JX.behavior("phabricator-object-selector") (cognitive 26) webroot/rsrc/js/core/behavior-object-selector.js:9 — behavior-object-selector.JX.behavior("phabricator-object-selector") has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 6 (8 pts), ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 7 function items inside it that branch (redrawList, onreceive, redrawAttached, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 26) · ×1
  • (anonymous) (cognitive 26) webroot/rsrc/js/core/behavior-object-selector.js:9 — (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 6 (8 pts), ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 11 function items inside it that branch (redrawList, onreceive, redrawAttached, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · sortHandler (cognitive 26) · ×1
  • sortHandler (cognitive 26) webroot/rsrc/js/core/Prefab.js:192 — sortHandler has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 221). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AphrontApplicationConfiguration.readHTTPPOSTData (cognitive 25) · ×1
  • AphrontApplicationConfiguration.readHTTPPOSTData (cognitive 25) REDACTED:800 — AphrontApplicationConfiguration.readHTTPPOSTData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSetupIssueView.renderPhabricatorConfig (cognitive 25) · ×1
  • PhabricatorSetupIssueView.renderPhabricatorConfig (cognitive 25) REDACTED:245 — PhabricatorSetupIssueView.renderPhabricatorConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (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.
D2 · Cognitive Complexity · DifferentialReviewersField.getWarningsForRevisionHeader (cognitive 25) · ×1
  • DifferentialReviewersField.getWarningsForRevisionHeader (cognitive 25) src/applications/differential/customfield/DifferentialReviewersField.php:68 — DifferentialReviewersField.getWarningsForRevisionHeader has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialTransactionEditor.didApplyHeraldRules (cognitive 25) · ×1
  • DifferentialTransactionEditor.didApplyHeraldRules (cognitive 25) src/applications/differential/editor/DifferentialTransactionEditor.php:1034 — DifferentialTransactionEditor.didApplyHeraldRules has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialDiffExtractionEngine.loadConcerningBuilds (cognitive 25) · ×1
  • DifferentialDiffExtractionEngine.loadConcerningBuilds (cognitive 25) src/applications/differential/engine/DifferentialDiffExtractionEngine.php:335 — DifferentialDiffExtractionEngine.loadConcerningBuilds has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (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.
D2 · Cognitive Complexity · DiffusionBrowseController.browseFile (cognitive 25) · ×1
  • DiffusionBrowseController.browseFile (cognitive 25) src/applications/diffusion/controller/DiffusionBrowseController.php:100 — DiffusionBrowseController.browseFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionExternalController.handleRequest (cognitive 25) · ×1
  • DiffusionExternalController.handleRequest (cognitive 25) src/applications/diffusion/controller/DiffusionExternalController.php:9 — DiffusionExternalController.handleRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryURICredentialController.handleRequest (cognitive 25) · ×1
  • DiffusionRepositoryURICredentialController.handleRequest (cognitive 25) src/applications/diffusion/controller/DiffusionRepositoryURICredentialController.php:6 — DiffusionRepositoryURICredentialController.handleRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (25 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionServeController.serveGitLFSBatchRequest (cognitive 25) · ×1
  • DiffusionServeController.serveGitLFSBatchRequest (cognitive 25) src/applications/diffusion/controller/DiffusionServeController.php:1068 — DiffusionServeController.serveGitLFSBatchRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionBranchListView.render (cognitive 25) · ×1
  • DiffusionBranchListView.render (cognitive 25) src/applications/diffusion/view/DiffusionBranchListView.php:20 — DiffusionBranchListView.render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionPatternSearchView.render (cognitive 25) · ×1
  • DiffusionPatternSearchView.render (cognitive 25) src/applications/diffusion/view/DiffusionPatternSearchView.php:24 — DiffusionPatternSearchView.render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerAtomController.renderFullSignature (cognitive 25) · ×1
  • DivinerAtomController.renderFullSignature (cognitive 25) src/applications/diviner/controller/DivinerAtomController.php:479 — DivinerAtomController.renderFullSignature has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 5 (7 pts), loops 1 (3 pts), ternaries 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerAtomizeWorkflow.execute (cognitive 25) · ×1
  • DivinerAtomizeWorkflow.execute (cognitive 25) src/applications/diviner/workflow/DivinerAtomizeWorkflow.php:32 — DivinerAtomizeWorkflow.execute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorTransactionFactEngine.groupTransactions (cognitive 25) · ×1
  • PhabricatorTransactionFactEngine.groupTransactions (cognitive 25) src/applications/fact/engine/PhabricatorTransactionFactEngine.php:21 — PhabricatorTransactionFactEngine.groupTransactions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMemeEngine.getMetrics (cognitive 25) · ×1
  • PhabricatorMemeEngine.getMetrics (cognitive 25) src/applications/macro/engine/PhabricatorMemeEngine.php:308 — PhabricatorMemeEngine.getMetrics has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationPolicyChangeTransaction.validateTransactions (cognitive 25) · ×1
  • PhabricatorApplicationPolicyChangeTransaction.validateTransactions (cognitive 25) src/applications/meta/xactions/PhabricatorApplicationPolicyChangeTransaction.php:73 — PhabricatorApplicationPolicyChangeTransaction.validateTransactions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (5 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.
D2 · Cognitive Complexity · PhabricatorMailSMTPAdapter.sendMessage (cognitive 25) · ×1
  • PhabricatorMailSMTPAdapter.sendMessage (cognitive 25) REDACTED:47 — PhabricatorMailSMTPAdapter.sendMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 4 (8 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorMailManagementShowInboundWorkflow.execute (cognitive 25) · ×1
  • PhabricatorMailManagementShowInboundWorkflow.execute (cognitive 25) src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php:23 — PhabricatorMailManagementShowInboundWorkflow.execute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortuneAccountEditor.validateTransaction (cognitive 25) · ×1
  • PhortuneAccountEditor.validateTransaction (cognitive 25) src/applications/phortune/editor/PhortuneAccountEditor.php:24 — PhortuneAccountEditor.validateTransaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (14 pts), loops 2 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhrequentTimeBlock.sortTimeline (cognitive 25) · ×1
  • PhrequentTimeBlock.sortTimeline (cognitive 25) src/applications/phrequent/storage/PhrequentTimeBlock.php:291 — PhrequentTimeBlock.sortTimeline has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 7 (9 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicy.getSpecialRules (cognitive 25) · ×1
  • PhabricatorPolicy.getSpecialRules (cognitive 25) src/applications/policy/storage/PhabricatorPolicy.php:441 — PhabricatorPolicy.getSpecialRules has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 1 (2 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.
D2 · Cognitive Complexity · PhabricatorProjectColumnHideController.handleRequest (cognitive 25) · ×1
  • PhabricatorProjectColumnHideController.handleRequest (cognitive 25) src/applications/project/controller/PhabricatorProjectColumnHideController.php:6 — PhabricatorProjectColumnHideController.handleRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransaction.shouldDisplayGroupWith (cognitive 25) · ×1
  • PhabricatorApplicationTransaction.shouldDisplayGroupWith (cognitive 25) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1684 — PhabricatorApplicationTransaction.shouldDisplayGroupWith has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionCommentView.renderCommentPanel (cognitive 25) · ×1
  • PhabricatorApplicationTransactionCommentView.renderCommentPanel (cognitive 25) src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php:296 — PhabricatorApplicationTransactionCommentView.renderCommentPanel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorInlineSummaryView.renderTable (cognitive 25) · ×1
  • PhabricatorInlineSummaryView.renderTable (cognitive 25) src/infrastructure/diff/view/PhabricatorInlineSummaryView.php:21 — PhabricatorInlineSummaryView.renderTable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (6 pts), loops 3 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildApplicationSearchWhereClause (cognitive 25) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildApplicationSearchWhereClause (cognitive 25) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1657 — PhabricatorCursorPagedPolicyAwareQuery.buildApplicationSearchWhereClause has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 3 (11 pts), if/else 3 (9 pts), loops 2 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUICrumbsView.render (cognitive 25) · ×1
  • PHUICrumbsView.render (cognitive 25) src/view/phui/PHUICrumbsView.php:48 — PHUICrumbsView.render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-policy-control.JX.behavior("policy-control") (cognitive 25) · ×1
  • behavior-policy-control.JX.behavior("policy-control") (cognitive 25) webroot/rsrc/js/application/policy/behavior-policy-control.js:13 — behavior-policy-control.JX.behavior("policy-control") has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (6 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 30, add_policy, render_option, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-audio-source.JX.behavior("audio-source") · ×1
  • behavior-audio-source.JX.behavior("audio-source")::onupdate (cognitive 25) webroot/rsrc/js/core/behavior-audio-source.js:39 — behavior-audio-source.JX.behavior("audio-source")::onupdate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-watch-anchor.JX.behavior("phabricator-watch-anchor") · ×1
  • behavior-watch-anchor.JX.behavior("phabricator-watch-anchor")::seek_anchor (cognitive 25) webroot/rsrc/js/core/behavior-watch-anchor.js:34 — behavior-watch-anchor.JX.behavior("phabricator-watch-anchor")::seek_anchor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 3 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buildTokenizer (cognitive 25) · ×1
  • buildTokenizer (cognitive 25) webroot/rsrc/js/core/Prefab.js:73 — buildTokenizer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, boolean chains 9, error handling 1. Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 113). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ConpherenceListController.handleRequest (cognitive 24) · ×1
  • ConpherenceListController.handleRequest (cognitive 24) src/applications/conpherence/controller/ConpherenceListController.php:32 — ConpherenceListController.handleRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (2 pts), match/switch 2 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DifferentialRevisionReviewersTransaction.generateNewValue (cognitive 24) · ×1
  • DifferentialRevisionReviewersTransaction.generateNewValue (cognitive 24) src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:15 — DifferentialRevisionReviewersTransaction.generateNewValue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionSubversionServeSSHWorkflow.willReadMessageCallback (cognitive 24) · ×1
  • DiffusionSubversionServeSSHWorkflow.willReadMessageCallback (cognitive 24) src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php:278 — DiffusionSubversionServeSSHWorkflow.willReadMessageCallback has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (6 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionSourceLinkView.render (cognitive 24) · ×1
  • DiffusionSourceLinkView.render (cognitive 24) src/applications/diffusion/view/DiffusionSourceLinkView.php:157 — DiffusionSourceLinkView.render has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorChartFunctionArgumentParser.parseArguments (cognitive 24) · ×1
  • PhabricatorChartFunctionArgumentParser.parseArguments (cognitive 24) src/applications/fact/chart/PhabricatorChartFunctionArgumentParser.php:111 — PhabricatorChartFunctionArgumentParser.parseArguments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuildLog.updateLineMap (cognitive 24) · ×1
  • HarbormasterBuildLog.updateLineMap (cognitive 24) src/applications/harbormaster/storage/build/HarbormasterBuildLog.php:552 — HarbormasterBuildLog.updateLineMap has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldTranscriptController.getTranscriptPHIDs (cognitive 24) · ×1
  • HeraldTranscriptController.getTranscriptPHIDs (cognitive 24) src/applications/herald/controller/HeraldTranscriptController.php:131 — HeraldTranscriptController.getTranscriptPHIDs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (9 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LegalpadDocumentSignatureSearchEngine.renderResultList (cognitive 24) · ×1
  • LegalpadDocumentSignatureSearchEngine.renderResultList (cognitive 24) src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php:150 — LegalpadDocumentSignatureSearchEngine.renderResultList has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorImageMacroRemarkupRule.didMarkupText (cognitive 24) · ×1
  • PhabricatorImageMacroRemarkupRule.didMarkupText (cognitive 24) src/applications/macro/markup/PhabricatorImageMacroRemarkupRule.php:52 — PhabricatorImageMacroRemarkupRule.didMarkupText has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NuanceGitHubRawEvent.getTargetObjectName (cognitive 24) · ×1
  • NuanceGitHubRawEvent.getTargetObjectName (cognitive 24) src/applications/nuance/github/NuanceGitHubRawEvent.php:244 — NuanceGitHubRawEvent.getTargetObjectName has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (9 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorOAuthServerAuthController.handleRequest (cognitive 24) · ×1
  • PhabricatorOAuthServerAuthController.handleRequest (cognitive 24) src/applications/oauthserver/controller/PhabricatorOAuthServerAuthController.php:12 — PhabricatorOAuthServerAuthController.handleRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (20 pts), error handling 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PholioMockThumbGridView.render (cognitive 24) · ×1
  • PholioMockThumbGridView.render (cognitive 24) src/applications/pholio/view/PholioMockThumbGridView.php:12 — PholioMockThumbGridView.render has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortunePayPalPaymentProvider.processControllerRequest (cognitive 24) · ×1
  • PhortunePayPalPaymentProvider.processControllerRequest (cognitive 24) src/applications/phortune/provider/PhortunePayPalPaymentProvider.php:287 — PhortunePayPalPaymentProvider.processControllerRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectMembersViewController.buildCurtainView (cognitive 24) · ×1
  • PhabricatorProjectMembersViewController.buildCurtainView (cognitive 24) src/applications/project/controller/PhabricatorProjectMembersViewController.php:70 — PhabricatorProjectMembersViewController.buildCurtainView has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorProjectTriggerEditController.handleRequest (cognitive 24) · ×1
  • PhabricatorProjectTriggerEditController.handleRequest (cognitive 24) src/applications/project/controller/trigger/PhabricatorProjectTriggerEditController.php:6 — PhabricatorProjectTriggerEditController.handleRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (22 pts), error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorBoardLayoutEngine.loadColumns (cognitive 24) · ×1
  • PhabricatorBoardLayoutEngine.loadColumns (cognitive 24) src/applications/project/engine/PhabricatorBoardLayoutEngine.php:321 — PhabricatorBoardLayoutEngine.loadColumns has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (8 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryRefEngine.loadNewCommitIdentifiers (cognitive 24) · ×1
  • PhabricatorRepositoryRefEngine.loadNewCommitIdentifiers (cognitive 24) src/applications/repository/engine/PhabricatorRepositoryRefEngine.php:414 — PhabricatorRepositoryRefEngine.loadNewCommitIdentifiers has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (13 pts), if/else 6 (10 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorMultiFactorSettingsPanel.processNew (cognitive 24) · ×1
  • PhabricatorMultiFactorSettingsPanel.processNew (cognitive 24) src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php:175 — PhabricatorMultiFactorSettingsPanel.processNew has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.applyCapabilityChecks (cognitive 24) · ×1
  • PhabricatorApplicationTransactionEditor.applyCapabilityChecks (cognitive 24) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1841 — PhabricatorApplicationTransactionEditor.applyCapabilityChecks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.buildSubscribeTransaction (cognitive 24) · ×1
  • PhabricatorApplicationTransactionEditor.buildSubscribeTransaction (cognitive 24) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2039 — PhabricatorApplicationTransactionEditor.buildSubscribeTransaction has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.getMailCC (cognitive 24) · ×1
  • PhabricatorApplicationTransactionEditor.getMailCC (cognitive 24) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3730 — PhabricatorApplicationTransactionEditor.getMailCC has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (11 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.newMFATransactions (cognitive 24) · ×1
  • PhabricatorApplicationTransactionEditor.newMFATransactions (cognitive 24) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:5514 — PhabricatorApplicationTransactionEditor.newMFATransactions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionWarningResponse.reduceProxyResponse (cognitive 24) · ×1
  • PhabricatorApplicationTransactionWarningResponse.reduceProxyResponse (cognitive 24) src/applications/transactions/response/PhabricatorApplicationTransactionWarningResponse.php:39 — PhabricatorApplicationTransactionWarningResponse.reduceProxyResponse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 5 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngineConfiguration.applyConfigurationToFields (cognitive 24) · ×1
  • PhabricatorEditEngineConfiguration.applyConfigurationToFields (cognitive 24) src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php:132 — PhabricatorEditEngineConfiguration.applyConfigurationToFields has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorWorkerLeaseQuery.execute (cognitive 24) · ×1
  • PhabricatorWorkerLeaseQuery.execute (cognitive 24) src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php:75 — PhabricatorWorkerLeaseQuery.execute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorStorageManagementWorkflow.printErrors (cognitive 24) · ×1
  • PhabricatorStorageManagementWorkflow.printErrors (cognitive 24) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:776 — PhabricatorStorageManagementWorkflow.printErrors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AphrontDialogView.render (cognitive 24) · ×1
  • AphrontDialogView.render (cognitive 24) src/view/AphrontDialogView.php:255 — AphrontDialogView.render has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (18 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · behavior-durable-column.JX.behavior("durable-column") (cognitive 24) · ×1
  • behavior-durable-column.JX.behavior("durable-column") (cognitive 24) webroot/rsrc/js/application/conpherence/behavior-durable-column.js:13 — behavior-durable-column.JX.behavior("durable-column") has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (18 pts), ternaries 4, loops 1, match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 334, _drawColumn, _minimizeColumn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-project-boards.JX.behavior("project-boards") (cognitive 24) · ×1
  • behavior-project-boards.JX.behavior("project-boards") (cognitive 24) webroot/rsrc/js/application/projects/behavior-project-boards.js:13 — behavior-project-boards.JX.behavior("project-boards") has cognitive complexity 24 (threshold 15). Drivers by points: loops 12 (16 pts), if/else 7 (8 pts) (nesting depth added 5). Of this number, 19 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _onresults (cognitive 24) · ×1
  • _onresults (cognitive 24) webroot/rsrc/js/phuix/PHUIXAutocomplete.js:230 — _onresults has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (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.
D2 · Cognitive Complexity · buildPaths (cognitive 24) · ×1
  • buildPaths (cognitive 24) webroot/rsrc/js/application/diffusion/DiffusionLocateFileSource.js:219 — buildPaths has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AphrontApplicationConfiguration.buildController (cognitive 23) · ×1
  • AphrontApplicationConfiguration.buildController (cognitive 23) REDACTED:394 — AphrontApplicationConfiguration.buildController has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceRule.nextDay (cognitive 23) · ×1
  • PhutilCalendarRecurrenceRule.nextDay (cognitive 23) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:900 — PhutilCalendarRecurrenceRule.nextDay has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConfigDatabaseStatusController.renderTable (cognitive 23) · ×1
  • PhabricatorConfigDatabaseStatusController.renderTable (cognitive 23) src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:332 — PhabricatorConfigDatabaseStatusController.renderTable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 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.
D2 · Cognitive Complexity · ConpherenceThreadQuery.loadPage (cognitive 23) · ×1
  • ConpherenceThreadQuery.loadPage (cognitive 23) src/applications/conpherence/query/ConpherenceThreadQuery.php:79 — ConpherenceThreadQuery.loadPage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (3 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorLockLogManagementWorkflow.execute (cognitive 23) · ×1
  • PhabricatorLockLogManagementWorkflow.execute (cognitive 23) src/applications/daemon/management/PhabricatorLockLogManagementWorkflow.php:28 — PhabricatorLockLogManagementWorkflow.execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDifferentialMigrateHunkWorkflow.execute (cognitive 23) · ×1
  • PhabricatorDifferentialMigrateHunkWorkflow.execute (cognitive 23) src/applications/differential/management/PhabricatorDifferentialMigrateHunkWorkflow.php:40 — PhabricatorDifferentialMigrateHunkWorkflow.execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialLineAdjustmentMap.newInverseMap (cognitive 23) · ×1
  • DifferentialLineAdjustmentMap.newInverseMap (cognitive 23) src/applications/differential/parser/DifferentialLineAdjustmentMap.php:213 — DifferentialLineAdjustmentMap.newInverseMap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (8 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionAcceptTransaction.getActionOptions (cognitive 23) · ×1
  • DifferentialRevisionAcceptTransaction.getActionOptions (cognitive 23) src/applications/differential/xaction/DifferentialRevisionAcceptTransaction.php:55 — DifferentialRevisionAcceptTransaction.getActionOptions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionBrowseQueryConduitAPIMethod.getMercurialResult (cognitive 23) · ×1
  • DiffusionBrowseQueryConduitAPIMethod.getMercurialResult (cognitive 23) src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:267 — DiffusionBrowseQueryConduitAPIMethod.getMercurialResult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLintController.loadLintCodes (cognitive 23) · ×1
  • DiffusionLintController.loadLintCodes (cognitive 23) src/applications/diffusion/controller/DiffusionLintController.php:219 — DiffusionLintController.loadLintCodes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLowLevelCommitQuery.loadGitCommitRef (cognitive 23) · ×1
  • DiffusionLowLevelCommitQuery.loadGitCommitRef (cognitive 23) src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php:41 — DiffusionLowLevelCommitQuery.loadGitCommitRef has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerAtomController.buildParametersAndReturn (cognitive 23) · ×1
  • DivinerAtomController.buildParametersAndReturn (cognitive 23) src/applications/diviner/controller/DivinerAtomController.php:575 — DivinerAtomController.buildParametersAndReturn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoorkeeperJIRAFeedWorker.publishFeedStory (cognitive 23) · ×1
  • DoorkeeperJIRAFeedWorker.publishFeedStory (cognitive 23) src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php:26 — DoorkeeperJIRAFeedWorker.publishFeedStory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrydockManagementLeaseWorkflow.execute (cognitive 23) · ×1
  • DrydockManagementLeaseWorkflow.execute (cognitive 23) src/applications/drydock/management/DrydockManagementLeaseWorkflow.php:44 — DrydockManagementLeaseWorkflow.execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorChartDataQuery.selectInputValues (cognitive 23) · ×1
  • PhabricatorChartDataQuery.selectInputValues (cognitive 23) src/applications/fact/chart/PhabricatorChartDataQuery.php:37 — PhabricatorChartDataQuery.selectInputValues has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorChartStackedAreaDataset.getGeometry (cognitive 23) · ×1
  • PhabricatorChartStackedAreaDataset.getGeometry (cognitive 23) src/applications/fact/chart/PhabricatorChartStackedAreaDataset.php:234 — PhabricatorChartStackedAreaDataset.getGeometry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorKeyringConfigOptionType.validateOption (cognitive 23) · ×1
  • PhabricatorKeyringConfigOptionType.validateOption (cognitive 23) src/applications/files/keyring/PhabricatorKeyringConfigOptionType.php:6 — PhabricatorKeyringConfigOptionType.validateOption has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (2 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuildLogRenderController.mergeOverlappingViews (cognitive 23) · ×1
  • HarbormasterBuildLogRenderController.mergeOverlappingViews (cognitive 23) src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:558 — HarbormasterBuildLogRenderController.mergeOverlappingViews has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 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.
D2 · Cognitive Complexity · HarbormasterStepEditController.handleRequest (cognitive 23) · ×1
  • HarbormasterStepEditController.handleRequest (cognitive 23) src/applications/harbormaster/controller/HarbormasterStepEditController.php:6 — HarbormasterStepEditController.handleRequest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorAppSearchEngine.renderResultList (cognitive 23) · ×1
  • PhabricatorAppSearchEngine.renderResultList (cognitive 23) src/applications/meta/query/PhabricatorAppSearchEngine.php:181 — PhabricatorAppSearchEngine.renderResultList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorOAuthServerTokenController.handleRequest (cognitive 23) · ×1
  • PhabricatorOAuthServerTokenController.handleRequest (cognitive 23) src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php:17 — PhabricatorOAuthServerTokenController.handleRequest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorPeopleUserPHIDType.loadHandles (cognitive 23) · ×1
  • PhabricatorPeopleUserPHIDType.loadHandles (cognitive 23) src/applications/people/phid/PhabricatorPeopleUserPHIDType.php:34 — PhabricatorPeopleUserPHIDType.loadHandles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorProjectQuery.didFilterPage (cognitive 23) · ×1
  • PhabricatorProjectQuery.didFilterPage (cognitive 23) src/applications/project/query/PhabricatorProjectQuery.php:385 — PhabricatorProjectQuery.didFilterPage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (11 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectLogicalAncestorDatasource.didEvaluateTokens (cognitive 23) · ×1
  • PhabricatorProjectLogicalAncestorDatasource.didEvaluateTokens (cognitive 23) src/applications/project/typeahead/PhabricatorProjectLogicalAncestorDatasource.php:24 — PhabricatorProjectLogicalAncestorDatasource.didEvaluateTokens has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (9 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.
D2 · Cognitive Complexity · ProjectBoardTaskCard.getItem (cognitive 23) · ×1
  • ProjectBoardTaskCard.getItem (cognitive 23) src/applications/project/view/ProjectBoardTaskCard.php:83 — ProjectBoardTaskCard.getItem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.rebuildIdentities (cognitive 23) · ×1
  • PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.rebuildIdentities (cognitive 23) src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:330 — PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.rebuildIdentities has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProfileMenuItemView.newListItemView (cognitive 23) · ×1
  • PhabricatorProfileMenuItemView.newListItemView (cognitive 23) src/applications/search/engine/PhabricatorProfileMenuItemView.php:138 — PhabricatorProfileMenuItemView.newListItemView has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (5 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.
D2 · Cognitive Complexity · PhabricatorDestructionEngine.destroyObject (cognitive 23) · ×1
  • PhabricatorDestructionEngine.destroyObject (cognitive 23) src/applications/system/engine/PhabricatorDestructionEngine.php:34 — PhabricatorDestructionEngine.destroyObject has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3 (7 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.getTransactionOldValue (cognitive 23) · ×1
  • PhabricatorApplicationTransactionEditor.getTransactionOldValue (cognitive 23) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:490 — PhabricatorApplicationTransactionEditor.getTransactionOldValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.applyBuiltinExternalTransaction (cognitive 23) · ×1
  • PhabricatorApplicationTransactionEditor.applyBuiltinExternalTransaction (cognitive 23) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:904 — PhabricatorApplicationTransactionEditor.applyBuiltinExternalTransaction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.expandRemarkupBlockTransactions (cognitive 23) · ×1
  • PhabricatorApplicationTransactionEditor.expandRemarkupBlockTransactions (cognitive 23) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2348 — PhabricatorApplicationTransactionEditor.expandRemarkupBlockTransactions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.validateFileTransactions (cognitive 23) · ×1
  • PhabricatorApplicationTransactionEditor.validateFileTransactions (cognitive 23) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2942 — PhabricatorApplicationTransactionEditor.validateFileTransactions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.applyProjectConflictRules (cognitive 23) · ×1
  • PhabricatorApplicationTransactionEditor.applyProjectConflictRules (cognitive 23) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:4755 — PhabricatorApplicationTransactionEditor.applyProjectConflictRules has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCustomField.buildFieldList (cognitive 23) · ×1
  • PhabricatorCustomField.buildFieldList (cognitive 23) src/infrastructure/customfield/field/PhabricatorCustomField.php:125 — PhabricatorCustomField.buildFieldList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qsprintf.qsprintf_check_scalar_type (cognitive 23) · ×1
  • qsprintf.qsprintf_check_scalar_type (cognitive 23) src/infrastructure/storage/xsprintf/qsprintf.php:398 — qsprintf.qsprintf_check_scalar_type has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _onmove (cognitive 23) · ×1
  • _onmove (cognitive 23) webroot/rsrc/js/core/DraggableList.js:486 — _onmove has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _redrawBanner (cognitive 23) · ×1
  • _redrawBanner (cognitive 23) webroot/rsrc/js/application/diff/DiffChangesetList.js:1817 — _redrawBanner has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorAuthOneTimeLoginController.handleRequest (cognitive 22) · ×1
  • PhabricatorAuthOneTimeLoginController.handleRequest (cognitive 22) src/applications/auth/controller/PhabricatorAuthOneTimeLoginController.php:10 — PhabricatorAuthOneTimeLoginController.handleRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthSSHKeyEditor.validateTransaction (cognitive 22) · ×1
  • PhabricatorAuthSSHKeyEditor.validateTransaction (cognitive 22) src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:101 — PhabricatorAuthSSHKeyEditor.validateTransaction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts), error handling 1 (4 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorAuthSSHPrivateKey.newBarePrivateKey (cognitive 22) · ×1
  • PhabricatorAuthSSHPrivateKey.newBarePrivateKey (cognitive 22) src/applications/auth/sshkey/PhabricatorAuthSSHPrivateKey.php:36 — PhabricatorAuthSSHPrivateKey.newBarePrivateKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorCalendarEventQuery.buildWhereClauseParts (cognitive 22) · ×1
  • PhabricatorCalendarEventQuery.buildWhereClauseParts (cognitive 22) src/applications/calendar/query/PhabricatorCalendarEventQuery.php:357 — PhabricatorCalendarEventQuery.buildWhereClauseParts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19 (20 pts), loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorDashboardQueryPanelInstallController.handleRequest (cognitive 22) · ×1
  • PhabricatorDashboardQueryPanelInstallController.handleRequest (cognitive 22) src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php:6 — PhabricatorDashboardQueryPanelInstallController.handleRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (22 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialCreateInlineConduitAPIMethod.execute (cognitive 22) · ×1
  • DifferentialCreateInlineConduitAPIMethod.execute (cognitive 22) src/applications/differential/conduit/DifferentialCreateInlineConduitAPIMethod.php:45 — DifferentialCreateInlineConduitAPIMethod.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialTransactionEditor.expandCustomRemarkupBlockTransactions (cognitive 22) · ×1
  • DifferentialTransactionEditor.expandCustomRemarkupBlockTransactions (cognitive 22) src/applications/differential/editor/DifferentialTransactionEditor.php:807 — DifferentialTransactionEditor.expandCustomRemarkupBlockTransactions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 8 (11 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialInlineCommentMailView.buildMailSection (cognitive 22) · ×1
  • DifferentialInlineCommentMailView.buildMailSection (cognitive 22) src/applications/differential/mail/DifferentialInlineCommentMailView.php:29 — DifferentialInlineCommentMailView.buildMailSection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetDetailView.render (cognitive 22) · ×1
  • DifferentialChangesetDetailView.render (cognitive 22) src/applications/differential/view/DifferentialChangesetDetailView.php:105 — DifferentialChangesetDetailView.render has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (22 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialTransactionView.renderTransactionContent (cognitive 22) · ×1
  • DifferentialTransactionView.renderTransactionContent (cognitive 22) src/applications/differential/view/DifferentialTransactionView.php:82 — DifferentialTransactionView.renderTransactionContent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLintSaveRunner.runArcLint (cognitive 22) · ×1
  • DiffusionLintSaveRunner.runArcLint (cognitive 22) src/applications/diffusion/DiffusionLintSaveRunner.php:157 — DiffusionLintSaveRunner.runArcLint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionSubversionServeSSHWorkflow.willWriteMessageCallback (cognitive 22) · ×1
  • DiffusionSubversionServeSSHWorkflow.willWriteMessageCallback (cognitive 22) src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php:197 — DiffusionSubversionServeSSHWorkflow.willWriteMessageCallback has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionPushLogListView.render (cognitive 22) · ×1
  • DiffusionPushLogListView.render (cognitive 22) src/applications/diffusion/view/DiffusionPushLogListView.php:13 — DiffusionPushLogListView.render has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 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.
D2 · Cognitive Complexity · DoorkeeperBridgeGitHubUser.pullRefs (cognitive 22) · ×1
  • DoorkeeperBridgeGitHubUser.pullRefs (cognitive 22) src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php:20 — DoorkeeperBridgeGitHubUser.pullRefs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3, boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFileDataController.handleRequest (cognitive 22) · ×1
  • PhabricatorFileDataController.handleRequest (cognitive 22) src/applications/files/controller/PhabricatorFileDataController.php:17 — PhabricatorFileDataController.handleRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorEmbedFileRemarkupRule.renderImageFile (cognitive 22) · ×1
  • PhabricatorEmbedFileRemarkupRule.renderImageFile (cognitive 22) src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php:129 — PhabricatorEmbedFileRemarkupRule.renderImageFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 3 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestEditEngine.getColumnMap (cognitive 22) · ×1
  • ManiphestEditEngine.getColumnMap (cognitive 22) src/applications/maniphest/editor/ManiphestEditEngine.php:466 — ManiphestEditEngine.getColumnMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (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.
D2 · Cognitive Complexity · PhabricatorMetaMTAMail.sendWithMailers (cognitive 22) · ×1
  • PhabricatorMetaMTAMail.sendWithMailers (cognitive 22) src/applications/metamta/storage/PhabricatorMetaMTAMail.php:674 — PhabricatorMetaMTAMail.sendWithMailers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 3 (6 pts), loops 4 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPasteRemarkupRule.renderObjectEmbed (cognitive 22) · ×1
  • PhabricatorPasteRemarkupRule.renderObjectEmbed (cognitive 22) src/applications/paste/remarkup/PhabricatorPasteRemarkupRule.php:20 — PhabricatorPasteRemarkupRule.renderObjectEmbed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (7 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhameBlogQuery.didFilterPage (cognitive 22) · ×1
  • PhameBlogQuery.didFilterPage (cognitive 22) src/applications/phame/query/PhameBlogQuery.php:82 — PhameBlogQuery.didFilterPage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortuneMerchantInvoiceCreateController.handleMerchantRequest (cognitive 22) · ×1
  • PhortuneMerchantInvoiceCreateController.handleMerchantRequest (cognitive 22) src/applications/phortune/controller/merchant/PhortuneMerchantInvoiceCreateController.php:10 — PhortuneMerchantInvoiceCreateController.handleMerchantRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortuneOrderSummaryView.newMessagesView (cognitive 22) · ×1
  • PhortuneOrderSummaryView.newMessagesView (cognitive 22) src/applications/phortune/view/PhortuneOrderSummaryView.php:49 — PhortuneOrderSummaryView.newMessagesView has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortuneOrderTableView.render (cognitive 22) · ×1
  • PhortuneOrderTableView.render (cognitive 22) src/applications/phortune/view/PhortuneOrderTableView.php:56 — PhortuneOrderTableView.render has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectHeraldAction.applyProjects (cognitive 22) · ×1
  • PhabricatorProjectHeraldAction.applyProjects (cognitive 22) src/applications/project/herald/PhabricatorProjectHeraldAction.php:21 — PhabricatorProjectHeraldAction.applyProjects has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementClusterizeWorkflow.execute (cognitive 22) · ×1
  • PhabricatorRepositoryManagementClusterizeWorkflow.execute (cognitive 22) src/applications/repository/management/PhabricatorRepositoryManagementClusterizeWorkflow.php:32 — PhabricatorRepositoryManagementClusterizeWorkflow.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2 (3 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.
D2 · Cognitive Complexity · PhabricatorRepositoryCommitPublishWorker.shouldTriggerAudit (cognitive 22) · ×1
  • PhabricatorRepositoryCommitPublishWorker.shouldTriggerAudit (cognitive 22) src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:229 — PhabricatorRepositoryCommitPublishWorker.shouldTriggerAudit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorSearchEditController.handleRequest (cognitive 22) · ×1
  • PhabricatorSearchEditController.handleRequest (cognitive 22) src/applications/search/controller/PhabricatorSearchEditController.php:6 — PhabricatorSearchEditController.handleRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFerretFulltextEngineExtension.updateStoredNgrams (cognitive 22) · ×1
  • PhabricatorFerretFulltextEngineExtension.updateStoredNgrams (cognitive 22) src/applications/search/engineextension/PhabricatorFerretFulltextEngineExtension.php:341 — PhabricatorFerretFulltextEngineExtension.updateStoredNgrams has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 6 (10 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSearchManagementIndexWorkflow.getIndexableObjectsByTypes (cognitive 22) · ×1
  • PhabricatorSearchManagementIndexWorkflow.getIndexableObjectsByTypes (cognitive 22) src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:317 — PhabricatorSearchManagementIndexWorkflow.getIndexableObjectsByTypes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSettingsMainController.buildPanels (cognitive 22) · ×1
  • PhabricatorSettingsMainController.buildPanels (cognitive 22) src/applications/settings/controller/PhabricatorSettingsMainController.php:139 — PhabricatorSettingsMainController.buildPanels has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorWorkerTriggerQuery.loadPage (cognitive 22) · ×1
  • PhabricatorWorkerTriggerQuery.loadPage (cognitive 22) src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php:80 — PhabricatorWorkerTriggerQuery.loadPage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), error handling 2 (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.
D2 · Cognitive Complexity · PhutilProseDiff.reorderParts (cognitive 22) · ×1
  • PhutilProseDiff.reorderParts (cognitive 22) src/infrastructure/diff/prose/PhutilProseDiff.php:79 — PhutilProseDiff.reorderParts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDiffInlineCommentQuery.loadInlineCommentContext (cognitive 22) · ×1
  • PhabricatorDiffInlineCommentQuery.loadInlineCommentContext (cognitive 22) src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php:281 — PhabricatorDiffInlineCommentQuery.loadInlineCommentContext has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (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.
D2 · Cognitive Complexity · PhabricatorChangesetViewStateEngine.updateHiddenState (cognitive 22) · ×1
  • PhabricatorChangesetViewStateEngine.updateHiddenState (cognitive 22) src/infrastructure/diff/viewstate/PhabricatorChangesetViewStateEngine.php:189 — PhabricatorChangesetViewStateEngine.updateHiddenState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (22 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhutilRemarkupQuotedBlockRule.normalizeQuotedBody (cognitive 22) · ×1
  • PhutilRemarkupQuotedBlockRule.normalizeQuotedBody (cognitive 22) src/infrastructure/markup/blockrule/PhutilRemarkupQuotedBlockRule.php:26 — PhutilRemarkupQuotedBlockRule.normalizeQuotedBody has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorNavigationRemarkupRule.markupNavigation (cognitive 22) · ×1
  • PhabricatorNavigationRemarkupRule.markupNavigation (cognitive 22) src/infrastructure/markup/rule/PhabricatorNavigationRemarkupRule.php:16 — PhabricatorNavigationRemarkupRule.markupNavigation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.formatOrderClause (cognitive 22) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.formatOrderClause (cognitive 22) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1270 — PhabricatorCursorPagedPolicyAwareQuery.formatOrderClause has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiskDAO.getSchemaColumns (cognitive 22) · ×1
  • LiskDAO.getSchemaColumns (cognitive 22) src/infrastructure/storage/lisk/LiskDAO.php:1741 — LiskDAO.getSchemaColumns has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIObjectItemView.getTagAttributes (cognitive 22) · ×1
  • PHUIObjectItemView.getTagAttributes (cognitive 22) src/view/phui/PHUIObjectItemView.php:287 — PHUIObjectItemView.getTagAttributes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AphrontStackTraceView.render (cognitive 22) · ×1
  • AphrontStackTraceView.render (cognitive 22) src/view/widget/AphrontStackTraceView.php:12 — AphrontStackTraceView.render has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (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.
D2 · Cognitive Complexity · behavior-phabricator-remarkup-assist.JX.behavior("phabricator-remarkup-assist") · ×1
  • behavior-phabricator-remarkup-assist.JX.behavior("phabricator-remarkup-assist")::assist (cognitive 22) webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188 — behavior-phabricator-remarkup-assist.JX.behavior("phabricator-remarkup-assist")::assist has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, ternaries 3 (6 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · behavior-time-typeahead.JX.behavior("time-typeahead") · ×1
  • behavior-time-typeahead.JX.behavior("time-typeahead")::getNewValue (cognitive 22) webroot/rsrc/js/core/behavior-time-typeahead.js:82 — behavior-time-typeahead.JX.behavior("time-typeahead")::getNewValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · redraw (cognitive 22) · ×1
  • redraw (cognitive 22) webroot/rsrc/js/application/projects/WorkboardColumn.js:210 — redraw has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorExternalAccountQuery.willFilterPage (cognitive 21) · ×1
  • PhabricatorExternalAccountQuery.willFilterPage (cognitive 21) src/applications/auth/query/PhabricatorExternalAccountQuery.php:69 — PhabricatorExternalAccountQuery.willFilterPage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarEventEditController.handleRequest (cognitive 21) · ×1
  • PhabricatorCalendarEventEditController.handleRequest (cognitive 21) src/applications/calendar/controller/PhabricatorCalendarEventEditController.php:6 — PhabricatorCalendarEventEditController.handleRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (21 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorCalendarEventEditor.validateAllTransactions (cognitive 21) · ×1
  • PhabricatorCalendarEventEditor.validateAllTransactions (cognitive 21) src/applications/calendar/editor/PhabricatorCalendarEventEditor.php:188 — PhabricatorCalendarEventEditor.validateAllTransactions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorChatLogChannelLogController.handleRequest (cognitive 21) · ×1
  • PhabricatorChatLogChannelLogController.handleRequest (cognitive 21) src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php:10 — PhabricatorChatLogChannelLogController.handleRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionQuery.loadReviewers (cognitive 21) · ×1
  • DifferentialRevisionQuery.loadReviewers (cognitive 21) src/applications/differential/query/DifferentialRevisionQuery.php:956 — DifferentialRevisionQuery.loadReviewers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryBasicsManagementPanel.buildStateView (cognitive 21) · ×1
  • DiffusionRepositoryBasicsManagementPanel.buildStateView (cognitive 21) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:745 — DiffusionRepositoryBasicsManagementPanel.buildStateView 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.
D2 · Cognitive Complexity · DiffusionSubversionServeSSHWorkflow.identifyRepository (cognitive 21) · ×1
  • DiffusionSubversionServeSSHWorkflow.identifyRepository (cognitive 21) src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php:41 — DiffusionSubversionServeSSHWorkflow.identifyRepository has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerPHPAtomizer.parseReturnType (cognitive 21) · ×1
  • DivinerPHPAtomizer.parseReturnType (cognitive 21) src/applications/diviner/atomizer/DivinerPHPAtomizer.php:266 — DivinerPHPAtomizer.parseReturnType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFaviconRef.newTemplateFile (cognitive 21) · ×1
  • PhabricatorFaviconRef.newTemplateFile (cognitive 21) src/applications/files/favicon/PhabricatorFaviconRef.php:344 — PhabricatorFaviconRef.newTemplateFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTaskListView.render (cognitive 21) · ×1
  • ManiphestTaskListView.render (cognitive 21) src/applications/maniphest/view/ManiphestTaskListView.php:32 — ManiphestTaskListView.render has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMailManagementVolumeWorkflow.execute (cognitive 21) · ×1
  • PhabricatorMailManagementVolumeWorkflow.execute (cognitive 21) src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php:25 — PhabricatorMailManagementVolumeWorkflow.execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NuanceSourceQuery.buildWhereClauseParts (cognitive 21) · ×1
  • NuanceSourceQuery.buildWhereClauseParts (cognitive 21) src/applications/nuance/query/NuanceSourceQuery.php:68 — NuanceSourceQuery.buildWhereClauseParts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhameLiveController.buildApplicationCrumbs (cognitive 21) · ×1
  • PhameLiveController.buildApplicationCrumbs (cognitive 21) src/applications/phame/controller/PhameLiveController.php:155 — PhameLiveController.buildApplicationCrumbs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorHandleQuery.loadPage (cognitive 21) · ×1
  • PhabricatorHandleQuery.loadPage (cognitive 21) src/applications/phid/query/PhabricatorHandleQuery.php:26 — PhabricatorHandleQuery.loadPage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhortuneCartCheckoutController.handleCartRequest (cognitive 21) · ×1
  • PhortuneCartCheckoutController.handleCartRequest (cognitive 21) src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php:14 — PhortuneCartCheckoutController.handleCartRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (4 pts), error handling 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectTransactionEditor.validateAllTransactions (cognitive 21) · ×1
  • PhabricatorProjectTransactionEditor.validateAllTransactions (cognitive 21) src/applications/project/editor/PhabricatorProjectTransactionEditor.php:44 — PhabricatorProjectTransactionEditor.validateAllTransactions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorBoardResponseEngine.buildResponse (cognitive 21) · ×1
  • PhabricatorBoardResponseEngine.buildResponse (cognitive 21) src/applications/project/engine/PhabricatorBoardResponseEngine.php:76 — PhabricatorBoardResponseEngine.buildResponse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 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.
D2 · Cognitive Complexity · PhabricatorProjectPointsProfileMenuItem.newMenuItemViewList (cognitive 21) · ×1
  • PhabricatorProjectPointsProfileMenuItem.newMenuItemViewList (cognitive 21) src/applications/project/menuitem/PhabricatorProjectPointsProfileMenuItem.php:55 — PhabricatorProjectPointsProfileMenuItem.newMenuItemViewList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSearchManagementNgramsWorkflow.execute (cognitive 21) · ×1
  • PhabricatorSearchManagementNgramsWorkflow.execute (cognitive 21) src/applications/search/management/PhabricatorSearchManagementNgramsWorkflow.php:29 — PhabricatorSearchManagementNgramsWorkflow.execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.validateEditParameters (cognitive 21) · ×1
  • PhabricatorApplicationTransactionEditor.validateEditParameters (cognitive 21) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1756 — PhabricatorApplicationTransactionEditor.validateEditParameters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationEditHTTPParameterHelpView.render (cognitive 21) · ×1
  • PhabricatorApplicationEditHTTPParameterHelpView.render (cognitive 21) src/applications/transactions/view/PhabricatorApplicationEditHTTPParameterHelpView.php:33 — PhabricatorApplicationEditHTTPParameterHelpView.render has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 6 (7 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCustomFieldList.appendFieldsToPropertyList (cognitive 21) · ×1
  • PhabricatorCustomFieldList.appendFieldsToPropertyList (cognitive 21) src/infrastructure/customfield/field/PhabricatorCustomFieldList.php:100 — PhabricatorCustomFieldList.appendFieldsToPropertyList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 pts), loops 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilRemarkupCodeBlockRule.getMatchingLineCount (cognitive 21) · ×1
  • PhutilRemarkupCodeBlockRule.getMatchingLineCount (cognitive 21) src/infrastructure/markup/blockrule/PhutilRemarkupCodeBlockRule.php:5 — PhutilRemarkupCodeBlockRule.getMatchingLineCount has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorStorageManagementDestroyWorkflow.didExecute (cognitive 21) · ×1
  • PhabricatorStorageManagementDestroyWorkflow.didExecute (cognitive 21) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php:23 — PhabricatorStorageManagementDestroyWorkflow.didExecute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorGlobalLock.newHint (cognitive 21) · ×1
  • PhabricatorGlobalLock.newHint (cognitive 21) src/infrastructure/util/PhabricatorGlobalLock.php:331 — PhabricatorGlobalLock.newHint has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AphrontFormDateControl.getTimeTypeaheadValues (cognitive 21) · ×1
  • AphrontFormDateControl.getTimeTypeaheadValues (cognitive 21) src/view/form/control/AphrontFormDateControl.php:346 — AphrontFormDateControl.getTimeTypeaheadValues has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (9 pts), ternaries 2 (8 pts), if/else 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AphrontFormPolicyControl.getOptions (cognitive 21) · ×1
  • AphrontFormPolicyControl.getOptions (cognitive 21) src/view/form/control/AphrontFormPolicyControl.php:103 — AphrontFormPolicyControl.getOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _redrawFrame (cognitive 21) · ×1
  • _redrawFrame (cognitive 21) webroot/rsrc/js/application/projects/WorkboardColumn.js:394 — _redrawFrame has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _findContentCells (cognitive 21) · ×1
  • _findContentCells (cognitive 21) webroot/rsrc/js/application/diff/DiffChangesetList.js:1490 — _findContentCells has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redrawFileTree (cognitive 21) · ×1
  • redrawFileTree (cognitive 21) webroot/rsrc/js/application/diff/DiffChangeset.js:860 — redrawFileTree has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorElasticsearchSetupCheck.executeChecks (cognitive 20) · ×1
  • PhabricatorElasticsearchSetupCheck.executeChecks (cognitive 20) REDACTED:9 — PhabricatorElasticsearchSetupCheck.executeChecks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 2 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMySQLSetupCheck.executeRefChecks (cognitive 20) · ×1
  • PhabricatorMySQLSetupCheck.executeRefChecks (cognitive 20) src/applications/config/check/PhabricatorMySQLSetupCheck.php:22 — PhabricatorMySQLSetupCheck.executeRefChecks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (20 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConfigClusterNotificationsController.buildClusterNotificationStatus (cognitive 20) · ×1
  • PhabricatorConfigClusterNotificationsController.buildClusterNotificationStatus (cognitive 20) src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php:38 — PhabricatorConfigClusterNotificationsController.buildClusterNotificationStatus has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (6 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConfigDatabaseStatusController.handleRequest (cognitive 20) · ×1
  • PhabricatorConfigDatabaseStatusController.handleRequest (cognitive 20) src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php:12 — PhabricatorConfigDatabaseStatusController.handleRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (20 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorConfigManagementMigrateWorkflow.execute (cognitive 20) · ×1
  • PhabricatorConfigManagementMigrateWorkflow.execute (cognitive 20) src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php:14 — PhabricatorConfigManagementMigrateWorkflow.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSetupIssueView.renderValueForDisplay (cognitive 20) · ×1
  • PhabricatorSetupIssueView.renderValueForDisplay (cognitive 20) REDACTED:554 — PhabricatorSetupIssueView.renderValueForDisplay has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (20 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDashboardPanelTabsController.handleAddOperation (cognitive 20) · ×1
  • PhabricatorDashboardPanelTabsController.handleAddOperation (cognitive 20) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelTabsController.php:149 — PhabricatorDashboardPanelTabsController.handleAddOperation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialHarbormasterField.renderDiffPropertyViewValue (cognitive 20) · ×1
  • DifferentialHarbormasterField.renderDiffPropertyViewValue (cognitive 20) src/applications/differential/customfield/DifferentialHarbormasterField.php:16 — DifferentialHarbormasterField.renderDiffPropertyViewValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (6 pts), error handling 1 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DifferentialReviewersHeraldAction.applyReviewers (cognitive 20) · ×1
  • DifferentialReviewersHeraldAction.applyReviewers (cognitive 20) src/applications/differential/herald/DifferentialReviewersHeraldAction.php:18 — DifferentialReviewersHeraldAction.applyReviewers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialCreateMailReceiver.processReceivedMail (cognitive 20) · ×1
  • DifferentialCreateMailReceiver.processReceivedMail (cognitive 20) src/applications/differential/mail/DifferentialCreateMailReceiver.php:10 — DifferentialCreateMailReceiver.processReceivedMail has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (7 pts), error handling 2 (4 pts) (nesting depth added 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.
D2 · Cognitive Complexity · DifferentialChangesetParser.calculateGapsAndMask (cognitive 20) · ×1
  • DifferentialChangesetParser.calculateGapsAndMask (cognitive 20) src/applications/differential/parser/DifferentialChangesetParser.php:1197 — DifferentialChangesetParser.calculateGapsAndMask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialHunkParser.reparseHunksForSpecialAttributes (cognitive 20) · ×1
  • DifferentialHunkParser.reparseHunksForSpecialAttributes (cognitive 20) src/applications/differential/parser/DifferentialHunkParser.php:215 — DifferentialHunkParser.reparseHunksForSpecialAttributes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetHTMLRenderer.renderChangeTypeHeader (cognitive 20) · ×1
  • DifferentialChangesetHTMLRenderer.renderChangeTypeHeader (cognitive 20) src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:21 — DifferentialChangesetHTMLRenderer.renderChangeTypeHeader has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 1 (3 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DifferentialRevisionReviewersTransaction.validateTransactions (cognitive 20) · ×1
  • DifferentialRevisionReviewersTransaction.validateTransactions (cognitive 20) src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:316 — DifferentialRevisionReviewersTransaction.validateTransactions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), match/switch 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.
D2 · Cognitive Complexity · DiffusionURIEditEngine.buildCustomEditFields (cognitive 20) · ×1
  • DiffusionURIEditEngine.buildCustomEditFields (cognitive 20) src/applications/diffusion/editor/DiffusionURIEditEngine.php:83 — DiffusionURIEditEngine.buildCustomEditFields has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HeraldPreCommitContentAdapter.getDiffContent (cognitive 20) · ×1
  • HeraldPreCommitContentAdapter.getDiffContent (cognitive 20) src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php:40 — HeraldPreCommitContentAdapter.getDiffContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 3 (7 pts), match/switch 1 (4 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitQuery.loadPage (cognitive 20) · ×1
  • DiffusionCommitQuery.loadPage (cognitive 20) src/applications/diffusion/query/DiffusionCommitQuery.php:207 — DiffusionCommitQuery.loadPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 2 (4 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.
D2 · Cognitive Complexity · DiffusionPathChangeQuery.executeQuery (cognitive 20) · ×1
  • DiffusionPathChangeQuery.executeQuery (cognitive 20) src/applications/diffusion/query/pathchange/DiffusionPathChangeQuery.php:37 — DiffusionPathChangeQuery.executeQuery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · DiffusionTagListView.render (cognitive 20) · ×1
  • DiffusionTagListView.render (cognitive 20) src/applications/diffusion/view/DiffusionTagListView.php:28 — DiffusionTagListView.render has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoorkeeperBridgeAsana.pullRefs (cognitive 20) · ×1
  • DoorkeeperBridgeAsana.pullRefs (cognitive 20) src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:25 — DoorkeeperBridgeAsana.pullRefs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3, error handling 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoorkeeperBridgeJIRA.pullRefs (cognitive 20) · ×1
  • DoorkeeperBridgeJIRA.pullRefs (cognitive 20) src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php:20 — DoorkeeperBridgeJIRA.pullRefs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, error handling 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrydockWorkingCopyBlueprintImplementation.activateLease (cognitive 20) · ×1
  • DrydockWorkingCopyBlueprintImplementation.activateLease (cognitive 20) src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php:265 — DrydockWorkingCopyBlueprintImplementation.activateLease has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrydockLogQuery.didFilterPage (cognitive 20) · ×1
  • DrydockLogQuery.didFilterPage (cognitive 20) src/applications/drydock/query/DrydockLogQuery.php:40 — DrydockLogQuery.didFilterPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrydockLogListView.render (cognitive 20) · ×1
  • DrydockLogListView.render (cognitive 20) src/applications/drydock/view/DrydockLogListView.php:53 — DrydockLogListView.render has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorChartFunctionArgument.newValue (cognitive 20) · ×1
  • PhabricatorChartFunctionArgument.newValue (cognitive 20) src/applications/fact/chart/PhabricatorChartFunctionArgument.php:53 — PhabricatorChartFunctionArgument.newValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorDocumentEngineBlocks.newTwoUpLayout (cognitive 20) · ×1
  • PhabricatorDocumentEngineBlocks.newTwoUpLayout (cognitive 20) src/applications/files/diff/PhabricatorDocumentEngineBlocks.php:59 — PhabricatorDocumentEngineBlocks.newTwoUpLayout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFilesManagementCompactWorkflow.execute (cognitive 20) · ×1
  • PhabricatorFilesManagementCompactWorkflow.execute (cognitive 20) src/applications/files/management/PhabricatorFilesManagementCompactWorkflow.php:22 — PhabricatorFilesManagementCompactWorkflow.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTransactionEditor.didApplyTransactions (cognitive 20) · ×1
  • ManiphestTransactionEditor.didApplyTransactions (cognitive 20) src/applications/maniphest/editor/ManiphestTransactionEditor.php:868 — ManiphestTransactionEditor.didApplyTransactions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMailReplyHandler.getMailTargets (cognitive 20) · ×1
  • PhabricatorMailReplyHandler.getMailTargets (cognitive 20) src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php:206 — PhabricatorMailReplyHandler.getMailTargets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NuanceGitHubRawEvent.getURI (cognitive 20) · ×1
  • NuanceGitHubRawEvent.getURI (cognitive 20) src/applications/nuance/github/NuanceGitHubRawEvent.php:103 — NuanceGitHubRawEvent.getURI has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorOwnersPackagePathsTransaction.validateTransactions (cognitive 20) · ×1
  • PhabricatorOwnersPackagePathsTransaction.validateTransactions (cognitive 20) src/applications/owners/xaction/PhabricatorOwnersPackagePathsTransaction.php:42 — PhabricatorOwnersPackagePathsTransaction.validateTransactions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PassphraseCredentialQuery.willFilterPage (cognitive 20) · ×1
  • PassphraseCredentialQuery.willFilterPage (cognitive 20) src/applications/passphrase/query/PassphraseCredentialQuery.php:60 — PassphraseCredentialQuery.willFilterPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PassphraseCredentialControl.renderInput (cognitive 20) · ×1
  • PassphraseCredentialControl.renderInput (cognitive 20) src/applications/passphrase/view/PassphraseCredentialControl.php:39 — PassphraseCredentialControl.renderInput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhameBlogHeaderPictureController.handleRequest (cognitive 20) · ×1
  • PhameBlogHeaderPictureController.handleRequest (cognitive 20) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:6 — PhameBlogHeaderPictureController.handleRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhamePostHeaderPictureController.handleRequest (cognitive 20) · ×1
  • PhamePostHeaderPictureController.handleRequest (cognitive 20) src/applications/phame/controller/post/PhamePostHeaderPictureController.php:6 — PhamePostHeaderPictureController.handleRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorObjectQuery.loadPage (cognitive 20) · ×1
  • PhabricatorObjectQuery.loadPage (cognitive 20) src/applications/phid/query/PhabricatorObjectQuery.php:27 — PhabricatorObjectQuery.loadPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PolicyLockOptionType.validateOption (cognitive 20) · ×1
  • PolicyLockOptionType.validateOption (cognitive 20) src/applications/policy/config/PolicyLockOptionType.php:6 — PolicyLockOptionType.validateOption has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyQuery.loadObjectPolicyPHIDs (cognitive 20) · ×1
  • PhabricatorPolicyQuery.loadObjectPolicyPHIDs (cognitive 20) src/applications/policy/query/PhabricatorPolicyQuery.php:193 — PhabricatorPolicyQuery.loadObjectPolicyPHIDs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectQueryConduitAPIMethod.execute (cognitive 20) · ×1
  • ProjectQueryConduitAPIMethod.execute (cognitive 20) src/applications/project/conduit/ProjectQueryConduitAPIMethod.php:55 — ProjectQueryConduitAPIMethod.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (5 pts) (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.
D2 · Cognitive Complexity · PhabricatorProjectSubprojectsController.buildCurtainView (cognitive 20) · ×1
  • PhabricatorProjectSubprojectsController.buildCurtainView (cognitive 20) src/applications/project/controller/PhabricatorProjectSubprojectsController.php:121 — PhabricatorProjectSubprojectsController.buildCurtainView has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementImportingWorkflow.execute (cognitive 20) · ×1
  • PhabricatorRepositoryManagementImportingWorkflow.execute (cognitive 20) src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php:26 — PhabricatorRepositoryManagementImportingWorkflow.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorElasticFulltextStorageEngine.buildSpec (cognitive 20) · ×1
  • PhabricatorElasticFulltextStorageEngine.buildSpec (cognitive 20) src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php:108 — PhabricatorElasticFulltextStorageEngine.buildSpec 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.
D2 · Cognitive Complexity · PhabricatorBulkManagementExportWorkflow.execute (cognitive 20) · ×1
  • PhabricatorBulkManagementExportWorkflow.execute (cognitive 20) src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php:48 — PhabricatorBulkManagementExportWorkflow.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorEditEngineConfigurationSearchEngine.renderResultList (cognitive 20) · ×1
  • PhabricatorEditEngineConfigurationSearchEngine.renderResultList (cognitive 20) src/applications/transactions/query/PhabricatorEditEngineConfigurationSearchEngine.php:103 — PhabricatorEditEngineConfigurationSearchEngine.renderResultList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionReplyHandler.processMailCommands (cognitive 20) · ×1
  • PhabricatorApplicationTransactionReplyHandler.processMailCommands (cognitive 20) src/applications/transactions/replyhandler/PhabricatorApplicationTransactionReplyHandler.php:115 — PhabricatorApplicationTransactionReplyHandler.processMailCommands has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 4 (8 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhutilProseDifferenceEngine.newEditDistanceMatrixDiff (cognitive 20) · ×1
  • PhutilProseDifferenceEngine.newEditDistanceMatrixDiff (cognitive 20) src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php:165 — PhutilProseDifferenceEngine.newEditDistanceMatrixDiff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhutilRemarkupBlockStorage.restore (cognitive 20) · ×1
  • PhutilRemarkupBlockStorage.restore (cognitive 20) src/infrastructure/markup/PhutilRemarkupBlockStorage.php:53 — PhutilRemarkupBlockStorage.restore has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (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.
D2 · Cognitive Complexity · PhutilRemarkupHyperlinkRule.didMarkupText (cognitive 20) · ×1
  • PhutilRemarkupHyperlinkRule.didMarkupText (cognitive 20) src/infrastructure/markup/markuprule/PhutilRemarkupHyperlinkRule.php:180 — PhutilRemarkupHyperlinkRule.didMarkupText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyAwareQuery.applyWillFilterPageExtensions (cognitive 20) · ×1
  • PhabricatorPolicyAwareQuery.applyWillFilterPageExtensions (cognitive 20) src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:739 — PhabricatorPolicyAwareQuery.applyWillFilterPageExtensions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (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.
D2 · Cognitive Complexity · AphrontBaseMySQLDatabaseConnection.executeQuery (cognitive 20) · ×1
  • AphrontBaseMySQLDatabaseConnection.executeQuery (cognitive 20) src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:184 — AphrontBaseMySQLDatabaseConnection.executeQuery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts), error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiskDAO.__call (cognitive 20) · ×1
  • LiskDAO.__call (cognitive 20) src/infrastructure/storage/lisk/LiskDAO.php:1585 — LiskDAO.__call has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (20 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUITimelineEventView.getMenuItems (cognitive 20) · ×1
  • PHUITimelineEventView.getMenuItems (cognitive 20) src/view/phui/PHUITimelineEventView.php:661 — PHUITimelineEventView.getMenuItems has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _getTargetList (cognitive 20) · ×1
  • _getTargetList (cognitive 20) webroot/rsrc/js/core/DraggableList.js:304 — _getTargetList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilLDAPAuthAdapter.loadLDAPUserData (cognitive 19) · ×1
  • PhutilLDAPAuthAdapter.loadLDAPUserData (cognitive 19) src/applications/auth/adapter/PhutilLDAPAuthAdapter.php:212 — PhutilLDAPAuthAdapter.loadLDAPUserData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthInviteEngine.processInviteCode (cognitive 19) · ×1
  • PhabricatorAuthInviteEngine.processInviteCode (cognitive 19) src/applications/auth/engine/PhabricatorAuthInviteEngine.php:35 — PhabricatorAuthInviteEngine.processInviteCode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthInviteEngine.handleLoggedInInvite (cognitive 19) · ×1
  • PhabricatorAuthInviteEngine.handleLoggedInInvite (cognitive 19) src/applications/auth/engine/PhabricatorAuthInviteEngine.php:125 — PhabricatorAuthInviteEngine.handleLoggedInInvite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthAccountView.render (cognitive 19) · ×1
  • PhabricatorAuthAccountView.render (cognitive 19) src/applications/auth/view/PhabricatorAuthAccountView.php:19 — PhabricatorAuthAccountView.render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarEventEditEngine.willApplyTransactions (cognitive 19) · ×1
  • PhabricatorCalendarEventEditEngine.willApplyTransactions (cognitive 19) src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php:314 — PhabricatorCalendarEventEditEngine.willApplyTransactions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceRule.generateNextEvent (cognitive 19) · ×1
  • PhutilCalendarRecurrenceRule.generateNextEvent (cognitive 19) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:733 — PhutilCalendarRecurrenceRule.generateNextEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceRule.isCursorBehind (cognitive 19) · ×1
  • PhutilCalendarRecurrenceRule.isCursorBehind (cognitive 19) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:1779 — PhutilCalendarRecurrenceRule.isCursorBehind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (19 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorConfigSchemaQuery.buildComparisonSchemaForServer (cognitive 19) · ×1
  • PhabricatorConfigSchemaQuery.buildComparisonSchemaForServer (cognitive 19) src/applications/config/schema/PhabricatorConfigSchemaQuery.php:268 — PhabricatorConfigSchemaQuery.buildComparisonSchemaForServer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (9 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDaemonBulkJobMonitorController.handleRequest (cognitive 19) · ×1
  • PhabricatorDaemonBulkJobMonitorController.handleRequest (cognitive 19) src/applications/daemon/controller/PhabricatorDaemonBulkJobMonitorController.php:6 — PhabricatorDaemonBulkJobMonitorController.handleRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (4 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorWorkerTaskDetailController.buildPropertyListView (cognitive 19) · ×1
  • PhabricatorWorkerTaskDetailController.buildPropertyListView (cognitive 19) src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php:82 — PhabricatorWorkerTaskDetailController.buildPropertyListView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorDaemonLogQuery.willFilterPage (cognitive 19) · ×1
  • PhabricatorDaemonLogQuery.willFilterPage (cognitive 19) src/applications/daemon/query/PhabricatorDaemonLogQuery.php:70 — PhabricatorDaemonLogQuery.willFilterPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialBranchField.getBranchDescription (cognitive 19) · ×1
  • DifferentialBranchField.getBranchDescription (cognitive 19) src/applications/differential/customfield/DifferentialBranchField.php:38 — DifferentialBranchField.getBranchDescription has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialHunkParser.parseHunksForLineData (cognitive 19) · ×1
  • DifferentialHunkParser.parseHunksForLineData (cognitive 19) src/applications/differential/parser/DifferentialHunkParser.php:477 — DifferentialHunkParser.parseHunksForLineData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (7 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialHunk.makeContent (cognitive 19) · ×1
  • DifferentialHunk.makeContent (cognitive 19) src/applications/differential/storage/DifferentialHunk.php:206 — DifferentialHunk.makeContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialTransaction.getTitle (cognitive 19) · ×1
  • DifferentialTransaction.getTitle (cognitive 19) src/applications/differential/storage/DifferentialTransaction.php:208 — DifferentialTransaction.getTitle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DifferentialRevisionUpdateTransaction.validateTransactions (cognitive 19) · ×1
  • DifferentialRevisionUpdateTransaction.validateTransactions (cognitive 19) src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php:160 — DifferentialRevisionUpdateTransaction.validateTransactions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionController.buildCrumbList (cognitive 19) · ×1
  • DiffusionController.buildCrumbList (cognitive 19) src/applications/diffusion/controller/DiffusionController.php:128 — DiffusionController.buildCrumbList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DiffusionLowLevelCommitFieldsQuery.executeQuery (cognitive 19) · ×1
  • DiffusionLowLevelCommitFieldsQuery.executeQuery (cognitive 19) src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php:29 — DiffusionLowLevelCommitFieldsQuery.executeQuery has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (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.
D2 · Cognitive Complexity · DivinerPHPAtomizer.parseParams (cognitive 19) · ×1
  • DivinerPHPAtomizer.parseParams (cognitive 19) src/applications/diviner/atomizer/DivinerPHPAtomizer.php:129 — DivinerPHPAtomizer.parseParams has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerPHPAtomizer.findAtomDocblock (cognitive 19) · ×1
  • DivinerPHPAtomizer.findAtomDocblock (cognitive 19) src/applications/diviner/atomizer/DivinerPHPAtomizer.php:193 — DivinerPHPAtomizer.findAtomDocblock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DoorkeeperHyperlinkEngineExtension.processHyperlinks (cognitive 19) · ×1
  • DoorkeeperHyperlinkEngineExtension.processHyperlinks (cognitive 19) src/applications/doorkeeper/engineextension/DoorkeeperHyperlinkEngineExtension.php:8 — DoorkeeperHyperlinkEngineExtension.processHyperlinks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEmbedFileRemarkupRule.renderObjectEmbed (cognitive 19) · ×1
  • PhabricatorEmbedFileRemarkupRule.renderObjectEmbed (cognitive 19) src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php:68 — PhabricatorEmbedFileRemarkupRule.renderObjectEmbed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuildableActionController.handleRequest (cognitive 19) · ×1
  • HarbormasterBuildableActionController.handleRequest (cognitive 19) src/applications/harbormaster/controller/HarbormasterBuildableActionController.php:6 — HarbormasterBuildableActionController.handleRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (3 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · PhabricatorMacroAudioController.handleRequest (cognitive 19) · ×1
  • PhabricatorMacroAudioController.handleRequest (cognitive 19) src/applications/macro/controller/PhabricatorMacroAudioController.php:5 — PhabricatorMacroAudioController.handleRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (19 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMacroQuery.buildWhereClauseParts (cognitive 19) · ×1
  • PhabricatorMacroQuery.buildWhereClauseParts (cognitive 19) src/applications/macro/query/PhabricatorMacroQuery.php:103 — PhabricatorMacroQuery.buildWhereClauseParts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ManiphestTransactionEditor.expandTransactions (cognitive 19) · ×1
  • ManiphestTransactionEditor.expandTransactions (cognitive 19) src/applications/maniphest/editor/ManiphestTransactionEditor.php:319 — ManiphestTransactionEditor.expandTransactions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorUserProfileImageCacheType.newValueForUsers (cognitive 19) · ×1
  • PhabricatorUserProfileImageCacheType.newValueForUsers (cognitive 19) src/applications/people/cache/PhabricatorUserProfileImageCacheType.php:24 — PhabricatorUserProfileImageCacheType.newValueForUsers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorUserCardView.getTagContent (cognitive 19) · ×1
  • PhabricatorUserCardView.getTagContent (cognitive 19) src/applications/people/view/PhabricatorUserCardView.php:55 — PhabricatorUserCardView.getTagContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorObjectQuery.loadObjectsByPHID (cognitive 19) · ×1
  • PhabricatorObjectQuery.loadObjectsByPHID (cognitive 19) src/applications/phid/query/PhabricatorObjectQuery.php:116 — PhabricatorObjectQuery.loadObjectsByPHID has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (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.
D2 · Cognitive Complexity · PhortuneSubscriptionQuery.willFilterPage (cognitive 19) · ×1
  • PhortuneSubscriptionQuery.willFilterPage (cognitive 19) src/applications/phortune/query/PhortuneSubscriptionQuery.php:54 — PhortuneSubscriptionQuery.willFilterPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectColumnEditController.handleRequest (cognitive 19) · ×1
  • PhabricatorProjectColumnEditController.handleRequest (cognitive 19) src/applications/project/controller/PhabricatorProjectColumnEditController.php:6 — PhabricatorProjectColumnEditController.handleRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectTransactionEditor.adjustObjectForPolicyChecks (cognitive 19) · ×1
  • PhabricatorProjectTransactionEditor.adjustObjectForPolicyChecks (cognitive 19) src/applications/project/editor/PhabricatorProjectTransactionEditor.php:330 — PhabricatorProjectTransactionEditor.adjustObjectForPolicyChecks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryPullLocalDaemon.loadPullableRepositories (cognitive 19) · ×1
  • PhabricatorRepositoryPullLocalDaemon.loadPullableRepositories (cognitive 19) src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:405 — PhabricatorRepositoryPullLocalDaemon.loadPullableRepositories has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryDiscoveryEngine.discoverSubversionCommits (cognitive 19) · ×1
  • PhabricatorRepositoryDiscoveryEngine.discoverSubversionCommits (cognitive 19) src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:234 — PhabricatorRepositoryDiscoveryEngine.discoverSubversionCommits has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryGraphCache.rebuildBucket (cognitive 19) · ×1
  • PhabricatorRepositoryGraphCache.rebuildBucket (cognitive 19) src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php:295 — PhabricatorRepositoryGraphCache.rebuildBucket has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (9 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorRepositoryQuery.didFilterPage (cognitive 19) · ×1
  • PhabricatorRepositoryQuery.didFilterPage (cognitive 19) src/applications/repository/query/PhabricatorRepositoryQuery.php:347 — PhabricatorRepositoryQuery.didFilterPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryCommit.updateAuditStatus (cognitive 19) · ×1
  • PhabricatorRepositoryCommit.updateAuditStatus (cognitive 19) src/applications/repository/storage/PhabricatorRepositoryCommit.php:306 — PhabricatorRepositoryCommit.updateAuditStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositorySvnCommitChangeParserWorker.lookupPathFileTypes (cognitive 19) · ×1
  • PhabricatorRepositorySvnCommitChangeParserWorker.lookupPathFileTypes (cognitive 19) src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php:558 — PhabricatorRepositorySvnCommitChangeParserWorker.lookupPathFileTypes has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4 (7 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorApplicationSearchController.processCustomizeRequest (cognitive 19) · ×1
  • PhabricatorApplicationSearchController.processCustomizeRequest (cognitive 19) src/applications/search/controller/PhabricatorApplicationSearchController.php:999 — PhabricatorApplicationSearchController.processCustomizeRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEmailAddressesSettingsPanel.processRequest (cognitive 19) · ×1
  • PhabricatorEmailAddressesSettingsPanel.processRequest (cognitive 19) src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php:30 — PhabricatorEmailAddressesSettingsPanel.processRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPasswordSettingsPanel.processRequest (cognitive 19) · ×1
  • PhabricatorPasswordSettingsPanel.processRequest (cognitive 19) src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php:31 — PhabricatorPasswordSettingsPanel.processRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 2 (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.
D2 · Cognitive Complexity · PhabricatorApplicationTransaction.getIcon (cognitive 19) · ×1
  • PhabricatorApplicationTransaction.getIcon (cognitive 19) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:473 — PhabricatorApplicationTransaction.getIcon has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorWorkerTriggerManagementFireWorkflow.execute (cognitive 19) · ×1
  • PhabricatorWorkerTriggerManagementFireWorkflow.execute (cognitive 19) src/infrastructure/daemon/workers/management/PhabricatorWorkerTriggerManagementFireWorkflow.php:44 — PhabricatorWorkerTriggerManagementFireWorkflow.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDiffInlineCommentQuery.buildWhereClauseParts (cognitive 19) · ×1
  • PhabricatorDiffInlineCommentQuery.buildWhereClauseParts (cognitive 19) src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php:61 — PhabricatorDiffInlineCommentQuery.buildWhereClauseParts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIDiffTableOfContentsItemView.renderChangesetMetadata (cognitive 19) · ×1
  • PHUIDiffTableOfContentsItemView.renderChangesetMetadata (cognitive 19) src/infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php:179 — PHUIDiffTableOfContentsItemView.renderChangesetMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 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.
D2 · Cognitive Complexity · PhabricatorEnv.buildConfigurationSourceStack (cognitive 19) · ×1
  • PhabricatorEnv.buildConfigurationSourceStack (cognitive 19) src/infrastructure/env/PhabricatorEnv.php:182 — PhabricatorEnv.buildConfigurationSourceStack has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts), error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilContextFreeGrammar.applyRules (cognitive 19) · ×1
  • PhutilContextFreeGrammar.applyRules (cognitive 19) src/infrastructure/lipsum/PhutilContextFreeGrammar.php:26 — PhutilContextFreeGrammar.applyRules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.phutil_tag (cognitive 19) · ×1
  • render.phutil_tag (cognitive 19) src/infrastructure/markup/render.php:24 — render.phutil_tag has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilLexerSyntaxHighlighter.getHighlightFuture (cognitive 19) · ×1
  • PhutilLexerSyntaxHighlighter.getHighlightFuture (cognitive 19) src/infrastructure/markup/syntax/highlighter/PhutilLexerSyntaxHighlighter.php:12 — PhutilLexerSyntaxHighlighter.getHighlightFuture has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicSelectClause (cognitive 19) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicSelectClause (cognitive 19) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:2622 — PhabricatorCursorPagedPolicyAwareQuery.buildEdgeLogicSelectClause has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 3 (8 pts), match/switch 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.
D2 · Cognitive Complexity · PhabricatorStorageManagementUpgradeWorkflow.didExecute (cognitive 19) · ×1
  • PhabricatorStorageManagementUpgradeWorkflow.didExecute (cognitive 19) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:40 — PhabricatorStorageManagementUpgradeWorkflow.didExecute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIHeaderView.renderPolicyProperty (cognitive 19) · ×1
  • PHUIHeaderView.renderPolicyProperty (cognitive 19) src/view/phui/PHUIHeaderView.php:429 — PHUIHeaderView.renderPolicyProperty has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIHovercardView.getTagContent (cognitive 19) · ×1
  • PHUIHovercardView.getTagContent (cognitive 19) src/view/phui/PHUIHovercardView.php:92 — PHUIHovercardView.getTagContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 3 (4 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.
D2 · Cognitive Complexity · PHUICalendarDayView.render (cognitive 19) · ×1
  • PHUICalendarDayView.render (cognitive 19) src/view/phui/calendar/PHUICalendarDayView.php:52 — PHUICalendarDayView.render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUICalendarListView.getTagContent (cognitive 19) · ×1
  • PHUICalendarListView.getTagContent (cognitive 19) src/view/phui/calendar/PHUICalendarListView.php:52 — PHUICalendarListView.getTagContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-document-engine.JX.behavior("document-engine") · ×1
  • behavior-document-engine.JX.behavior("document-engine")::blame (cognitive 19) webroot/rsrc/js/application/files/behavior-document-engine.js:262 — behavior-document-engine.JX.behavior("document-engine")::blame has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _hasUnrefinableResults (cognitive 19) · ×1
  • _hasUnrefinableResults (cognitive 19) webroot/rsrc/js/phuix/PHUIXAutocomplete.js:381 — _hasUnrefinableResults has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _onresponse (cognitive 19) · ×1
  • _onresponse (cognitive 19) webroot/rsrc/js/application/diff/DiffChangeset.js:580 — _onresponse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AphrontRequest.newClusterProxyFuture (cognitive 18) · ×1
  • AphrontRequest.newClusterProxyFuture (cognitive 18) src/aphront/AphrontRequest.php:851 — AphrontRequest.newClusterProxyFuture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthSSHKeyEditController.handleRequest (cognitive 18) · ×1
  • PhabricatorAuthSSHKeyEditController.handleRequest (cognitive 18) src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:6 — PhabricatorAuthSSHKeyEditController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorCalendarEventViewController.buildRecurringSection (cognitive 18) · ×1
  • PhabricatorCalendarEventViewController.buildRecurringSection (cognitive 18) src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:439 — PhabricatorCalendarEventViewController.buildRecurringSection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhutilCalendarRecurrenceRule.newFromRRULE (cognitive 18) · ×1
  • PhutilCalendarRecurrenceRule.newFromRRULE (cognitive 18) src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php:237 — PhutilCalendarRecurrenceRule.newFromRRULE has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilICSParser.unescapeFieldValue (cognitive 18) · ×1
  • PhutilICSParser.unescapeFieldValue (cognitive 18) src/applications/calendar/parser/ics/PhutilICSParser.php:386 — PhutilICSParser.unescapeFieldValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConduitAPIController.decodeConduitParams (cognitive 18) · ×1
  • PhabricatorConduitAPIController.decodeConduitParams (cognitive 18) src/applications/conduit/controller/PhabricatorConduitAPIController.php:627 — PhabricatorConduitAPIController.decodeConduitParams has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConpherenceViewController.handleRequest (cognitive 18) · ×1
  • ConpherenceViewController.handleRequest (cognitive 18) src/applications/conpherence/controller/ConpherenceViewController.php:12 — ConpherenceViewController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorDaemonManagementWorkflow.launchDaemons (cognitive 18) · ×1
  • PhabricatorDaemonManagementWorkflow.launchDaemons (cognitive 18) src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:71 — PhabricatorDaemonManagementWorkflow.launchDaemons has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorDaemonManagementWorkflow.sendSignal (cognitive 18) · ×1
  • PhabricatorDaemonManagementWorkflow.sendSignal (cognitive 18) src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:467 — PhabricatorDaemonManagementWorkflow.sendSignal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionViewController.loadChangesetsAndVsMap (cognitive 18) · ×1
  • DifferentialRevisionViewController.loadChangesetsAndVsMap (cognitive 18) src/applications/differential/controller/DifferentialRevisionViewController.php:864 — DifferentialRevisionViewController.loadChangesetsAndVsMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5 (9 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetParser.buildLineBackmaps (cognitive 18) · ×1
  • DifferentialChangesetParser.buildLineBackmaps (cognitive 18) src/applications/differential/parser/DifferentialChangesetParser.php:1382 — DifferentialChangesetParser.buildLineBackmaps has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialHunkParser.getHasChanges (cognitive 18) · ×1
  • DifferentialHunkParser.getHasChanges (cognitive 18) src/applications/differential/parser/DifferentialHunkParser.php:163 — DifferentialHunkParser.getHasChanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionQuery.willFilterPage (cognitive 18) · ×1
  • DifferentialRevisionQuery.willFilterPage (cognitive 18) src/applications/differential/query/DifferentialRevisionQuery.php:336 — DifferentialRevisionQuery.willFilterPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitHookEngine.applyHeraldRules (cognitive 18) · ×1
  • DiffusionCommitHookEngine.applyHeraldRules (cognitive 18) src/applications/diffusion/engine/DiffusionCommitHookEngine.php:330 — DiffusionCommitHookEngine.applyHeraldRules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitHookEngine.findMercurialPushKeyRefUpdates (cognitive 18) · ×1
  • DiffusionCommitHookEngine.findMercurialPushKeyRefUpdates (cognitive 18) src/applications/diffusion/engine/DiffusionCommitHookEngine.php:962 — DiffusionCommitHookEngine.findMercurialPushKeyRefUpdates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionPhpExternalSymbolsSource.executeQuery (cognitive 18) · ×1
  • DiffusionPhpExternalSymbolsSource.executeQuery (cognitive 18) src/applications/diffusion/symbol/DiffusionPhpExternalSymbolsSource.php:6 — DiffusionPhpExternalSymbolsSource.executeQuery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrydockLeaseViewController.buildPropertyListView (cognitive 18) · ×1
  • DrydockLeaseViewController.buildPropertyListView (cognitive 18) src/applications/drydock/controller/DrydockLeaseViewController.php:127 — DrydockLeaseViewController.buildPropertyListView has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorFactDaemon.updateDatapoints (cognitive 18) · ×1
  • PhabricatorFactDaemon.updateDatapoints (cognitive 18) src/applications/fact/daemon/PhabricatorFactDaemon.php:122 — PhabricatorFactDaemon.updateDatapoints has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 6 (9 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFeedStoryPublisher.filterSubscribedPHIDs (cognitive 18) · ×1
  • PhabricatorFeedStoryPublisher.filterSubscribedPHIDs (cognitive 18) src/applications/feed/PhabricatorFeedStoryPublisher.php:220 — PhabricatorFeedStoryPublisher.filterSubscribedPHIDs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileAllocateConduitAPIMethod.execute (cognitive 18) · ×1
  • FileAllocateConduitAPIMethod.execute (cognitive 18) src/applications/files/conduit/FileAllocateConduitAPIMethod.php:28 — FileAllocateConduitAPIMethod.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorFileTransformController.handleRequest (cognitive 18) · ×1
  • PhabricatorFileTransformController.handleRequest (cognitive 18) src/applications/files/controller/PhabricatorFileTransformController.php:10 — PhabricatorFileTransformController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFileAttachmentQuery.willFilterPage (cognitive 18) · ×1
  • PhabricatorFileAttachmentQuery.willFilterPage (cognitive 18) src/applications/files/query/PhabricatorFileAttachmentQuery.php:55 — PhabricatorFileAttachmentQuery.willFilterPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuildLogRenderController.getHighlightViews (cognitive 18) · ×1
  • HarbormasterBuildLogRenderController.getHighlightViews (cognitive 18) src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:803 — HarbormasterBuildLogRenderController.getHighlightViews has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LegalpadDocumentSignController.readSignerInformation (cognitive 18) · ×1
  • LegalpadDocumentSignController.readSignerInformation (cognitive 18) src/applications/legalpad/controller/LegalpadDocumentSignController.php:359 — LegalpadDocumentSignController.readSignerInformation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorApplicationUninstallController.handleRequest (cognitive 18) · ×1
  • PhabricatorApplicationUninstallController.handleRequest (cognitive 18) src/applications/meta/controller/PhabricatorApplicationUninstallController.php:6 — PhabricatorApplicationUninstallController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMetaMTAMail.getRoutingRuleMap (cognitive 18) · ×1
  • PhabricatorMetaMTAMail.getRoutingRuleMap (cognitive 18) src/applications/metamta/storage/PhabricatorMetaMTAMail.php:1160 — PhabricatorMetaMTAMail.getRoutingRuleMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorNotificationBuilder.parseStories (cognitive 18) · ×1
  • PhabricatorNotificationBuilder.parseStories (cognitive 18) src/applications/notification/builder/PhabricatorNotificationBuilder.php:29 — PhabricatorNotificationBuilder.parseStories has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 4 (7 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhamePostViewController.handleRequest (cognitive 18) · ×1
  • PhamePostViewController.handleRequest (cognitive 18) src/applications/phame/controller/post/PhamePostViewController.php:6 — PhamePostViewController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhortuneMerchantQuery.canViewersEditMerchants (cognitive 18) · ×1
  • PhortuneMerchantQuery.canViewersEditMerchants (cognitive 18) src/applications/phortune/query/PhortuneMerchantQuery.php:128 — PhortuneMerchantQuery.canViewersEditMerchants has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 6 (8 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhrictionHistoryController.handleRequest (cognitive 18) · ×1
  • PhrictionHistoryController.handleRequest (cognitive 18) src/applications/phriction/controller/PhrictionHistoryController.php:10 — PhrictionHistoryController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectMoveController.handleRequest (cognitive 18) · ×1
  • PhabricatorProjectMoveController.handleRequest (cognitive 18) src/applications/project/controller/PhabricatorProjectMoveController.php:6 — PhabricatorProjectMoveController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 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.
D2 · Cognitive Complexity · PhabricatorProjectTransactionEditor.applyFinalEffects (cognitive 18) · ×1
  • PhabricatorProjectTransactionEditor.applyFinalEffects (cognitive 18) src/applications/project/editor/PhabricatorProjectTransactionEditor.php:196 — PhabricatorProjectTransactionEditor.applyFinalEffects has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryPushLogSearchEngine.newExportData (cognitive 18) · ×1
  • PhabricatorRepositoryPushLogSearchEngine.newExportData (cognitive 18) src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php:188 — PhabricatorRepositoryPushLogSearchEngine.newExportData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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.
D2 · Cognitive Complexity · PhabricatorSearchDeleteController.handleRequest (cognitive 18) · ×1
  • PhabricatorSearchDeleteController.handleRequest (cognitive 18) src/applications/search/controller/PhabricatorSearchDeleteController.php:6 — PhabricatorSearchDeleteController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFerretFulltextEngineExtension.updateStoredFields (cognitive 18) · ×1
  • PhabricatorFerretFulltextEngineExtension.updateStoredFields (cognitive 18) src/applications/search/engineextension/PhabricatorFerretFulltextEngineExtension.php:243 — PhabricatorFerretFulltextEngineExtension.updateStoredFields has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSlowvoteVoteController.handleRequest (cognitive 18) · ×1
  • PhabricatorSlowvoteVoteController.handleRequest (cognitive 18) src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php:6 — PhabricatorSlowvoteVoteController.handleRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorTypeaheadDatasource.evaluateTokens (cognitive 18) · ×1
  • PhabricatorTypeaheadDatasource.evaluateTokens (cognitive 18) src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php:407 — PhabricatorTypeaheadDatasource.evaluateTokens has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCustomField.adjustCustomFieldsForObjectSubtype (cognitive 18) · ×1
  • PhabricatorCustomField.adjustCustomFieldsForObjectSubtype (cognitive 18) src/infrastructure/customfield/field/PhabricatorCustomField.php:1638 — PhabricatorCustomField.adjustCustomFieldsForObjectSubtype has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilDaemonOverseer.__construct (cognitive 18) · ×1
  • PhutilDaemonOverseer.__construct (cognitive 18) src/infrastructure/daemon/PhutilDaemonOverseer.php:37 — PhutilDaemonOverseer.__construct has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 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.
D2 · Cognitive Complexity · PhutilRemarkupNoteBlockRule.markupText (cognitive 18) · ×1
  • PhutilRemarkupNoteBlockRule.markupText (cognitive 18) src/infrastructure/markup/blockrule/PhutilRemarkupNoteBlockRule.php:25 — PhutilRemarkupNoteBlockRule.markupText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorKeyboardRemarkupRule.markupKeystrokes (cognitive 18) · ×1
  • PhabricatorKeyboardRemarkupRule.markupKeystrokes (cognitive 18) src/infrastructure/markup/rule/PhabricatorKeyboardRemarkupRule.php:16 — PhabricatorKeyboardRemarkupRule.markupKeystrokes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 4 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · QueryFuture.isReady (cognitive 18) · ×1
  • QueryFuture.isReady (cognitive 18) src/infrastructure/storage/future/QueryFuture.php:53 — QueryFuture.isReady has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (8 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.
D2 · Cognitive Complexity · AphrontView.reduceChildren (cognitive 18) · ×1
  • AphrontView.reduceChildren (cognitive 18) src/view/AphrontView.php:159 — AphrontView.reduceChildren has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AphrontFormControl.render (cognitive 18) · ×1
  • AphrontFormControl.render (cognitive 18) src/view/form/control/AphrontFormControl.php:155 — AphrontFormControl.render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · behavior-global-drag-and-drop.JX.behavior("global-drag-and-drop") (cognitive 18) · ×1
  • behavior-global-drag-and-drop.JX.behavior("global-drag-and-drop") (cognitive 18) webroot/rsrc/js/core/behavior-global-drag-and-drop.js:10 — behavior-global-drag-and-drop.JX.behavior("global-drag-and-drop") has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 62, init, a function literal at line 39, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 18) · ×1
  • (anonymous) (cognitive 18) webroot/rsrc/js/core/behavior-global-drag-and-drop.js:10 — (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 62, init, a function literal at line 39, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · _updateAutoscroll (cognitive 18) · ×1
  • _updateAutoscroll (cognitive 18) webroot/rsrc/js/core/DraggableList.js:586 — _updateAutoscroll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _tryScroll (cognitive 18) · ×1
  • _tryScroll (cognitive 18) webroot/rsrc/js/core/DraggableList.js:767 — _tryScroll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _getDropContext (cognitive 18) · ×1
  • _getDropContext (cognitive 18) webroot/rsrc/js/application/projects/WorkboardBoard.js:447 — _getDropContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AphrontApplicationConfiguration.processRequest (cognitive 17) · ×1
  • AphrontApplicationConfiguration.processRequest (cognitive 17) REDACTED:244 — AphrontApplicationConfiguration.processRequest has cognitive complexity 17 (threshold 15). Drivers by points: error handling 6 (8 pts), if/else 6 (8 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorHighSecurityRequestExceptionHandler.handleRequestThrowable (cognitive 17) · ×1
  • PhabricatorHighSecurityRequestExceptionHandler.handleRequestThrowable (cognitive 17) src/aphront/handler/PhabricatorHighSecurityRequestExceptionHandler.php:27 — PhabricatorHighSecurityRequestExceptionHandler.handleRequestThrowable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AlmanacController.buildAlmanacPropertiesTable (cognitive 17) · ×1
  • AlmanacController.buildAlmanacPropertiesTable (cognitive 17) src/applications/almanac/controller/AlmanacController.php:6 — AlmanacController.buildAlmanacPropertiesTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuditManagementWorkflow.loadCommitsWithConstraints (cognitive 17) · ×1
  • PhabricatorAuditManagementWorkflow.loadCommitsWithConstraints (cognitive 17) src/applications/audit/management/PhabricatorAuditManagementWorkflow.php:21 — PhabricatorAuditManagementWorkflow.loadCommitsWithConstraints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorAuthManagementRefreshWorkflow.execute (cognitive 17) · ×1
  • PhabricatorAuthManagementRefreshWorkflow.execute (cognitive 17) src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php:24 — PhabricatorAuthManagementRefreshWorkflow.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCacheManagementPurgeWorkflow.execute (cognitive 17) · ×1
  • PhabricatorCacheManagementPurgeWorkflow.execute (cognitive 17) src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php:24 — PhabricatorCacheManagementPurgeWorkflow.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorCalendarImportEditor.applyFinalEffects (cognitive 17) · ×1
  • PhabricatorCalendarImportEditor.applyFinalEffects (cognitive 17) src/applications/calendar/editor/PhabricatorCalendarImportEditor.php:27 — PhabricatorCalendarImportEditor.applyFinalEffects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilICSParser.unescapeTextValue (cognitive 17) · ×1
  • PhutilICSParser.unescapeTextValue (cognitive 17) src/applications/calendar/parser/ics/PhutilICSParser.php:551 — PhutilICSParser.unescapeTextValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CelerityResourceTransformer.translateResourceURI (cognitive 17) · ×1
  • CelerityResourceTransformer.translateResourceURI (cognitive 17) src/applications/celerity/CelerityResourceTransformer.php:120 — CelerityResourceTransformer.translateResourceURI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConfigEditController.readRequest (cognitive 17) · ×1
  • PhabricatorConfigEditController.readRequest (cognitive 17) src/applications/config/controller/settings/PhabricatorConfigEditController.php:237 — PhabricatorConfigEditController.readRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 2 (6 pts), 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.
D2 · Cognitive Complexity · PhabricatorConfigColumnSchema.getKeyByteLength (cognitive 17) · ×1
  • PhabricatorConfigColumnSchema.getKeyByteLength (cognitive 17) src/applications/config/schema/PhabricatorConfigColumnSchema.php:102 — PhabricatorConfigColumnSchema.getKeyByteLength has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConpherenceThreadParticipantsTransaction.getTitle (cognitive 17) · ×1
  • ConpherenceThreadParticipantsTransaction.getTitle (cognitive 17) src/applications/conpherence/xaction/ConpherenceThreadParticipantsTransaction.php:47 — ConpherenceThreadParticipantsTransaction.getTitle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DarkConsoleCore.sanitizeForJSON (cognitive 17) · ×1
  • DarkConsoleCore.sanitizeForJSON (cognitive 17) src/applications/console/core/DarkConsoleCore.php:116 — DarkConsoleCore.sanitizeForJSON 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.
D2 · Cognitive Complexity · DifferentialRevisionInlinesController.renderInlineTable (cognitive 17) · ×1
  • DifferentialRevisionInlinesController.renderInlineTable (cognitive 17) src/applications/differential/controller/DifferentialRevisionInlinesController.php:72 — DifferentialRevisionInlinesController.renderInlineTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialDiffEditor.validateTransaction (cognitive 17) · ×1
  • DifferentialDiffEditor.validateTransaction (cognitive 17) src/applications/differential/editor/DifferentialDiffEditor.php:111 — DifferentialDiffEditor.validateTransaction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetParser.process (cognitive 17) · ×1
  • DifferentialChangesetParser.process (cognitive 17) src/applications/differential/parser/DifferentialChangesetParser.php:631 — DifferentialChangesetParser.process has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 5, if/else 4 (5 pts), error handling 2 (4 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialLineAdjustmentMap.buildMaps (cognitive 17) · ×1
  • DifferentialLineAdjustmentMap.buildMaps (cognitive 17) src/applications/differential/parser/DifferentialLineAdjustmentMap.php:304 — DifferentialLineAdjustmentMap.buildMaps has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitController.loadCommitState (cognitive 17) · ×1
  • DiffusionCommitController.loadCommitState (cognitive 17) src/applications/diffusion/controller/DiffusionCommitController.php:1033 — DiffusionCommitController.loadCommitState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3, loops 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DiffusionRepositoryController.buildHeaderView (cognitive 17) · ×1
  • DiffusionRepositoryController.buildHeaderView (cognitive 17) src/applications/diffusion/controller/DiffusionRepositoryController.php:270 — DiffusionRepositoryController.buildHeaderView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionDoorkeeperCommitFeedStoryPublisher.willPublishStory (cognitive 17) · ×1
  • DiffusionDoorkeeperCommitFeedStoryPublisher.willPublishStory (cognitive 17) src/applications/diffusion/doorkeeper/DiffusionDoorkeeperCommitFeedStoryPublisher.php:52 — DiffusionDoorkeeperCommitFeedStoryPublisher.willPublishStory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionRepositoryClusterEngine.synchronizeWorkingCopyAfterWrite (cognitive 17) · ×1
  • DiffusionRepositoryClusterEngine.synchronizeWorkingCopyAfterWrite (cognitive 17) src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:486 — DiffusionRepositoryClusterEngine.synchronizeWorkingCopyAfterWrite has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 3 (5 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCachedResolveRefsQuery.resolveGitAndMercurialRefs (cognitive 17) · ×1
  • DiffusionCachedResolveRefsQuery.resolveGitAndMercurialRefs (cognitive 17) src/applications/diffusion/query/DiffusionCachedResolveRefsQuery.php:61 — DiffusionCachedResolveRefsQuery.resolveGitAndMercurialRefs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DivinerStaticPublisher.findAtomByRef (cognitive 17) · ×1
  • DivinerStaticPublisher.findAtomByRef (cognitive 17) src/applications/diviner/publisher/DivinerStaticPublisher.php:117 — DivinerStaticPublisher.findAtomByRef has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFile.buildFromFileData (cognitive 17) · ×1
  • PhabricatorFile.buildFromFileData (cognitive 17) src/applications/files/storage/PhabricatorFile.php:326 — PhabricatorFile.buildFromFileData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (5 pts), loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorGuidanceEngine.newInfoView (cognitive 17) · ×1
  • PhabricatorGuidanceEngine.newInfoView (cognitive 17) src/applications/guides/guidance/PhabricatorGuidanceEngine.php:28 — PhabricatorGuidanceEngine.newInfoView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldTranscriptController.buildWarningPanel (cognitive 17) · ×1
  • HeraldTranscriptController.buildWarningPanel (cognitive 17) src/applications/herald/controller/HeraldTranscriptController.php:186 — HeraldTranscriptController.buildWarningPanel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (17 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorMemeRemarkupRule.markupMeme (cognitive 17) · ×1
  • PhabricatorMemeRemarkupRule.markupMeme (cognitive 17) src/applications/macro/markup/PhabricatorMemeRemarkupRule.php:18 — PhabricatorMemeRemarkupRule.markupMeme has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorMailMailgunAdapter.sendMessage (cognitive 17) · ×1
  • PhabricatorMailMailgunAdapter.sendMessage (cognitive 17) REDACTED:39 — PhabricatorMailMailgunAdapter.sendMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 4 (7 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorMailPostmarkAdapter.sendMessage (cognitive 17) · ×1
  • PhabricatorMailPostmarkAdapter.sendMessage (cognitive 17) src/applications/metamta/adapter/PhabricatorMailPostmarkAdapter.php:45 — PhabricatorMailPostmarkAdapter.sendMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 4 (8 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorMailSendGridAdapter.sendMessage (cognitive 17) · ×1
  • PhabricatorMailSendGridAdapter.sendMessage (cognitive 17) src/applications/metamta/adapter/PhabricatorMailSendGridAdapter.php:31 — PhabricatorMailSendGridAdapter.sendMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 4 (8 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorMetaMTAApplicationEmailEditor.validateTransaction (cognitive 17) · ×1
  • PhabricatorMetaMTAApplicationEmailEditor.validateTransaction (cognitive 17) src/applications/metamta/editor/PhabricatorMetaMTAApplicationEmailEditor.php:85 — PhabricatorMetaMTAApplicationEmailEditor.validateTransaction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorPeopleQuery.buildWhereClauseParts (cognitive 17) · ×1
  • PhabricatorPeopleQuery.buildWhereClauseParts (cognitive 17) src/applications/people/query/PhabricatorPeopleQuery.php:242 — PhabricatorPeopleQuery.buildWhereClauseParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhrictionTransactionEditor.applyFinalEffects (cognitive 17) · ×1
  • PhrictionTransactionEditor.applyFinalEffects (cognitive 17) src/applications/phriction/editor/PhrictionTransactionEditor.php:155 — PhrictionTransactionEditor.applyFinalEffects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyEditEngineExtension.buildCustomEditFields (cognitive 17) · ×1
  • PhabricatorPolicyEditEngineExtension.buildCustomEditFields (cognitive 17) src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php:26 — PhabricatorPolicyEditEngineExtension.buildCustomEditFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorPolicyFilterSet.loadHandleViewCapabilities (cognitive 17) · ×1
  • PhabricatorPolicyFilterSet.loadHandleViewCapabilities (cognitive 17) src/applications/policy/filter/PhabricatorPolicyFilterSet.php:105 — PhabricatorPolicyFilterSet.loadHandleViewCapabilities has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (13 pts), if/else 3 (4 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PhabricatorProjectController.newApplicationCrumbs (cognitive 17) · ×1
  • PhabricatorProjectController.newApplicationCrumbs (cognitive 17) src/applications/project/controller/PhabricatorProjectController.php:111 — PhabricatorProjectController.newApplicationCrumbs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (4 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectUIEventListener.handlePropertyEvent (cognitive 17) · ×1
  • PhabricatorProjectUIEventListener.handlePropertyEvent (cognitive 17) src/applications/project/events/PhabricatorProjectUIEventListener.php:26 — PhabricatorProjectUIEventListener.handlePropertyEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 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.
D2 · Cognitive Complexity · PhabricatorProjectIconSet.validateColorConfiguration (cognitive 17) · ×1
  • PhabricatorProjectIconSet.validateColorConfiguration (cognitive 17) src/applications/project/icon/PhabricatorProjectIconSet.php:434 — PhabricatorProjectIconSet.validateColorConfiguration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectTrigger.newTriggerRulesFromRuleSpecifications (cognitive 17) · ×1
  • PhabricatorProjectTrigger.newTriggerRulesFromRuleSpecifications (cognitive 17) src/applications/project/storage/PhabricatorProjectTrigger.php:102 — PhabricatorProjectTrigger.newTriggerRulesFromRuleSpecifications has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProjectListView.renderList (cognitive 17) · ×1
  • PhabricatorProjectListView.renderList (cognitive 17) src/applications/project/view/PhabricatorProjectListView.php:34 — PhabricatorProjectListView.renderList 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.
D2 · Cognitive Complexity · PhabricatorRepository.sortWritableAlmanacServiceRefs (cognitive 17) · ×1
  • PhabricatorRepository.sortWritableAlmanacServiceRefs (cognitive 17) src/applications/repository/storage/PhabricatorRepository.php:2013 — PhabricatorRepository.sortWritableAlmanacServiceRefs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepository.getPassthroughEnvironmentalVariables (cognitive 17) · ×1
  • PhabricatorRepository.getPassthroughEnvironmentalVariables (cognitive 17) src/applications/repository/storage/PhabricatorRepository.php:2287 — PhabricatorRepository.getPassthroughEnvironmentalVariables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryTransactionType.validateRefList (cognitive 17) · ×1
  • PhabricatorRepositoryTransactionType.validateRefList (cognitive 17) src/applications/repository/xaction/PhabricatorRepositoryTransactionType.php:6 — PhabricatorRepositoryTransactionType.validateRefList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSearchEngineAPIMethod.buildConstraintsDocumentationPage (cognitive 17) · ×1
  • PhabricatorSearchEngineAPIMethod.buildConstraintsDocumentationPage (cognitive 17) src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php:154 — PhabricatorSearchEngineAPIMethod.buildConstraintsDocumentationPage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FerretSearchFunction.newFerretSearchFunctions (cognitive 17) · ×1
  • FerretSearchFunction.newFerretSearchFunctions (cognitive 17) src/applications/search/ferret/function/FerretSearchFunction.php:36 — FerretSearchFunction.newFerretSearchFunctions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorLinkProfileMenuItem.validateTransactions (cognitive 17) · ×1
  • PhabricatorLinkProfileMenuItem.validateTransactions (cognitive 17) src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php:97 — PhabricatorLinkProfileMenuItem.validateTransactions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSlowvoteQuery.willFilterPage (cognitive 17) · ×1
  • PhabricatorSlowvoteQuery.willFilterPage (cognitive 17) src/applications/slowvote/query/PhabricatorSlowvoteQuery.php:60 — PhabricatorSlowvoteQuery.willFilterPage has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 5 (7 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SlowvoteEmbedView.render (cognitive 17) · ×1
  • SlowvoteEmbedView.render (cognitive 17) src/applications/slowvote/view/SlowvoteEmbedView.php:17 — SlowvoteEmbedView.render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngine.getBuiltinEngineConfigurations (cognitive 17) · ×1
  • PhabricatorEditEngine.getBuiltinEngineConfigurations (cognitive 17) src/applications/transactions/editengine/PhabricatorEditEngine.php:449 — PhabricatorEditEngine.getBuiltinEngineConfigurations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngineSubtype.newSubtypeMap (cognitive 17) · ×1
  • PhabricatorEditEngineSubtype.newSubtypeMap (cognitive 17) src/applications/transactions/editengine/PhabricatorEditEngineSubtype.php:259 — PhabricatorEditEngineSubtype.newSubtypeMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilInRequestKeyValueCache.setKeys (cognitive 17) · ×1
  • PhutilInRequestKeyValueCache.setKeys (cognitive 17) src/infrastructure/cache/PhutilInRequestKeyValueCache.php:61 — PhutilInRequestKeyValueCache.setKeys has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorClusterMailersConfigType.validateStoredValue (cognitive 17) · ×1
  • PhabricatorClusterMailersConfigType.validateStoredValue (cognitive 17) src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php:8 — PhabricatorClusterMailersConfigType.validateStoredValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilDaemon.sleep (cognitive 17) · ×1
  • PhutilDaemon.sleep (cognitive 17) src/infrastructure/daemon/PhutilDaemon.php:158 — PhutilDaemon.sleep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorDiffScopeEngine.newLineDepthMap (cognitive 17) · ×1
  • PhabricatorDiffScopeEngine.newLineDepthMap (cognitive 17) src/infrastructure/diff/PhabricatorDiffScopeEngine.php:123 — PhabricatorDiffScopeEngine.newLineDepthMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 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.
D2 · Cognitive Complexity · PhutilProseDiff.getSummaryParts (cognitive 17) · ×1
  • PhutilProseDiff.getSummaryParts (cognitive 17) src/infrastructure/diff/prose/PhutilProseDiff.php:23 — PhutilProseDiff.getSummaryParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhutilDefaultSyntaxHighlighterEngine.getHighlightFuture (cognitive 17) · ×1
  • PhutilDefaultSyntaxHighlighterEngine.getHighlightFuture (cognitive 17) src/infrastructure/markup/syntax/engine/PhutilDefaultSyntaxHighlighterEngine.php:42 — PhutilDefaultSyntaxHighlighterEngine.getHighlightFuture has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorCursorPagedPolicyAwareQuery.buildFerretSelectClause (cognitive 17) · ×1
  • PhabricatorCursorPagedPolicyAwareQuery.buildFerretSelectClause (cognitive 17) src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:1875 — PhabricatorCursorPagedPolicyAwareQuery.buildFerretSelectClause has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AphrontTagView.render (cognitive 17) · ×1
  • AphrontTagView.render (cognitive 17) src/view/AphrontTagView.php:92 — AphrontTagView.render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2, match/switch 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUICurtainExtension.buildExtensionPanels (cognitive 17) · ×1
  • PHUICurtainExtension.buildExtensionPanels (cognitive 17) src/view/extension/PHUICurtainExtension.php:48 — PHUICurtainExtension.buildExtensionPanels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIButtonBarView.getTagContent (cognitive 17) · ×1
  • PHUIButtonBarView.getTagContent (cognitive 17) src/view/phui/PHUIButtonBarView.php:31 — PHUIButtonBarView.getTagContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PHUIFeedStoryView.render (cognitive 17) · ×1
  • PHUIFeedStoryView.render (cognitive 17) src/view/phui/PHUIFeedStoryView.php:194 — PHUIFeedStoryView.render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PHUIIconView.getTagAttributes (cognitive 17) · ×1
  • PHUIIconView.getTagAttributes (cognitive 17) src/view/phui/PHUIIconView.php:96 — PHUIIconView.getTagAttributes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-day-view.JX.behavior("day-view") · ×1
  • behavior-day-view.JX.behavior("day-view")::findTodayClusters (cognitive 17) webroot/rsrc/js/application/calendar/behavior-day-view.js:7 — behavior-day-view.JX.behavior("day-view")::findTodayClusters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (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.
D2 · Cognitive Complexity · behavior-batch-selector.JX.behavior("maniphest-batch-selector") (cognitive 17) · ×1
  • behavior-batch-selector.JX.behavior("maniphest-batch-selector") (cognitive 17) webroot/rsrc/js/application/maniphest/behavior-batch-selector.js:9 — behavior-batch-selector.JX.behavior("maniphest-batch-selector") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), loops 2, boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 6 function items inside it that branch (clear_selection, a function literal at line 96, change, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · _getCurrentTarget (cognitive 17) · ×1
  • _getCurrentTarget (cognitive 17) webroot/rsrc/js/core/DraggableList.js:433 — _getCurrentTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 17) · ×1
  • (anonymous) (cognitive 17) webroot/rsrc/js/application/maniphest/behavior-batch-selector.js:9 — (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), loops 2, boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 10 function items inside it that branch (clear_selection, a function literal at line 96, change, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AlmanacManagementRegisterWorkflow.execute (cognitive 16) · ×1
  • AlmanacManagementRegisterWorkflow.execute (cognitive 16) src/applications/almanac/management/AlmanacManagementRegisterWorkflow.php:37 — AlmanacManagementRegisterWorkflow.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PhabricatorAuditTransactionView.renderTransactionContent (cognitive 16) · ×1
  • PhabricatorAuditTransactionView.renderTransactionContent (cognitive 16) src/applications/audit/view/PhabricatorAuditTransactionView.php:50 — PhabricatorAuditTransactionView.renderTransactionContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorAuthProvider.renderStandardLoginButton (cognitive 16) · ×1
  • PhabricatorAuthProvider.renderStandardLoginButton (cognitive 16) src/applications/auth/provider/PhabricatorAuthProvider.php:468 — PhabricatorAuthProvider.renderStandardLoginButton has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConfigSettingsListController.handleRequest (cognitive 16) · ×1
  • PhabricatorConfigSettingsListController.handleRequest (cognitive 16) src/applications/config/controller/settings/PhabricatorConfigSettingsListController.php:6 — PhabricatorConfigSettingsListController.handleRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorConfigTransaction.getTitle (cognitive 16) · ×1
  • PhabricatorConfigTransaction.getTitle (cognitive 16) src/applications/config/storage/PhabricatorConfigTransaction.php:16 — PhabricatorConfigTransaction.getTitle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (PhabricatorConfigTransaction.getTitleForFeed) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PhabricatorConfigTransaction.getTitleForFeed (cognitive 16) · ×1
  • PhabricatorConfigTransaction.getTitleForFeed (cognitive 16) src/applications/config/storage/PhabricatorConfigTransaction.php:54 — PhabricatorConfigTransaction.getTitleForFeed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (PhabricatorConfigTransaction.getTitle) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ConpherenceUpdateController.renderRemovePersonDialog (cognitive 16) · ×1
  • ConpherenceUpdateController.renderRemovePersonDialog (cognitive 16) src/applications/conpherence/controller/ConpherenceUpdateController.php:220 — ConpherenceUpdateController.renderRemovePersonDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialController.buildPackageMaps (cognitive 16) · ×1
  • DifferentialController.buildPackageMaps (cognitive 16) src/applications/differential/controller/DifferentialController.php:28 — DifferentialController.buildPackageMaps has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetParser.loadFileObjectsForChangeset (cognitive 16) · ×1
  • DifferentialChangesetParser.loadFileObjectsForChangeset (cognitive 16) src/applications/differential/parser/DifferentialChangesetParser.php:1849 — DifferentialChangesetParser.loadFileObjectsForChangeset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialRevisionQuery.loadReviewerAuthority (cognitive 16) · ×1
  • DifferentialRevisionQuery.loadReviewerAuthority (cognitive 16) src/applications/differential/query/DifferentialRevisionQuery.php:1016 — DifferentialRevisionQuery.loadReviewerAuthority has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DifferentialChangesetRenderer.getChangesetProperties (cognitive 16) · ×1
  • DifferentialChangesetRenderer.getChangesetProperties (cognitive 16) src/applications/differential/render/DifferentialChangesetRenderer.php:650 — DifferentialChangesetRenderer.getChangesetProperties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLastModifiedQueryConduitAPIMethod.loadCommitsFromCache (cognitive 16) · ×1
  • DiffusionLastModifiedQueryConduitAPIMethod.loadCommitsFromCache (cognitive 16) src/applications/diffusion/conduit/DiffusionLastModifiedQueryConduitAPIMethod.php:100 — DiffusionLastModifiedQueryConduitAPIMethod.loadCommitsFromCache has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionLastModifiedController.handleRequest (cognitive 16) · ×1
  • DiffusionLastModifiedController.handleRequest (cognitive 16) src/applications/diffusion/controller/DiffusionLastModifiedController.php:9 — DiffusionLastModifiedController.handleRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2, boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionServeController.handleRequest (cognitive 16) · ×1
  • DiffusionServeController.handleRequest (cognitive 16) src/applications/diffusion/controller/DiffusionServeController.php:94 — DiffusionServeController.handleRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DiffusionGitBranch.parseRemoteBranchOutput (cognitive 16) · ×1
  • DiffusionGitBranch.parseRemoteBranchOutput (cognitive 16) src/applications/diffusion/data/DiffusionGitBranch.php:26 — DiffusionGitBranch.parseRemoteBranchOutput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionBrowseTableView.render (cognitive 16) · ×1
  • DiffusionBrowseTableView.render (cognitive 16) src/applications/diffusion/view/DiffusionBrowseTableView.php:13 — DiffusionBrowseTableView.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffusionCommitAuditorsTransaction.validateTransactions (cognitive 16) · ×1
  • DiffusionCommitAuditorsTransaction.validateTransactions (cognitive 16) src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:177 — DiffusionCommitAuditorsTransaction.validateTransactions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorChartRenderingEngine.getStoredChart (cognitive 16) · ×1
  • PhabricatorChartRenderingEngine.getStoredChart (cognitive 16) src/applications/fact/engine/PhabricatorChartRenderingEngine.php:46 — PhabricatorChartRenderingEngine.getStoredChart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PhabricatorDocumentRef.loadData (cognitive 16) · ×1
  • PhabricatorDocumentRef.loadData (cognitive 16) src/applications/files/document/PhabricatorDocumentRef.php:85 — PhabricatorDocumentRef.loadData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorFilesCurtainExtension.buildCurtainPanel (cognitive 16) · ×1
  • PhabricatorFilesCurtainExtension.buildCurtainPanel (cognitive 16) src/applications/files/engineextension/PhabricatorFilesCurtainExtension.php:16 — PhabricatorFilesCurtainExtension.buildCurtainPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuildLogRenderController.mergeOverlappingReads (cognitive 16) · ×1
  • HarbormasterBuildLogRenderController.mergeOverlappingReads (cognitive 16) src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:507 — HarbormasterBuildLogRenderController.mergeOverlappingReads has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterPlanViewController.buildStepList (cognitive 16) · ×1
  • HarbormasterPlanViewController.buildStepList (cognitive 16) src/applications/harbormaster/controller/HarbormasterPlanViewController.php:92 — HarbormasterPlanViewController.buildStepList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterTargetEngine.generateBuildStepMap (cognitive 16) · ×1
  • HarbormasterTargetEngine.generateBuildStepMap (cognitive 16) src/applications/harbormaster/engine/HarbormasterTargetEngine.php:62 — HarbormasterTargetEngine.generateBuildStepMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HarbormasterBuild.getUnprocessedMessageState (cognitive 16) · ×1
  • HarbormasterBuild.getUnprocessedMessageState (cognitive 16) src/applications/harbormaster/storage/build/HarbormasterBuild.php:253 — HarbormasterBuild.getUnprocessedMessageState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeraldObjectTranscript.truncateValue (cognitive 16) · ×1
  • HeraldObjectTranscript.truncateValue (cognitive 16) src/applications/herald/storage/transcript/HeraldObjectTranscript.php:70 — HeraldObjectTranscript.truncateValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 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.
D2 · Cognitive Complexity · PhabricatorMacroFileTransaction.validateTransactions (cognitive 16) · ×1
  • PhabricatorMacroFileTransaction.validateTransactions (cognitive 16) src/applications/macro/xaction/PhabricatorMacroFileTransaction.php:33 — PhabricatorMacroFileTransaction.validateTransactions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTaskDetailController.handleRequest (cognitive 16) · ×1
  • ManiphestTaskDetailController.handleRequest (cognitive 16) src/applications/maniphest/controller/ManiphestTaskDetailController.php:9 — ManiphestTaskDetailController.handleRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMailEmailEngine.newEmailSubject (cognitive 16) · ×1
  • PhabricatorMailEmailEngine.newEmailSubject (cognitive 16) src/applications/metamta/engine/PhabricatorMailEmailEngine.php:293 — PhabricatorMailEmailEngine.newEmailSubject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorMailReplyHandler.filterRecipientUsers (cognitive 16) · ×1
  • PhabricatorMailReplyHandler.filterRecipientUsers (cognitive 16) src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php:377 — PhabricatorMailReplyHandler.filterRecipientUsers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NuanceItemQuery.willFilterPage (cognitive 16) · ×1
  • NuanceItemQuery.willFilterPage (cognitive 16) src/applications/nuance/query/NuanceItemQuery.php:59 — NuanceItemQuery.willFilterPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorUserLog.getRemoteAddressForViewer (cognitive 16) · ×1
  • PhabricatorUserLog.getRemoteAddressForViewer (cognitive 16) src/applications/people/storage/PhabricatorUserLog.php:111 — PhabricatorUserLog.getRemoteAddressForViewer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorUserUsernameTransaction.validateTransactions (cognitive 16) · ×1
  • PhabricatorUserUsernameTransaction.validateTransactions (cognitive 16) src/applications/people/xaction/PhabricatorUserUsernameTransaction.php:56 — PhabricatorUserUsernameTransaction.validateTransactions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryDiscoveryEngine.discoverStreamAncestry (cognitive 16) · ×1
  • PhabricatorRepositoryDiscoveryEngine.discoverStreamAncestry (cognitive 16) src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:396 — PhabricatorRepositoryDiscoveryEngine.discoverStreamAncestry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryDiscoveryEngine.markUnreachableFrom (cognitive 16) · ×1
  • PhabricatorRepositoryDiscoveryEngine.markUnreachableFrom (cognitive 16) src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:816 — PhabricatorRepositoryDiscoveryEngine.markUnreachableFrom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementMarkImportedWorkflow.execute (cognitive 16) · ×1
  • PhabricatorRepositoryManagementMarkImportedWorkflow.execute (cognitive 16) src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php:24 — PhabricatorRepositoryManagementMarkImportedWorkflow.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryManagementUnpublishWorkflow.unpublishCommit (cognitive 16) · ×1
  • PhabricatorRepositoryManagementUnpublishWorkflow.unpublishCommit (cognitive 16) src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php:75 — PhabricatorRepositoryManagementUnpublishWorkflow.unpublishCommit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepository.canServeProtocol (cognitive 16) · ×1
  • PhabricatorRepository.canServeProtocol (cognitive 16) src/applications/repository/storage/PhabricatorRepository.php:1384 — PhabricatorRepository.canServeProtocol has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorRepositoryURITransaction.getTitle (cognitive 16) · ×1
  • PhabricatorRepositoryURITransaction.getTitle (cognitive 16) src/applications/repository/storage/PhabricatorRepositoryURITransaction.php:41 — PhabricatorRepositoryURITransaction.getTitle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorApplicationSearchEngine.readUsersFromRequest (cognitive 16) · ×1
  • PhabricatorApplicationSearchEngine.readUsersFromRequest (cognitive 16) src/applications/search/engine/PhabricatorApplicationSearchEngine.php:740 — PhabricatorApplicationSearchEngine.readUsersFromRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorProfileMenuEngine.adjustDefault (cognitive 16) · ×1
  • PhabricatorProfileMenuEngine.adjustDefault (cognitive 16) src/applications/search/engine/PhabricatorProfileMenuEngine.php:1148 — PhabricatorProfileMenuEngine.adjustDefault has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorSearchTokenizerField.getUsersFromRequest (cognitive 16) · ×1
  • PhabricatorSearchTokenizerField.getUsersFromRequest (cognitive 16) src/applications/search/field/PhabricatorSearchTokenizerField.php:29 — PhabricatorSearchTokenizerField.getUsersFromRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorElasticFulltextStorageEngine.check (cognitive 16) · ×1
  • PhabricatorElasticFulltextStorageEngine.check (cognitive 16) src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php:423 — PhabricatorElasticFulltextStorageEngine.check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngineConfigurationLockController.handleRequest (cognitive 16) · ×1
  • PhabricatorEditEngineConfigurationLockController.handleRequest (cognitive 16) src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php:6 — PhabricatorEditEngineConfigurationLockController.handleRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngineConfigurationSortController.handleRequest (cognitive 16) · ×1
  • PhabricatorEditEngineConfigurationSortController.handleRequest (cognitive 16) src/applications/transactions/controller/PhabricatorEditEngineConfigurationSortController.php:6 — PhabricatorEditEngineConfigurationSortController.handleRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 3 (4 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PhabricatorEditEngine.buildEditFields (cognitive 16) · ×1
  • PhabricatorEditEngine.buildEditFields (cognitive 16) src/applications/transactions/editengine/PhabricatorEditEngine.php:149 — PhabricatorEditEngine.buildEditFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorEditEngine.buildEditEngineCommentView (cognitive 16) · ×1
  • PhabricatorEditEngine.buildEditEngineCommentView (cognitive 16) src/applications/transactions/editengine/PhabricatorEditEngine.php:1625 — PhabricatorEditEngine.buildEditEngineCommentView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.newFileTransactionInternalValues (cognitive 16) · ×1
  • PhabricatorApplicationTransactionEditor.newFileTransactionInternalValues (cognitive 16) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:428 — PhabricatorApplicationTransactionEditor.newFileTransactionInternalValues has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.getLegacyRequiredCapabilities (cognitive 16) · ×1
  • PhabricatorApplicationTransactionEditor.getLegacyRequiredCapabilities (cognitive 16) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1899 — PhabricatorApplicationTransactionEditor.getLegacyRequiredCapabilities has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionEditor.validateSpaceTransactions (cognitive 16) · ×1
  • PhabricatorApplicationTransactionEditor.validateSpaceTransactions (cognitive 16) src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3098 — PhabricatorApplicationTransactionEditor.validateSpaceTransactions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorApplicationTransactionQuery.loadPage (cognitive 16) · ×1
  • PhabricatorApplicationTransactionQuery.loadPage (cognitive 16) src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php:104 — PhabricatorApplicationTransactionQuery.loadPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorClusterSearchConfigType.validateValue (cognitive 16) · ×1
  • PhabricatorClusterSearchConfigType.validateValue (cognitive 16) REDACTED:14 — PhabricatorClusterSearchConfigType.validateValue has cognitive complexity 16 (threshold 15). Drivers by points: error handling 2 (6 pts), if/else 3 (6 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorWorkerManagementExecuteWorkflow.execute (cognitive 16) · ×1
  • PhabricatorWorkerManagementExecuteWorkflow.execute (cognitive 16) src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php:29 — PhabricatorWorkerManagementExecuteWorkflow.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIDiffTableOfContentsListView.newTreeVector (cognitive 16) · ×1
  • PHUIDiffTableOfContentsListView.newTreeVector (cognitive 16) src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php:299 — PHUIDiffTableOfContentsListView.newTreeVector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManiphestTaskGraph.newTableRow (cognitive 16) · ×1
  • ManiphestTaskGraph.newTableRow (cognitive 16) src/infrastructure/graph/ManiphestTaskGraph.php:37 — ManiphestTaskGraph.newTableRow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiskDAO.applyLiskDataSerialization (cognitive 16) · ×1
  • LiskDAO.applyLiskDataSerialization (cognitive 16) src/infrastructure/storage/lisk/LiskDAO.php:1547 — LiskDAO.applyLiskDataSerialization has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorLiskDAO.newClusterConnection (cognitive 16) · ×1
  • PhabricatorLiskDAO.newClusterConnection (cognitive 16) src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:85 — PhabricatorLiskDAO.newClusterConnection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · AphrontMultiColumnView.render (cognitive 16) · ×1
  • AphrontMultiColumnView.render (cognitive 16) src/view/layout/AphrontMultiColumnView.php:60 — AphrontMultiColumnView.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorStandardPageView.getBodyClasses (cognitive 16) · ×1
  • PhabricatorStandardPageView.getBodyClasses (cognitive 16) src/view/page/PhabricatorStandardPageView.php:603 — PhabricatorStandardPageView.getBodyClasses has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PHUIObjectItemListView.getTagContent (cognitive 16) · ×1
  • PHUIObjectItemListView.getTagContent (cognitive 16) src/view/phui/PHUIObjectItemListView.php:117 — PHUIObjectItemListView.getTagContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PhabricatorClientLimit.getScore (cognitive 16) · ×1
  • PhabricatorClientLimit.getScore (cognitive 16) support/startup/PhabricatorClientLimit.php:234 — PhabricatorClientLimit.getScore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhabricatorStartup.onDebugTick (cognitive 16) · ×1
  • PhabricatorStartup.onDebugTick (cognitive 16) support/startup/PhabricatorStartup.php:279 — PhabricatorStartup.onDebugTick has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-dashboard-query-panel-select.JX.behavior("dashboard-query-panel-select") (cognitive 16) · ×1
  • behavior-dashboard-query-panel-select.JX.behavior("dashboard-query-panel-select") (cognitive 16) webroot/rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js:11 — behavior-dashboard-query-panel-select.JX.behavior("dashboard-query-panel-select") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). Of this number, 10 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · behavior-pholio-mock-edit.JX.behavior("pholio-mock-edit") (cognitive 16) · ×1
  • behavior-pholio-mock-edit.JX.behavior("pholio-mock-edit") (cognitive 16) webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:12 — behavior-pholio-mock-edit.JX.behavior("pholio-mock-edit") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 5, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 99, update_statics, a function literal at line 272, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-gesture.JX.behavior("phabricator-gesture") (cognitive 16) · ×1
  • behavior-gesture.JX.behavior("phabricator-gesture") (cognitive 16) webroot/rsrc/js/core/behavior-gesture.js:15 — behavior-gesture.JX.behavior("phabricator-gesture") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 1 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 4 function items inside it that branch (a function literal at line 50, a function literal at line 25, a function literal at line 92, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-refresh-csrf.JX.behavior("refresh-csrf") (cognitive 16) · ×1
  • behavior-refresh-csrf.JX.behavior("refresh-csrf") (cognitive 16) webroot/rsrc/js/core/behavior-refresh-csrf.js:31 — behavior-refresh-csrf.JX.behavior("refresh-csrf") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2, match/switch 2 (nesting depth added 3). None of this is in the body itself: all 16 points belong to 6 function items inside it that branch (redraw_bar, a function literal at line 36, a function literal at line 121, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · behavior-search-typeahead.JX.behavior("phabricator-search-typeahead") · ×1
  • behavior-search-typeahead.JX.behavior("phabricator-search-typeahead")::sort_handler (cognitive 16) webroot/rsrc/js/core/behavior-search-typeahead.js:59 — behavior-search-typeahead.JX.behavior("phabricator-search-typeahead")::sort_handler has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · matchTree (cognitive 16) · ×1
  • matchTree (cognitive 16) webroot/rsrc/js/application/diffusion/DiffusionLocateFileSource.js:165 — matchTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (6 members, 102 shared lines) · ×1
  • Near-duplicate member family (6 members, 102 shared lines) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:7 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:7-232 | src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:7-247 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:7-288 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:7-238 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:11-220 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:7-287 — These 6 members are variants of one another: a block of 102 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 (4 members, 49 shared lines) · ×1
  • Near-duplicate member family (4 members, 49 shared lines) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:7 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:7-136 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:7-238 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:7-133 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:11-220 — These 4 members are variants of one another: a block of 49 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, 30 shared lines) · ×1
  • Near-duplicate member family (4 members, 30 shared lines) src/applications/badges/controller/PhabricatorBadgesArchiveController.php:7 — src/applications/badges/controller/PhabricatorBadgesArchiveController.php:7-66 | src/applications/owners/controller/PhabricatorOwnersArchiveController.php:7-63 | src/applications/phame/controller/blog/PhameBlogArchiveController.php:7-65 | src/applications/project/controller/PhabricatorProjectArchiveController.php:7-66 — These 4 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 26 shared lines) · ×1
  • Near-duplicate member family (4 members, 26 shared lines) src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php:7 — src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php:7-59 | src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php:7-51 | src/applications/people/controller/PhabricatorPeopleProfileRevisionsController.php:7-51 | src/applications/people/controller/PhabricatorPeopleProfileTasksController.php:7-51 — These 4 members are variants of one another: a block of 26 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member pair (103 shared lines) · ×1
  • Near-duplicate member pair (103 shared lines) src/applications/guides/module/PhabricatorGuideInstallModule.php:25 — src/applications/guides/module/PhabricatorGuideInstallModule.php:25-176 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:22-183 — These two members are variants of one another: 103 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 (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:98 — src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:98-124 | src/applications/nuance/controller/NuanceQueueViewController.php:55-81 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) src/applications/config/option/PhabricatorCoreConfigOptions.php:275 — src/applications/config/option/PhabricatorCoreConfigOptions.php:275-331 | src/applications/config/option/PhabricatorSecurityConfigOptions.php:295-333 — 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 (90 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (90 members, 50+ identical tokens) src/applications/almanac/query/AlmanacBindingQuery.php:95 — src/applications/almanac/query/AlmanacBindingQuery.php:95-146 | src/applications/almanac/query/AlmanacDeviceQuery.php:60-115 | src/applications/almanac/query/AlmanacInterfaceQuery.php:88-133 | src/applications/almanac/query/AlmanacNamespaceQuery.php:36-59 | src/applications/almanac/query/AlmanacNetworkQuery.php:36-59 | src/applications/almanac/query/AlmanacServiceQuery.php:86-142 | src/applications/auth/query/PhabricatorAuthChallengeQuery.php:44-88 | src/applications/auth/query/PhabricatorAuthContactNumberQuery.php:48-92 | src/applications/auth/query/PhabricatorAuthFactorConfigQuery.php:42-79 | src/applications/auth/query/PhabricatorAuthFactorProviderQuery.php:36-66 | src/applications/auth/query/PhabricatorAuthMessageQuery.php:30-53 | src/applications/auth/query/PhabricatorAuthPasswordQuery.php:42-79 | src/applications/auth/query/PhabricatorAuthProviderConfigQuery.php:36-66 | src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php:78-126 | src/applications/auth/query/PhabricatorAuthSessionQuery.php:64-106 | src/applications/auth/query/PhabricatorExternalAccountIdentifierQuery.php:42-83 | src/applications/auth/query/PhabricatorExternalAccountQuery.php:146-211 | src/applications/badges/query/PhabricatorBadgesQuery.php:46-76 | src/applications/calendar/query/PhabricatorCalendarEventQuery.php:358-497 | src/applications/calendar/query/PhabricatorCalendarExportQuery.php:42-79 | src/applications/calendar/query/PhabricatorCalendarExternalInviteeQuery.php:30-57 | src/applications/calendar/query/PhabricatorCalendarImportLogQuery.php:30-54 | src/applications/calendar/query/PhabricatorCalendarImportQuery.php:36-66 | src/applications/countdown/query/PhabricatorCountdownQuery.php:36-66 | src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php:50-87 | src/applications/dashboard/query/PhabricatorDashboardPortalQuery.php:30-53 | src/applications/dashboard/query/PhabricatorDashboardQuery.php:58-88 | src/applications/differential/query/DifferentialDiffQuery.php:123-184 | src/applications/drydock/query/DrydockAuthorizationQuery.php:124-168 | src/applications/drydock/query/DrydockBlueprintQuery.php:147-207 | src/applications/drydock/query/DrydockLeaseQuery.php:109-167 | src/applications/drydock/query/DrydockRepositoryOperationQuery.php:124-182 | src/applications/drydock/query/DrydockResourceQuery.php:94-138 | src/applications/files/query/PhabricatorFileQuery.php:397-535 | src/applications/fund/query/FundBackerQuery.php:72-111 | src/applications/fund/query/FundInitiativeQuery.php:36-66 | src/applications/harbormaster/query/HarbormasterBuildLogQuery.php:56-79 | src/applications/harbormaster/query/HarbormasterBuildPlanQuery.php:74-111 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:141-197 | src/applications/harbormaster/query/HarbormasterBuildStepQuery.php:30-53 | src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php:73-152 | src/applications/harbormaster/query/HarbormasterBuildUnitMessageQuery.php:30-53 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:129-173 | src/applications/herald/query/HeraldRuleQuery.php:201-273 | src/applications/herald/query/HeraldWebhookQuery.php:30-53 | src/applications/herald/query/HeraldWebhookRequestQuery.php:44-88 | src/applications/legalpad/query/LegalpadDocumentQuery.php:158-209 | src/applications/macro/query/PhabricatorMacroQuery.php:104-202 | src/applications/metamta/query/PhabricatorMetaMTAMailQuery.php:40-77 | src/applications/nuance/query/NuanceItemQuery.php:131-189 | src/applications/packages/query/PhabricatorPackagesPackageQuery.php:48-83 | src/applications/packages/query/PhabricatorPackagesPublisherQuery.php:36-59 | src/applications/packages/query/PhabricatorPackagesVersionQuery.php:48-83 | src/applications/passphrase/query/PassphraseCredentialQuery.php:103-154 | src/applications/paste/query/PhabricatorPasteQuery.php:104-162 | src/applications/phame/query/PhameBlogQuery.php:49-79 | src/applications/phame/query/PhamePostQuery.php:103-147 | src/applications/pholio/query/PholioImageQuery.php:48-71 | src/applications/pholio/query/PholioMockQuery.php:72-102 | src/applications/phortune/query/PhortuneAccountEmailQuery.php:65-102 | src/applications/phortune/query/PhortuneAccountQuery.php:86-109 | src/applications/phortune/query/PhortuneCartQuery.php:156-216 | src/applications/phortune/query/PhortuneChargeQuery.php:98-137 | src/applications/phortune/query/PhortuneMerchantQuery.php:80-103 | src/applications/phortune/query/PhortunePaymentMethodQuery.php:102-139 | src/applications/phortune/query/PhortunePurchaseQuery.php:78-103 | src/applications/phortune/query/PhortuneSubscriptionQuery.php:145-189 | src/applications/phriction/query/PhrictionContentQuery.php:36-66 | src/applications/phriction/query/PhrictionDocumentQuery.php:200-336 | src/applications/phurl/query/PhabricatorPhurlURLQuery.php:54-98 | src/applications/ponder/query/PonderAnswerQuery.php:32-55 | src/applications/ponder/query/PonderQuestionQuery.php:52-82 | src/applications/project/query/PhabricatorProjectColumnQuery.php:172-224 | src/applications/project/query/PhabricatorProjectQuery.php:458-648 | src/applications/project/query/PhabricatorProjectTriggerQuery.php:39-69 | src/applications/repository/query/PhabricatorRepositoryIdentityQuery.php:70-149 | src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php:80-124 | src/applications/repository/query/PhabricatorRepositoryPushEventQuery.php:81-111 | src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php:89-162 | src/applications/repository/query/PhabricatorRepositoryQuery.php:534-676 | src/applications/repository/query/PhabricatorRepositoryRefCursorQuery.php:93-142 | src/applications/repository/query/PhabricatorRepositorySyncEventQuery.php:67-104 | src/applications/repository/query/PhabricatorRepositoryURIQuery.php:38-61 | src/applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php:44-92 | src/applications/settings/query/PhabricatorUserPreferencesQuery.php:147-189 | src/applications/slowvote/query/PhabricatorSlowvoteQuery.php:117-147 | src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:44-79 | src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php:189-248 | src/applications/transactions/query/PhabricatorEditEngineConfigurationQuery.php:232-277 | src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobQuery.php:58-95 — These 90 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 90 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 90 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) src/applications/badges/query/PhabricatorBadgesSearchEngine.php:138 — src/applications/badges/query/PhabricatorBadgesSearchEngine.php:138-154 | src/applications/countdown/query/PhabricatorCountdownSearchEngine.php:147-163 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php:52-67 | src/applications/differential/query/DifferentialRevisionSearchEngine.php:251-267 | src/applications/files/query/PhabricatorFileSearchEngine.php:196-211 | src/applications/herald/query/HeraldRuleSearchEngine.php:153-169 | src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:176-191 | src/applications/macro/query/PhabricatorMacroSearchEngine.php:193-208 | src/applications/maniphest/query/ManiphestTaskSearchEngine.php:441-457 | src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php:159-176 | src/applications/passphrase/query/PassphraseCredentialSearchEngine.php:115-130 | src/applications/paste/query/PhabricatorPasteSearchEngine.php:207-222 | src/applications/pholio/query/PholioMockSearchEngine.php:134-150 | src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php:127-145 | src/applications/ponder/query/PonderQuestionSearchEngine.php:184-199 | src/applications/project/query/PhabricatorProjectSearchEngine.php:340-356 | src/applications/repository/query/PhabricatorRepositorySearchEngine.php:269-284 | src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php:167-182 | src/applications/spaces/query/PhabricatorSpacesNamespaceSearchEngine.php:102-118 — 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 (18 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (18 members, 50+ identical tokens) src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php:58 — src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php:58-76 | src/applications/countdown/phid/PhabricatorCountdownCountdownPHIDType.php:52-70 | src/applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php:58-76 | src/applications/differential/phid/DifferentialRevisionPHIDType.php:58-76 | src/applications/files/phid/PhabricatorFileFilePHIDType.php:56-74 | src/applications/fund/phid/FundInitiativePHIDType.php:57-75 | src/applications/harbormaster/phid/HarbormasterBuildablePHIDType.php:67-85 | src/applications/herald/phid/HeraldRulePHIDType.php:56-74 | src/applications/legalpad/phid/PhabricatorLegalpadDocumentPHIDType.php:53-71 | src/applications/maniphest/phid/ManiphestTaskPHIDType.php:55-73 | src/applications/owners/phid/PhabricatorOwnersPackagePHIDType.php:65-83 | src/applications/passphrase/phid/PassphraseCredentialPHIDType.php:55-73 | src/applications/paste/phid/PhabricatorPastePastePHIDType.php:52-70 | src/applications/pholio/phid/PholioMockPHIDType.php:56-74 | src/applications/phurl/phid/PhabricatorPhurlURLPHIDType.php:54-72 | src/applications/ponder/phid/PonderQuestionPHIDType.php:51-69 | src/applications/slowvote/phid/PhabricatorSlowvotePollPHIDType.php:49-67 | src/applications/spaces/phid/PhabricatorSpacesNamespacePHIDType.php:59-77 — These 18 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 18 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 18 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) src/applications/phortune/controller/account/PhortuneAccountChargesController.php:11 — src/applications/phortune/controller/account/PhortuneAccountChargesController.php:11-36 | src/applications/phortune/controller/account/PhortuneAccountEmailAddressesController.php:11-36 | src/applications/phortune/controller/account/PhortuneAccountManagersController.php:11-36 | src/applications/phortune/controller/account/PhortuneAccountOrdersController.php:11-37 | src/applications/phortune/controller/account/PhortuneAccountOverviewController.php:11-49 | src/applications/phortune/controller/account/PhortuneAccountPaymentMethodController.php:11-36 | src/applications/phortune/controller/account/PhortuneAccountSubscriptionController.php:11-37 | src/applications/phortune/controller/merchant/PhortuneMerchantInvoiceCreateController.php:12-262 | src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php:11-34 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionsController.php:11-35 — 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 · Duplicated block (59–60 lines × 2) · ×1
  • Duplicated block (59–60 lines × 2) src/applications/drydock/management/DrydockManagementReleaseLeaseWorkflow.php:41 — src/applications/drydock/management/DrydockManagementReleaseLeaseWorkflow.php:41-99 | src/applications/drydock/management/DrydockManagementReleaseResourceWorkflow.php:39-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:136 — src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:136-191 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:173-228 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` and `src/applications/people/controller/PhabricatorPeopleProfilePictureController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) src/applications/project/engineextension/PhabricatorProjectsCurtainExtension.php:30 — src/applications/project/engineextension/PhabricatorProjectsCurtainExtension.php:30-83 | src/applications/project/events/PhabricatorProjectUIEventListener.php:56-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (52–53 lines × 2) · ×1
  • Duplicated block (52–53 lines × 2) src/view/page/menu/PhabricatorMainMenuView.php:378 — src/view/page/menu/PhabricatorMainMenuView.php:378-430 | src/view/page/menu/PhabricatorMainMenuView.php:459-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/view/page/menu/PhabricatorMainMenuView.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (52 lines × 4) · ×1
  • Duplicated block (52 lines × 4) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:122 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:122-173 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:123-174 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:112-163 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:143-194 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/controller/ConpherenceRoomPictureController.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.
D4 · Code Duplication · Duplicated block (52 lines × 2) · ×1
  • Duplicated block (52 lines × 2) src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:11 — src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:11-62 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:11-62 — before extracting anything, compare `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php` and `src/applications/phame/controller/post/PhamePostHeaderPictureController.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:11` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (50–51 lines × 6) · ×1
  • Duplicated block (50–51 lines × 6) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:132 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:132-181 | src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:150-199 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:187-236 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:133-182 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:122-171 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:153-203 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/controller/ConpherenceRoomPictureController.php:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) src/view/page/menu/PhabricatorMainMenuView.php:410 — src/view/page/menu/PhabricatorMainMenuView.php:410-457 | src/view/page/menu/PhabricatorMainMenuView.php:570-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/view/page/menu/PhabricatorMainMenuView.php:410` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (44–47 lines × 2) · ×1
  • Duplicated block (44–47 lines × 2) src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:328 — src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:328-374 | src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:186-229 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php:375` calls `getIsCommandeerSideEffect` and `src/applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php:230` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) src/applications/config/check/PhabricatorManualActivitySetupCheck.php:39 — src/applications/config/check/PhabricatorManualActivitySetupCheck.php:39-81 | src/applications/config/check/PhabricatorManualActivitySetupCheck.php:108-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/check/PhabricatorManualActivitySetupCheck.php:39` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) src/applications/files/management/PhabricatorFilesManagementIntegrityWorkflow.php:9 — src/applications/files/management/PhabricatorFilesManagementIntegrityWorkflow.php:9-50 | src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php:13-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php:13` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (41 lines × 6) · ×1
  • Duplicated block (41 lines × 6) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:30 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:30-70 | src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:31-71 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:33-73 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:30-70 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:20-60 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:32-72 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/controller/ConpherenceRoomPictureController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:29` calls `getURI` and `src/applications/conpherence/controller/ConpherenceRoomPictureController.php:28` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (40–41 lines × 2) · ×1
  • Duplicated block (40–41 lines × 2) src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:33 — src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:33-72 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php:36-76 — before extracting anything, compare `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33–39 lines × 2) · ×1
  • Duplicated block (33–39 lines × 2) src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:96 — src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:96-134 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:107-139 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` and `src/applications/people/controller/PhabricatorPeopleProfilePictureController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) REDACTED:42 — REDACTED:42-79 | src/applications/metamta/adapter/PhabricatorMailPostmarkAdapter.php:46-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:40` calls `getOption` and `src/applications/metamta/adapter/PhabricatorMailPostmarkAdapter.php:45` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) src/applications/drydock/controller/DrydockLeaseReleaseController.php:10 — src/applications/drydock/controller/DrydockLeaseReleaseController.php:10-46 | src/applications/drydock/controller/DrydockResourceReleaseController.php:10-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) src/applications/project/controller/PhabricatorProjectColumnBulkEditController.php:14 — src/applications/project/controller/PhabricatorProjectColumnBulkEditController.php:14-51 | src/applications/project/controller/PhabricatorProjectColumnBulkMoveController.php:19-56 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/project/controller/PhabricatorProjectColumnBulkMoveController.php:17` calls `getURIData` and `src/applications/project/controller/PhabricatorProjectColumnBulkEditController.php:12` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) src/applications/project/herald/PhabricatorProjectHeraldAction.php:42 — src/applications/project/herald/PhabricatorProjectHeraldAction.php:42-78 | src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php:83-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/project/herald/PhabricatorProjectHeraldAction.php:80` calls `setMetadataValue` and `src/applications/subscriptions/herald/PhabricatorSubscriptionsHeraldAction.php:121` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) src/applications/phortune/query/PhortunePaymentMethodQuery.php:45 — src/applications/phortune/query/PhortunePaymentMethodQuery.php:45-80 | src/applications/phortune/query/PhortuneSubscriptionQuery.php:58-93 — before extracting anything, compare `src/applications/phortune/query/PhortunePaymentMethodQuery.php` and `src/applications/phortune/query/PhortuneSubscriptionQuery.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (34–35 lines × 2) · ×1
  • Duplicated block (34–35 lines × 2) src/view/phui/calendar/PHUICalendarDayView.php:215 — src/view/phui/calendar/PHUICalendarDayView.php:215-248 | src/view/phui/calendar/PHUICalendarMonthView.php:463-497 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (25–34 lines × 2) · ×1
  • Duplicated block (25–34 lines × 2) src/applications/almanac/controller/AlmanacDeviceViewController.php:198 — src/applications/almanac/controller/AlmanacDeviceViewController.php:198-222 | src/applications/drydock/controller/DrydockController.php:43-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (30–34 lines × 2) · ×1
  • Duplicated block (30–34 lines × 2) src/applications/audit/storage/PhabricatorAuditTransactionComment.php:32 — src/applications/audit/storage/PhabricatorAuditTransactionComment.php:32-65 | src/applications/differential/storage/DifferentialTransactionComment.php:38-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (23–34 lines × 2) · ×1
  • Duplicated block (23–34 lines × 2) src/applications/drydock/controller/DrydockController.php:8 — src/applications/drydock/controller/DrydockController.php:8-30 | src/applications/drydock/controller/DrydockController.php:46-79 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–33 lines × 5) · ×1
  • Duplicated block (21–33 lines × 5) src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:78 — src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:78-98 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:102-122 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:129-149 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:156-176 | src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:183-215 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) src/applications/almanac/controller/AlmanacServiceEditController.php:76 — src/applications/almanac/controller/AlmanacServiceEditController.php:76-106 | src/applications/calendar/controller/PhabricatorCalendarImportEditController.php:56-87 — before extracting anything, compare `src/applications/almanac/controller/AlmanacServiceEditController.php` and `src/applications/calendar/controller/PhabricatorCalendarImportEditController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (29 lines × 3) · ×1
  • Duplicated block (29 lines × 3) src/applications/dashboard/xaction/dashboard/PhabricatorDashboardNameTransaction.php:28 — src/applications/dashboard/xaction/dashboard/PhabricatorDashboardNameTransaction.php:28-56 | src/applications/dashboard/xaction/panel/PhabricatorDashboardPanelNameTransaction.php:28-56 | src/applications/dashboard/xaction/portal/PhabricatorDashboardPortalNameTransaction.php:28-56 — 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.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) src/applications/auth/controller/config/PhabricatorAuthListController.php:88 — src/applications/auth/controller/config/PhabricatorAuthListController.php:88-116 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderListController.php:50-77 — before extracting anything, compare `src/applications/auth/controller/config/PhabricatorAuthListController.php` and `src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderListController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (18–29 lines × 2) · ×1
  • Duplicated block (18–29 lines × 2) src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php:75 — src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php:75-103 | src/applications/metamta/controller/PhabricatorMetaMTAPostmarkReceiveController.php:82-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php:75` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (25–28 lines × 2) · ×1
  • Duplicated block (25–28 lines × 2) src/applications/config/controller/PhabricatorConfigConsoleController.php:109 — src/applications/config/controller/PhabricatorConfigConsoleController.php:109-136 | src/applications/config/controller/PhabricatorConfigConsoleController.php:308-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/controller/PhabricatorConfigConsoleController.php:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) src/applications/phortune/controller/account/PhortuneAccountManagersController.php:58 — src/applications/phortune/controller/account/PhortuneAccountManagersController.php:58-85 | src/applications/phortune/controller/merchant/PhortuneMerchantManagersController.php:60-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:31 — src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:31-57 | src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php:26-51 — before extracting anything, compare `src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–27 lines × 2) · ×1
  • Duplicated block (18–27 lines × 2) src/infrastructure/daemon/PhutilDaemonHandle.php:445 — src/infrastructure/daemon/PhutilDaemonHandle.php:445-471 | src/infrastructure/daemon/PhutilDaemonHandle.php:478-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 5) · ×1
  • Duplicated block (26 lines × 5) src/applications/differential/constants/DifferentialConstantsModule.php:68 — src/applications/differential/constants/DifferentialConstantsModule.php:68-108 | src/applications/differential/constants/DifferentialConstantsModule.php:116-142 | src/applications/differential/constants/DifferentialConstantsModule.php:150-176 | src/applications/herald/controller/HeraldTranscriptController.php:557-582 | src/applications/herald/controller/HeraldTranscriptController.php:649-677 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/constants/DifferentialConstantsModule.php:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (23–26 lines × 3) · ×1
  • Duplicated block (23–26 lines × 3) REDACTED:25 — REDACTED:25-47 | REDACTED:24-49 | src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php:36-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (25 lines × 4) · ×1
  • Duplicated block (25 lines × 4) src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:25 — src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:25-49 | src/applications/almanac/xaction/AlmanacNamespaceNameTransaction.php:34-58 | src/applications/almanac/xaction/AlmanacNetworkNameTransaction.php:34-58 | src/applications/almanac/xaction/AlmanacServiceNameTransaction.php:34-58 — before extracting anything, compare `src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php` and `src/applications/almanac/xaction/AlmanacNamespaceNameTransaction.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 `src/applications/almanac/xaction/AlmanacDeviceNameTransaction.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.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) src/applications/packages/storage/PhabricatorPackagesPackage.php:102 — src/applications/packages/storage/PhabricatorPackagesPackage.php:102-126 | src/applications/packages/storage/PhabricatorPackagesPublisher.php:78-102 | src/applications/packages/storage/PhabricatorPackagesVersion.php:62-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 all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) src/applications/calendar/parser/data/PhutilCalendarAbsoluteDateTime.php:79 — src/applications/calendar/parser/data/PhutilCalendarAbsoluteDateTime.php:79-103 | src/applications/calendar/parser/data/PhutilCalendarDuration.php:13-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18–25 lines × 2) · ×1
  • Duplicated block (18–25 lines × 2) src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:496 — src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:496-520 | src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php:523-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php:389 — src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php:389-413 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php:182-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.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.
D4 · Code Duplication · Duplicated block (23–24 lines × 3) · ×1
  • Duplicated block (23–24 lines × 3) src/applications/almanac/query/AlmanacDeviceQuery.php:63 — src/applications/almanac/query/AlmanacDeviceQuery.php:63-85 | src/applications/almanac/query/AlmanacServiceQuery.php:89-112 | src/applications/calendar/query/PhabricatorCalendarExternalInviteeQuery.php:33-55 — 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 `src/applications/almanac/query/AlmanacDeviceQuery.php:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 4) · ×1
  • Duplicated block (22–23 lines × 4) src/applications/guides/module/PhabricatorGuideInstallModule.php:59 — src/applications/guides/module/PhabricatorGuideInstallModule.php:59-81 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:32-54 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:59-81 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:109-130 — before extracting anything, compare `src/applications/guides/module/PhabricatorGuideInstallModule.php` and `src/applications/guides/module/PhabricatorGuideQuickStartModule.php` as WHOLE FILES: this scan already matched 4 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–23 lines × 2) · ×1
  • Duplicated block (14–23 lines × 2) src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:644 — src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:644-657 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:715-737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:644` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 3) · ×1
  • Duplicated block (21–22 lines × 3) src/applications/badges/controller/PhabricatorBadgesCommentController.php:38 — src/applications/badges/controller/PhabricatorBadgesCommentController.php:38-59 | src/applications/pholio/controller/PholioMockCommentController.php:56-76 | src/applications/slowvote/controller/PhabricatorSlowvoteCommentController.php:38-59 — before extracting anything, compare `src/applications/badges/controller/PhabricatorBadgesCommentController.php` and `src/applications/slowvote/controller/PhabricatorSlowvoteCommentController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/controller/PhabricatorBadgesCommentController.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) src/applications/files/management/PhabricatorFilesManagementCycleWorkflow.php:33 — src/applications/files/management/PhabricatorFilesManagementCycleWorkflow.php:33-54 | src/applications/files/management/PhabricatorFilesManagementEncodeWorkflow.php:73-94 | src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php:133-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) src/applications/differential/controller/DifferentialRevisionViewController.php:779 — src/applications/differential/controller/DifferentialRevisionViewController.php:779-797 | src/applications/maniphest/controller/ManiphestTaskDetailController.php:316-337 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (21 lines × 5) · ×1
  • Duplicated block (21 lines × 5) src/applications/almanac/controller/AlmanacDeviceViewController.php:85 — src/applications/almanac/controller/AlmanacDeviceViewController.php:85-105 | src/applications/almanac/controller/AlmanacNamespaceViewController.php:58-78 | src/applications/almanac/controller/AlmanacNetworkViewController.php:59-79 | src/applications/almanac/controller/AlmanacServiceViewController.php:90-110 | src/applications/diffusion/controller/DiffusionIdentityViewController.php:59-79 — before extracting anything, compare `src/applications/almanac/controller/AlmanacDeviceViewController.php` and `src/applications/almanac/controller/AlmanacNamespaceViewController.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (18–21 lines × 4) · ×1
  • Duplicated block (18–21 lines × 4) src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php:11 — src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php:11-31 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php:7-24 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php:7-27 | src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php:7-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) src/applications/conpherence/query/ConpherenceThreadQuery.php:111 — src/applications/conpherence/query/ConpherenceThreadQuery.php:111-131 | src/applications/phame/query/PhameBlogQuery.php:91-111 | src/applications/phortune/query/PhortuneMerchantQuery.php:54-74 — 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 `src/applications/conpherence/query/ConpherenceThreadQuery.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.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) src/applications/harbormaster/controller/HarbormasterPlanViewController.php:501 — src/applications/harbormaster/controller/HarbormasterPlanViewController.php:501-518 | src/applications/owners/controller/PhabricatorOwnersDetailController.php:364-384 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/owners/controller/PhabricatorOwnersDetailController.php:364` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16–21 lines × 2) · ×1
  • Duplicated block (16–21 lines × 2) src/applications/repository/engine/PhabricatorRepositoryEngine.php:92 — src/applications/repository/engine/PhabricatorRepositoryEngine.php:92-112 | src/applications/repository/engine/PhabricatorRepositoryRefEngine.php:513-528 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20 lines × 13) · ×1
  • Duplicated block (20 lines × 13) src/applications/calendar/query/PhabricatorCalendarExportQuery.php:44 — src/applications/calendar/query/PhabricatorCalendarExportQuery.php:44-63 | src/applications/calendar/query/PhabricatorCalendarImportQuery.php:38-57 | src/applications/countdown/query/PhabricatorCountdownQuery.php:38-57 | src/applications/files/query/PhabricatorFileQuery.php:399-418 | src/applications/herald/query/HeraldRuleQuery.php:203-222 | src/applications/macro/query/PhabricatorMacroQuery.php:106-125 | src/applications/paste/query/PhabricatorPasteQuery.php:106-125 | src/applications/pholio/query/PholioMockQuery.php:74-93 | src/applications/phurl/query/PhabricatorPhurlURLQuery.php:56-75 | src/applications/ponder/query/PonderAnswerQuery.php:34-53 | src/applications/ponder/query/PonderQuestionQuery.php:54-73 | src/applications/slowvote/query/PhabricatorSlowvoteQuery.php:119-138 | src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobQuery.php:60-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 13 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 13 times.
D4 · Code Duplication · Duplicated block (20 lines × 7) · ×1
  • Duplicated block (20 lines × 7) src/applications/auth/query/PhabricatorAuthFactorProviderQuery.php:38 — src/applications/auth/query/PhabricatorAuthFactorProviderQuery.php:38-57 | src/applications/dashboard/query/PhabricatorDashboardPortalQuery.php:32-51 | src/applications/dashboard/query/PhabricatorDashboardQuery.php:60-79 | src/applications/drydock/query/DrydockLeaseQuery.php:125-144 | src/applications/harbormaster/query/HarbormasterBuildPlanQuery.php:76-95 | src/applications/herald/query/HeraldWebhookQuery.php:32-51 | src/applications/nuance/query/NuanceItemQuery.php:147-166 — before extracting anything, compare `src/applications/auth/query/PhabricatorAuthFactorProviderQuery.php` and `src/applications/herald/query/HeraldWebhookQuery.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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 6) · ×1
  • Duplicated block (20 lines × 6) src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php:82 — src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php:82-101 | src/applications/repository/query/PhabricatorRepositoryPushEventQuery.php:83-102 | src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php:91-110 | src/applications/repository/query/PhabricatorRepositoryRefCursorQuery.php:95-114 | src/applications/repository/query/PhabricatorRepositorySyncEventQuery.php:69-88 | src/applications/repository/query/PhabricatorRepositoryURIQuery.php:40-59 — before extracting anything, compare `src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php` and `src/applications/repository/query/PhabricatorRepositorySyncEventQuery.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19–20 lines × 5) · ×1
  • Duplicated block (19–20 lines × 5) src/applications/guides/module/PhabricatorGuideInstallModule.php:32 — src/applications/guides/module/PhabricatorGuideInstallModule.php:32-50 | src/applications/guides/module/PhabricatorGuideInstallModule.php:89-107 | src/applications/guides/module/PhabricatorGuideInstallModule.php:118-136 | src/applications/guides/module/PhabricatorGuideInstallModule.php:142-161 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:86-104 — before extracting anything, compare `src/applications/guides/module/PhabricatorGuideInstallModule.php` and `src/applications/guides/module/PhabricatorGuideQuickStartModule.php` as WHOLE FILES: this scan already matched 4 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/guides/module/PhabricatorGuideInstallModule.php:52` calls `id`, `PhabricatorAuthProviderConfigQuery`, `setViewer` and `src/applications/guides/module/PhabricatorGuideInstallModule.php:110` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×1
  • Duplicated block (19–20 lines × 3) src/applications/passphrase/controller/PassphraseCredentialDestroyController.php:8 — src/applications/passphrase/controller/PassphraseCredentialDestroyController.php:8-27 | src/applications/passphrase/controller/PassphraseCredentialLockController.php:8-27 | src/applications/passphrase/controller/PassphraseCredentialPublicController.php:8-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18–20 lines × 3) · ×1
  • Duplicated block (18–20 lines × 3) src/applications/project/controller/PhabricatorProjectMembersAddController.php:41 — src/applications/project/controller/PhabricatorProjectMembersAddController.php:41-60 | src/applications/project/controller/PhabricatorProjectMembersRemoveController.php:42-61 | src/applications/project/controller/PhabricatorProjectSilenceController.php:47-64 — 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 `src/applications/project/controller/PhabricatorProjectMembersAddController.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.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) src/applications/herald/xaction/HeraldWebhookNameTransaction.php:34 — src/applications/herald/xaction/HeraldWebhookNameTransaction.php:34-52 | src/applications/herald/xaction/HeraldWebhookURITransaction.php:34-52 | src/applications/macro/xaction/PhabricatorMacroNameTransaction.php:34-51 — 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 `src/applications/herald/xaction/HeraldWebhookNameTransaction.php:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) src/applications/diffusion/controller/DiffusionChangeController.php:18 — src/applications/diffusion/controller/DiffusionChangeController.php:18-36 | src/applications/diffusion/controller/DiffusionDiffController.php:46-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18 lines × 5) · ×1
  • Duplicated block (18 lines × 5) src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php:47 — src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php:47-64 | src/applications/diffusion/management/DiffusionRepositoryLimitsManagementPanel.php:46-63 | src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php:44-61 | src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php:40-57 | src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php:42-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16–18 lines × 4) · ×1
  • Duplicated block (16–18 lines × 4) src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:72 — src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:72-87 | src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php:96-111 | src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php:86-101 | src/applications/project/typeahead/PhabricatorProjectMembersDatasource.php:84-101 — before extracting anything, compare `src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php` and `src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.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. 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, `src/applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php:70` calls `resolvePHIDs` and `src/applications/project/typeahead/PhabricatorProjectMembersDatasource.php:82` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:58 — src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:58-75 | src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php:61-78 | src/applications/drydock/controller/DrydockBlueprintDisableController.php:42-59 | src/applications/project/controller/PhabricatorProjectSilenceController.php:63-80 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php` and `src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:55` calls `setContentSourceFromRequest` and `src/applications/drydock/controller/DrydockBlueprintDisableController.php:39` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–18 lines × 3) · ×1
  • Duplicated block (16–18 lines × 3) src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:78 — src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:78-95 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:39-54 | src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php:43-58 — before extracting anything, compare `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php:56` calls `getViewer` and `src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:97` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–18 lines × 3) · ×1
  • Duplicated block (17–18 lines × 3) src/applications/phame/controller/post/PhamePostArchiveController.php:6 — src/applications/phame/controller/post/PhamePostArchiveController.php:6-22 | src/applications/phame/controller/post/PhamePostMoveController.php:6-23 | src/applications/phame/controller/post/PhamePostPublishController.php:6-22 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/phame/controller/post/PhamePostPublishController.php:24` calls `getURIData` and `src/applications/phame/controller/post/PhamePostArchiveController.php:24` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) src/applications/calendar/policyrule/PhabricatorCalendarEventInviteesPolicyRule.php:47 — src/applications/calendar/policyrule/PhabricatorCalendarEventInviteesPolicyRule.php:47-62 | src/applications/subscriptions/policyrule/PhabricatorSubscriptionsSubscribersPolicyRule.php:59-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/policyrule/PhabricatorCalendarEventInviteesPolicyRule.php:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–17 lines × 4) · ×1
  • Duplicated block (14–17 lines × 4) src/applications/files/controller/PhabricatorFileTransformListController.php:130 — src/applications/files/controller/PhabricatorFileTransformListController.php:130-144 | src/applications/macro/controller/PhabricatorMacroAudioController.php:148-162 | src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php:215-231 | src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:279-292 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:514 — src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:514-530 | src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php:565-579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) src/applications/people/conduit/UserConduitAPIMethod.php:14 — src/applications/people/conduit/UserConduitAPIMethod.php:14-26 | src/applications/people/storage/PhabricatorUser.php:1201-1217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) src/applications/phortune/controller/merchant/PhortuneMerchantOverviewController.php:30 — src/applications/phortune/controller/merchant/PhortuneMerchantOverviewController.php:30-43 | src/applications/phortune/controller/merchant/PhortuneMerchantProvidersController.php:31-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/phortune/controller/merchant/PhortuneMerchantProvidersController.php:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 6) · ×1
  • Duplicated block (16 lines × 6) src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php:103 — src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php:103-118 | src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php:134-149 | src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php:190-205 | src/applications/search/menuitem/PhabricatorEditEngineProfileMenuItem.php:131-146 | src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php:115-130 | src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php:118-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 6 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–16 lines × 5) · ×1
  • Duplicated block (15–16 lines × 5) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:212 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:212-227 | src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:117-131 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:218-233 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:114-128 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:108-123 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:216 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:216-232 | src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:121-136 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:222-238 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:118-133 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:204-220 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) src/applications/config/controller/services/PhabricatorConfigCacheController.php:26 — src/applications/config/controller/services/PhabricatorConfigCacheController.php:26-41 | src/applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php:22-35 | REDACTED:20-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/controller/services/PhabricatorConfigCacheController.php:26` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) src/applications/config/storage/PhabricatorConfigTransaction.php:17 — src/applications/config/storage/PhabricatorConfigTransaction.php:17-32 | src/applications/config/storage/PhabricatorConfigTransaction.php:55-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/storage/PhabricatorConfigTransaction.php:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 82) · ×1
  • Duplicated block (15 lines × 82) src/applications/almanac/query/AlmanacBindingQuery.php:95 — src/applications/almanac/query/AlmanacBindingQuery.php:95-109 | src/applications/almanac/query/AlmanacDeviceQuery.php:60-74 | src/applications/almanac/query/AlmanacInterfaceQuery.php:88-102 | src/applications/almanac/query/AlmanacNamespaceQuery.php:36-50 | src/applications/almanac/query/AlmanacNetworkQuery.php:36-50 | src/applications/almanac/query/AlmanacServiceQuery.php:86-100 | src/applications/auth/query/PhabricatorAuthChallengeQuery.php:44-58 | src/applications/auth/query/PhabricatorAuthContactNumberQuery.php:48-62 | src/applications/auth/query/PhabricatorAuthFactorConfigQuery.php:42-56 | src/applications/auth/query/PhabricatorAuthFactorProviderQuery.php:36-50 | src/applications/auth/query/PhabricatorAuthMessageQuery.php:30-44 | src/applications/auth/query/PhabricatorAuthPasswordQuery.php:42-56 | src/applications/auth/query/PhabricatorAuthProviderConfigQuery.php:36-50 | src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php:78-92 | src/applications/auth/query/PhabricatorAuthSessionQuery.php:64-78 | src/applications/auth/query/PhabricatorExternalAccountIdentifierQuery.php:42-56 | src/applications/auth/query/PhabricatorExternalAccountQuery.php:146-160 | src/applications/badges/query/PhabricatorBadgesQuery.php:46-60 | src/applications/calendar/query/PhabricatorCalendarEventQuery.php:358-372 | src/applications/calendar/query/PhabricatorCalendarExportQuery.php:42-56 | src/applications/calendar/query/PhabricatorCalendarExternalInviteeQuery.php:30-44 | src/applications/calendar/query/PhabricatorCalendarImportLogQuery.php:30-44 | src/applications/calendar/query/PhabricatorCalendarImportQuery.php:36-50 | src/applications/countdown/query/PhabricatorCountdownQuery.php:36-50 | src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php:50-64 | src/applications/dashboard/query/PhabricatorDashboardPortalQuery.php:30-44 | src/applications/dashboard/query/PhabricatorDashboardQuery.php:58-72 | src/applications/differential/query/DifferentialDiffQuery.php:123-137 | src/applications/drydock/query/DrydockAuthorizationQuery.php:124-138 | src/applications/drydock/query/DrydockBlueprintQuery.php:147-161 | src/applications/drydock/query/DrydockRepositoryOperationQuery.php:124-138 | src/applications/drydock/query/DrydockResourceQuery.php:94-108 | src/applications/files/query/PhabricatorFileQuery.php:397-411 | src/applications/fund/query/FundInitiativeQuery.php:36-50 | src/applications/harbormaster/query/HarbormasterBuildLogQuery.php:56-70 | src/applications/harbormaster/query/HarbormasterBuildPlanQuery.php:74-88 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:141-155 | src/applications/harbormaster/query/HarbormasterBuildStepQuery.php:30-44 | src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php:73-87 | src/applications/harbormaster/query/HarbormasterBuildUnitMessageQuery.php:30-44 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:129-143 | src/applications/herald/query/HeraldRuleQuery.php:201-215 | src/applications/herald/query/HeraldWebhookQuery.php:30-44 | src/applications/herald/query/HeraldWebhookRequestQuery.php:44-58 | src/applications/legalpad/query/LegalpadDocumentQuery.php:158-172 | src/applications/macro/query/PhabricatorMacroQuery.php:104-118 | src/applications/metamta/query/PhabricatorMetaMTAMailQuery.php:40-54 | src/applications/packages/query/PhabricatorPackagesPackageQuery.php:48-62 | src/applications/packages/query/PhabricatorPackagesPublisherQuery.php:36-50 | src/applications/packages/query/PhabricatorPackagesVersionQuery.php:48-62 | src/applications/passphrase/query/PassphraseCredentialQuery.php:103-117 | src/applications/paste/query/PhabricatorPasteQuery.php:104-118 | src/applications/phame/query/PhamePostQuery.php:103-117 | src/applications/pholio/query/PholioImageQuery.php:48-62 | src/applications/pholio/query/PholioMockQuery.php:72-86 | src/applications/phortune/query/PhortuneAccountEmailQuery.php:65-79 | src/applications/phortune/query/PhortuneAccountQuery.php:86-100 | src/applications/phortune/query/PhortuneMerchantQuery.php:80-94 | src/applications/phortune/query/PhortunePaymentMethodQuery.php:102-116 | src/applications/phortune/query/PhortuneSubscriptionQuery.php:145-159 | src/applications/phriction/query/PhrictionContentQuery.php:36-50 | src/applications/phriction/query/PhrictionDocumentQuery.php:200-214 | src/applications/phurl/query/PhabricatorPhurlURLQuery.php:54-68 | src/applications/ponder/query/PonderAnswerQuery.php:32-46 | src/applications/ponder/query/PonderQuestionQuery.php:52-66 | src/applications/project/query/PhabricatorProjectColumnQuery.php:172-186 | src/applications/project/query/PhabricatorProjectTriggerQuery.php:39-53 | src/applications/repository/query/PhabricatorRepositoryIdentityQuery.php:70-84 | src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php:80-94 | src/applications/repository/query/PhabricatorRepositoryPushEventQuery.php:81-95 | src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php:89-103 | src/applications/repository/query/PhabricatorRepositoryQuery.php:534-548 | src/applications/repository/query/PhabricatorRepositoryRefCursorQuery.php:93-107 | src/applications/repository/query/PhabricatorRepositorySyncEventQuery.php:67-81 | src/applications/repository/query/PhabricatorRepositoryURIQuery.php:38-52 | src/applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php:44-58 | src/applications/settings/query/PhabricatorUserPreferencesQuery.php:147-161 | src/applications/slowvote/query/PhabricatorSlowvoteQuery.php:117-131 | src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:44-58 | src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php:189-203 | src/applications/transactions/query/PhabricatorEditEngineConfigurationQuery.php:232-246 | src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobQuery.php:58-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 82 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 82 times.
D4 · Code Duplication · Duplicated block (13–15 lines × 8) · ×1
  • Duplicated block (13–15 lines × 8) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:215 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:215-229 | src/applications/harbormaster/controller/HarbormasterStepAddController.php:92-104 | src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:120-133 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:221-235 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:117-130 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:203-217 | src/applications/phortune/controller/product/PhortuneProductListController.php:54-67 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php:111-124 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/phame/controller/blog/PhameBlogHeaderPictureController.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/controller/ConpherenceRoomPictureController.php:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 8) · ×1
  • Duplicated block (15 lines × 8) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:41 — src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php:41-55 | src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:62-76 | src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php:65-79 | src/applications/drydock/controller/DrydockBlueprintDisableController.php:46-60 | src/applications/phortune/controller/merchant/PhortuneMerchantProviderDisableController.php:55-69 | src/applications/phriction/controller/PhrictionPublishController.php:66-80 | src/applications/project/controller/PhabricatorProjectSilenceController.php:67-81 | src/applications/transactions/controller/PhabricatorEditEngineConfigurationIsEditController.php:39-53 — before extracting anything, compare `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.php` and `src/applications/drydock/controller/DrydockAuthorizationAuthorizeController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelArchiveController.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.
D4 · Code Duplication · Duplicated block (13–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) src/applications/drydock/controller/DrydockAuthorizationListController.php:68 — src/applications/drydock/controller/DrydockAuthorizationListController.php:68-82 | src/applications/drydock/controller/DrydockLogController.php:90-103 | src/applications/drydock/controller/DrydockResourceController.php:39-51 — 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 `src/applications/drydock/controller/DrydockLogController.php:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–15 lines × 2) · ×1
  • Duplicated block (10–15 lines × 2) src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:156 — src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:156-165 | src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:207-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:48 — src/applications/calendar/controller/PhabricatorCalendarImportDisableController.php:48-59 | src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:56-69 | src/applications/drydock/controller/DrydockBlueprintDisableController.php:40-53 | src/applications/project/controller/PhabricatorProjectSilenceController.php:61-74 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php` and `src/applications/drydock/controller/DrydockBlueprintDisableController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/controller/PhabricatorCalendarImportDisableController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/diffusion/controller/DiffusionRepositoryURIDisableController.php:55` calls `setContentSourceFromRequest` and `src/applications/drydock/controller/DrydockBlueprintDisableController.php:39` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 4) · ×1
  • Duplicated block (13–14 lines × 4) src/applications/guides/module/PhabricatorGuideInstallModule.php:69 — src/applications/guides/module/PhabricatorGuideInstallModule.php:69-82 | src/applications/guides/module/PhabricatorGuideInstallModule.php:98-111 | src/applications/guides/module/PhabricatorGuideInstallModule.php:127-140 | src/applications/guides/module/PhabricatorGuideQuickStartModule.php:119-131 — before extracting anything, compare `src/applications/guides/module/PhabricatorGuideInstallModule.php` and `src/applications/guides/module/PhabricatorGuideQuickStartModule.php` as WHOLE FILES: this scan already matched 4 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 `src/applications/guides/module/PhabricatorGuideInstallModule.php:69` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/guides/module/PhabricatorGuideInstallModule.php:86` calls `id`, `PhabricatorConfigEntry`, `loadAllWhere` and `src/applications/guides/module/PhabricatorGuideQuickStartModule.php:132` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:111 — src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:111-124 | src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:128-140 | src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php:96-109 — before extracting anything, compare `src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php` and `src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/auth/editor/PhabricatorAuthSSHKeyEditor.php:107` calls `requireActor` and `src/applications/oauthserver/editor/PhabricatorOAuthServerEditor.php:92` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) src/applications/config/check/PhabricatorMySQLSetupCheck.php:225 — src/applications/config/check/PhabricatorMySQLSetupCheck.php:225-238 | src/applications/config/check/PhabricatorMySQLSetupCheck.php:294-304 | src/applications/config/check/PhabricatorMySQLSetupCheck.php:375-385 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/config/check/PhabricatorMySQLSetupCheck.php:225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) src/applications/drydock/typeahead/DrydockBlueprintDatasource.php:25 — src/applications/drydock/typeahead/DrydockBlueprintDatasource.php:25-38 | src/applications/herald/typeahead/HeraldRuleDatasource.php:37-48 | src/applications/herald/typeahead/HeraldWebhookDatasource.php:24-37 — 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 `src/applications/drydock/typeahead/DrydockBlueprintDatasource.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.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×1
  • Duplicated block (10–14 lines × 2) src/applications/almanac/management/AlmanacManagementUntrustKeyWorkflow.php:30 — src/applications/almanac/management/AlmanacManagementUntrustKeyWorkflow.php:30-39 | src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php:35-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/management/AlmanacManagementUntrustKeyWorkflow.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) src/applications/harbormaster/management/HarbormasterManagementRestartWorkflow.php:29 — src/applications/harbormaster/management/HarbormasterManagementRestartWorkflow.php:29-39 | src/applications/repository/management/PhabricatorRepositoryManagementThawWorkflow.php:50-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (9–13 lines × 19) · ×1
  • Duplicated block (9–13 lines × 19) src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:38 — src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:38-48 | src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:58-68 | src/applications/countdown/xaction/PhabricatorCountdownTitleTransaction.php:39-47 | src/applications/drydock/xaction/DrydockBlueprintNameTransaction.php:42-53 | src/applications/files/xaction/PhabricatorFileNameTransaction.php:40-48 | src/applications/fund/xaction/FundInitiativeNameTransaction.php:53-63 | src/applications/herald/xaction/HeraldRuleNameTransaction.php:29-41 | src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php:58-68 | src/applications/nuance/xaction/NuanceQueueNameTransaction.php:29-40 | src/applications/nuance/xaction/NuanceSourceNameTransaction.php:29-40 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:53-64 | src/applications/phame/xaction/PhameBlogNameTransaction.php:38-48 | src/applications/phame/xaction/PhameBlogParentDomainTransaction.php:66-76 | src/applications/phame/xaction/PhamePostTitleTransaction.php:38-48 | src/applications/pholio/xaction/PholioMockNameTransaction.php:74-82 | src/applications/phortune/xaction/PhortuneMerchantNameTransaction.php:38-48 | src/applications/ponder/xaction/PonderQuestionTitleTransaction.php:38-48 | src/applications/project/xaction/PhabricatorProjectNameTransaction.php:72-80 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php:45-55 — before extracting anything, compare `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php` and `src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:38` 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, `src/applications/project/xaction/PhabricatorProjectNameTransaction.php:84` calls `getEditor`, `getIsMilestone` and `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:52` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 10) · ×1
  • Duplicated block (13 lines × 10) src/applications/phortune/controller/account/PhortuneAccountChargesController.php:22 — src/applications/phortune/controller/account/PhortuneAccountChargesController.php:22-36 | src/applications/phortune/controller/account/PhortuneAccountEmailAddressesController.php:22-36 | src/applications/phortune/controller/account/PhortuneAccountManagersController.php:22-36 | src/applications/phortune/controller/account/PhortuneAccountOrdersController.php:23-37 | src/applications/phortune/controller/account/PhortuneAccountOverviewController.php:33-49 | src/applications/phortune/controller/account/PhortuneAccountPaymentMethodController.php:22-36 | src/applications/phortune/controller/account/PhortuneAccountSubscriptionController.php:23-37 | src/applications/phortune/controller/merchant/PhortuneMerchantInvoiceCreateController.php:250-262 | src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php:21-34 | src/applications/phortune/controller/merchant/PhortuneMerchantSubscriptionsController.php:22-35 — before extracting anything, compare `src/applications/phortune/controller/account/PhortuneAccountChargesController.php` and `src/applications/phortune/controller/merchant/PhortuneMerchantOrdersController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/phortune/controller/account/PhortuneAccountOverviewController.php:29` calls `buildStatusView`, `buildInvoicesSection` and `src/applications/phortune/controller/account/PhortuneAccountOrdersController.php:19` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 8) · ×1
  • Duplicated block (13 lines × 8) src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:68 — src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:68-80 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:83-95 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:98-110 | src/applications/fund/controller/FundInitiativeViewController.php:116-129 | src/applications/herald/controller/HeraldRuleViewController.php:68-81 | src/applications/nuance/controller/NuanceItemViewController.php:54-66 | src/applications/nuance/controller/NuanceQueueViewController.php:55-67 | src/applications/project/controller/PhabricatorProjectManageController.php:76-88 — before extracting anything, compare `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php` and `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.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 `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/herald/controller/HeraldRuleViewController.php:82` calls `setHref`, `getApplicationURI` and `src/applications/fund/controller/FundInitiativeViewController.php:130` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) src/applications/project/controller/PhabricatorProjectBoardDisableController.php:33 — src/applications/project/controller/PhabricatorProjectBoardDisableController.php:33-45 | src/applications/project/controller/PhabricatorProjectBoardImportController.php:79-90 | src/applications/project/controller/PhabricatorProjectBoardViewController.php:902-913 | src/applications/project/controller/PhabricatorProjectBoardViewController.php:994-1006 — before extracting anything, compare `src/applications/project/controller/PhabricatorProjectBoardDisableController.php` and `src/applications/project/controller/PhabricatorProjectBoardViewController.php` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–12 lines × 19) · ×1
  • Duplicated block (10–12 lines × 19) src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:37 — src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:37-46 | src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:57-66 | src/applications/countdown/xaction/PhabricatorCountdownTitleTransaction.php:36-45 | src/applications/differential/xaction/DifferentialRevisionTitleTransaction.php:38-48 | src/applications/drydock/xaction/DrydockBlueprintNameTransaction.php:41-51 | src/applications/files/xaction/PhabricatorFileNameTransaction.php:37-46 | src/applications/fund/xaction/FundInitiativeNameTransaction.php:52-61 | src/applications/herald/xaction/HeraldRuleNameTransaction.php:28-39 | src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php:57-66 | src/applications/nuance/xaction/NuanceQueueNameTransaction.php:28-38 | src/applications/nuance/xaction/NuanceSourceNameTransaction.php:28-38 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:52-62 | src/applications/phame/xaction/PhameBlogNameTransaction.php:37-46 | src/applications/phame/xaction/PhamePostTitleTransaction.php:37-46 | src/applications/pholio/xaction/PholioMockNameTransaction.php:71-80 | src/applications/phortune/xaction/PhortuneMerchantNameTransaction.php:37-46 | src/applications/ponder/xaction/PonderQuestionTitleTransaction.php:37-46 | src/applications/project/xaction/PhabricatorProjectNameTransaction.php:69-78 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php:44-53 — before extracting anything, compare `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php` and `src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 18) · ×1
  • Duplicated block (12 lines × 18) src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php:65 — src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php:65-76 | src/applications/countdown/phid/PhabricatorCountdownCountdownPHIDType.php:59-70 | src/applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php:65-76 | src/applications/differential/phid/DifferentialRevisionPHIDType.php:65-76 | src/applications/files/phid/PhabricatorFileFilePHIDType.php:63-74 | src/applications/fund/phid/FundInitiativePHIDType.php:64-75 | src/applications/harbormaster/phid/HarbormasterBuildablePHIDType.php:74-85 | src/applications/herald/phid/HeraldRulePHIDType.php:63-74 | src/applications/legalpad/phid/PhabricatorLegalpadDocumentPHIDType.php:60-71 | src/applications/maniphest/phid/ManiphestTaskPHIDType.php:62-73 | src/applications/owners/phid/PhabricatorOwnersPackagePHIDType.php:72-83 | src/applications/passphrase/phid/PassphraseCredentialPHIDType.php:62-73 | src/applications/paste/phid/PhabricatorPastePastePHIDType.php:59-70 | src/applications/pholio/phid/PholioMockPHIDType.php:63-74 | src/applications/phurl/phid/PhabricatorPhurlURLPHIDType.php:61-72 | src/applications/ponder/phid/PonderQuestionPHIDType.php:58-69 | src/applications/slowvote/phid/PhabricatorSlowvotePollPHIDType.php:56-67 | src/applications/spaces/phid/PhabricatorSpacesNamespacePHIDType.php:66-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 18 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 18 times.
D4 · Code Duplication · Duplicated block (10–12 lines × 12) · ×1
  • Duplicated block (10–12 lines × 12) src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:34 — src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:34-44 | src/applications/files/xaction/PhabricatorFileNameTransaction.php:34-43 | src/applications/fund/xaction/FundInitiativeNameTransaction.php:49-59 | src/applications/herald/xaction/HeraldRuleNameTransaction.php:25-36 | src/applications/nuance/xaction/NuanceQueueNameTransaction.php:25-35 | src/applications/nuance/xaction/NuanceSourceNameTransaction.php:25-35 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:49-60 | src/applications/phame/xaction/PhameBlogNameTransaction.php:34-44 | src/applications/pholio/xaction/PholioMockNameTransaction.php:68-77 | src/applications/phortune/xaction/PhortuneAccountNameTransaction.php:34-44 | src/applications/phortune/xaction/PhortuneMerchantNameTransaction.php:34-44 | src/applications/project/xaction/PhabricatorProjectNameTransaction.php:66-75 — before extracting anything, compare `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php` and `src/applications/files/xaction/PhabricatorFileNameTransaction.php` as WHOLE FILES: this scan already matched 6 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 9) · ×1
  • Duplicated block (11–12 lines × 9) src/applications/badges/query/PhabricatorBadgesSearchEngine.php:144 — src/applications/badges/query/PhabricatorBadgesSearchEngine.php:144-154 | src/applications/countdown/query/PhabricatorCountdownSearchEngine.php:153-163 | src/applications/differential/query/DifferentialRevisionSearchEngine.php:257-267 | src/applications/herald/query/HeraldRuleSearchEngine.php:159-169 | src/applications/maniphest/query/ManiphestTaskSearchEngine.php:447-457 | src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php:165-176 | src/applications/pholio/query/PholioMockSearchEngine.php:140-150 | src/applications/project/query/PhabricatorProjectSearchEngine.php:346-356 | src/applications/spaces/query/PhabricatorSpacesNamespaceSearchEngine.php:108-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 9 times.
D4 · Code Duplication · Duplicated block (12 lines × 8) · ×1
  • Duplicated block (12 lines × 8) src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:69 — src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:69-81 | src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php:84-96 | src/applications/auth/controller/mfa/PhabricatorAuthFactorProviderViewController.php:99-111 | src/applications/fund/controller/FundInitiativeViewController.php:118-130 | src/applications/nuance/controller/NuanceItemViewController.php:55-67 | src/applications/nuance/controller/NuanceQueueViewController.php:56-68 | src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:100-112 | src/applications/project/controller/PhabricatorProjectManageController.php:78-89 — before extracting anything, compare `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php` and `src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.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 `src/applications/auth/controller/config/PhabricatorAuthProviderViewController.php:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:7 — src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php:7-18 | src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php:7-18 | src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php:7-18 | src/applications/diffusion/controller/DiffusionRepositoryEditEnormousController.php:7-18 | src/applications/diffusion/controller/DiffusionRepositoryEditPublishingController.php:7-18 | src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php:7-18 — before extracting anything, compare `src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php` and `src/applications/diffusion/controller/DiffusionRepositoryEditPublishingController.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.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×1
  • Duplicated block (11–12 lines × 4) src/applications/files/controller/PhabricatorFileDetachController.php:7 — src/applications/files/controller/PhabricatorFileDetachController.php:7-18 | src/applications/files/controller/PhabricatorFileUICurtainAttachController.php:7-18 | src/applications/policy/controller/PhabricatorPolicyExplainController.php:11-22 | src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php:11-21 — before extracting anything, compare `src/applications/files/controller/PhabricatorFileDetachController.php` and `src/applications/files/controller/PhabricatorFileUICurtainAttachController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7–12 lines × 3) · ×1
  • Duplicated block (7–12 lines × 3) src/applications/differential/editor/DifferentialRevisionEditEngine.php:263 — src/applications/differential/editor/DifferentialRevisionEditEngine.php:263-274 | src/applications/differential/editor/DifferentialRevisionEditEngine.php:276-287 | src/applications/differential/editor/DifferentialRevisionEditEngine.php:288-294 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/differential/editor/DifferentialRevisionEditEngine.php:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/differential/editor/DifferentialRevisionEditEngine.php:263` calls `setDescription`, `pht` and `src/applications/differential/editor/DifferentialRevisionEditEngine.php:288` 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.
D4 · Code Duplication · Duplicated block (11 lines × 23) · ×1
  • Duplicated block (11 lines × 23) src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:42 — src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:42-52 | src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:62-72 | src/applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php:56-66 | src/applications/countdown/xaction/PhabricatorCountdownTitleTransaction.php:40-51 | src/applications/drydock/xaction/DrydockBlueprintNameTransaction.php:46-57 | src/applications/files/xaction/PhabricatorFileNameTransaction.php:41-52 | src/applications/fund/xaction/FundInitiativeNameTransaction.php:57-67 | src/applications/herald/xaction/HeraldRuleNameTransaction.php:33-45 | src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php:62-72 | src/applications/nuance/xaction/NuanceQueueNameTransaction.php:33-44 | src/applications/nuance/xaction/NuanceSourceNameTransaction.php:33-44 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:57-68 | src/applications/passphrase/xaction/PassphraseCredentialUsernameTransaction.php:43-53 | src/applications/phame/xaction/PhameBlogNameTransaction.php:42-52 | src/applications/phame/xaction/PhameBlogParentDomainTransaction.php:70-80 | src/applications/phame/xaction/PhameBlogParentSiteTransaction.php:54-64 | src/applications/phame/xaction/PhameBlogSubtitleTransaction.php:50-60 | src/applications/phame/xaction/PhamePostSubtitleTransaction.php:50-60 | src/applications/phame/xaction/PhamePostTitleTransaction.php:42-52 | src/applications/pholio/xaction/PholioMockNameTransaction.php:75-86 | src/applications/phortune/xaction/PhortuneMerchantNameTransaction.php:42-52 | src/applications/ponder/xaction/PonderQuestionTitleTransaction.php:42-52 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php:49-59 — before extracting anything, compare `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php` and `src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `src/applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php:52` calls `validateTransactions`, `array` and `src/applications/passphrase/xaction/PassphraseCredentialUsernameTransaction.php:40` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 16) · ×1
  • Duplicated block (11 lines × 16) src/applications/badges/query/PhabricatorBadgesSearchEngine.php:138 — src/applications/badges/query/PhabricatorBadgesSearchEngine.php:138-148 | src/applications/countdown/query/PhabricatorCountdownSearchEngine.php:147-157 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php:52-62 | src/applications/differential/query/DifferentialRevisionSearchEngine.php:251-261 | src/applications/files/query/PhabricatorFileSearchEngine.php:196-206 | src/applications/herald/query/HeraldRuleSearchEngine.php:153-163 | src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:176-186 | src/applications/macro/query/PhabricatorMacroSearchEngine.php:193-203 | src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php:159-169 | src/applications/passphrase/query/PassphraseCredentialSearchEngine.php:115-125 | src/applications/pholio/query/PholioMockSearchEngine.php:134-144 | src/applications/ponder/query/PonderQuestionSearchEngine.php:184-194 | src/applications/project/query/PhabricatorProjectSearchEngine.php:340-350 | src/applications/repository/query/PhabricatorRepositorySearchEngine.php:269-279 | src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php:167-177 | src/applications/spaces/query/PhabricatorSpacesNamespaceSearchEngine.php:102-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 16 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 16 times.
D4 · Code Duplication · Duplicated block (11 lines × 8) · ×1
  • Duplicated block (11 lines × 8) src/applications/conpherence/controller/ConpherenceRoomPictureController.php:190 — src/applications/conpherence/controller/ConpherenceRoomPictureController.php:190-200 | src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php:208-218 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:245-255 | src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:81-91 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:191-201 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:81-91 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:180-190 | src/applications/project/controller/PhabricatorProjectEditPictureController.php:252-262 — before extracting anything, compare `src/applications/conpherence/controller/ConpherenceRoomPictureController.php` and `src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conpherence/controller/ConpherenceRoomPictureController.php:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 7) · ×1
  • Duplicated block (9–11 lines × 7) src/applications/owners/controller/PhabricatorOwnersPathsController.php:162 — src/applications/owners/controller/PhabricatorOwnersPathsController.php:162-170 | src/applications/people/controller/PhabricatorPeopleProfilePictureController.php:255-263 | src/applications/phame/controller/blog/PhameBlogHeaderPictureController.php:100-108 | src/applications/phame/controller/blog/PhameBlogProfilePictureController.php:201-209 | src/applications/phame/controller/post/PhamePostHeaderPictureController.php:100-108 | src/applications/phortune/controller/merchant/PhortuneMerchantPictureController.php:190-198 | src/applications/phortune/controller/paymentmethod/PhortunePaymentMethodEditController.php:66-76 — before extracting anything, compare `src/applications/people/controller/PhabricatorPeopleProfilePictureController.php` and `src/applications/phame/controller/blog/PhameBlogProfilePictureController.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 146 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 5) · ×1
  • Duplicated block (10–11 lines × 5) src/applications/almanac/query/AlmanacDeviceSearchEngine.php:100 — src/applications/almanac/query/AlmanacDeviceSearchEngine.php:100-110 | src/applications/almanac/query/AlmanacServiceSearchEngine.php:93-103 | src/applications/auth/query/PhabricatorAuthSSHKeySearchEngine.php:80-89 | src/applications/nuance/query/NuanceQueueSearchEngine.php:56-65 | src/applications/nuance/query/NuanceSourceSearchEngine.php:65-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/query/AlmanacDeviceSearchEngine.php:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/nuance/query/NuanceSourceSearchEngine.php:77` calls `addIcon`, `getType` and `src/applications/nuance/query/NuanceQueueSearchEngine.php:67` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) src/applications/countdown/controller/PhabricatorCountdownViewController.php:110 — src/applications/countdown/controller/PhabricatorCountdownViewController.php:110-120 | src/applications/passphrase/controller/PassphraseCredentialViewController.php:65-75 | src/applications/paste/controller/PhabricatorPasteViewController.php:153-163 | src/applications/ponder/controller/PonderQuestionViewController.php:182-192 | src/applications/slowvote/controller/PhabricatorSlowvotePollController.php:121-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:90 — src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:90-99 | src/applications/phortune/controller/account/PhortuneAccountAddManagerController.php:36-46 | src/applications/phortune/controller/merchant/PhortuneMerchantAddManagerController.php:34-44 — before extracting anything, compare `src/applications/phortune/controller/account/PhortuneAccountAddManagerController.php` and `src/applications/phortune/controller/merchant/PhortuneMerchantAddManagerController.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:100` calls `getShortMessage` and `src/applications/phortune/controller/account/PhortuneAccountAddManagerController.php:47` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–11 lines × 3) · ×1
  • Duplicated block (6–11 lines × 3) src/infrastructure/storage/xsprintf/qsprintf.php:221 — src/infrastructure/storage/xsprintf/qsprintf.php:221-231 | src/infrastructure/storage/xsprintf/qsprintf.php:234-244 | src/infrastructure/storage/xsprintf/qsprintf.php:245-250 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/infrastructure/storage/xsprintf/qsprintf.php:221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/infrastructure/storage/xsprintf/qsprintf.php:220` calls `is_string` and `src/infrastructure/storage/xsprintf/qsprintf.php:245` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–11 lines × 3) · ×1
  • Duplicated block (8–11 lines × 3) src/view/control/AphrontCursorPagerView.php:143 — src/view/control/AphrontCursorPagerView.php:143-153 | src/view/control/AphrontCursorPagerView.php:156-166 | src/view/control/AphrontCursorPagerView.php:168-175 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/view/control/AphrontCursorPagerView.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 24) · ×1
  • Duplicated block (10 lines × 24) src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:41 — src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:41-50 | src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:61-70 | src/applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php:55-64 | src/applications/countdown/xaction/PhabricatorCountdownTitleTransaction.php:39-49 | src/applications/drydock/xaction/DrydockBlueprintNameTransaction.php:45-55 | src/applications/files/xaction/PhabricatorFileNameTransaction.php:40-50 | src/applications/fund/xaction/FundInitiativeNameTransaction.php:56-65 | src/applications/herald/xaction/HeraldRuleNameTransaction.php:32-43 | src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php:61-70 | src/applications/nuance/xaction/NuanceQueueNameTransaction.php:32-42 | src/applications/nuance/xaction/NuanceSourceNameTransaction.php:32-42 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:56-66 | src/applications/passphrase/xaction/PassphraseCredentialUsernameTransaction.php:42-51 | src/applications/phame/xaction/PhameBlogNameTransaction.php:41-50 | src/applications/phame/xaction/PhameBlogParentDomainTransaction.php:69-78 | src/applications/phame/xaction/PhameBlogParentSiteTransaction.php:53-62 | src/applications/phame/xaction/PhameBlogSubtitleTransaction.php:49-58 | src/applications/phame/xaction/PhamePostSubtitleTransaction.php:49-58 | src/applications/phame/xaction/PhamePostTitleTransaction.php:41-50 | src/applications/pholio/xaction/PholioMockNameTransaction.php:74-84 | src/applications/phortune/xaction/PhortuneMerchantNameTransaction.php:41-50 | src/applications/ponder/xaction/PonderQuestionTitleTransaction.php:41-50 | src/applications/project/xaction/PhabricatorProjectNameTransaction.php:72-82 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php:48-57 — before extracting anything, compare `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php` and `src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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, `src/applications/project/xaction/PhabricatorProjectNameTransaction.php:84` calls `getEditor`, `getIsMilestone` and `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:52` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 10) · ×1
  • Duplicated block (10 lines × 10) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php:58 — src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php:58-67 | src/applications/files/query/PhabricatorFileSearchEngine.php:202-211 | src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:182-191 | src/applications/macro/query/PhabricatorMacroSearchEngine.php:199-208 | src/applications/passphrase/query/PassphraseCredentialSearchEngine.php:121-130 | src/applications/paste/query/PhabricatorPasteSearchEngine.php:213-222 | src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php:136-145 | src/applications/ponder/query/PonderQuestionSearchEngine.php:190-199 | src/applications/repository/query/PhabricatorRepositorySearchEngine.php:275-284 | src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php:173-182 — before extracting anything, compare `src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php` and `src/applications/files/query/PhabricatorFileSearchEngine.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.
D4 · Code Duplication · Duplicated block (9–10 lines × 6) · ×1
  • Duplicated block (9–10 lines × 6) src/applications/auth/query/PhabricatorAuthPasswordQuery.php:83 — src/applications/auth/query/PhabricatorAuthPasswordQuery.php:83-92 | src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php:51-60 | src/applications/auth/query/PhabricatorAuthSessionQuery.php:42-51 | src/applications/conduit/query/PhabricatorConduitTokenQuery.php:90-98 | src/applications/drydock/query/DrydockCommandQuery.php:29-38 | src/applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php:128-137 — before extracting anything, compare `src/applications/auth/query/PhabricatorAuthPasswordQuery.php` and `src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/query/PhabricatorAuthPasswordQuery.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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) src/applications/drydock/controller/DrydockAuthorizationViewController.php:33 — src/applications/drydock/controller/DrydockAuthorizationViewController.php:33-42 | src/applications/drydock/controller/DrydockRepositoryOperationViewController.php:34-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/controller/DrydockAuthorizationViewController.php:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 17) · ×1
  • Duplicated block (8–9 lines × 17) src/applications/badges/query/PhabricatorBadgesSearchEngine.php:142 — src/applications/badges/query/PhabricatorBadgesSearchEngine.php:142-149 | src/applications/countdown/query/PhabricatorCountdownSearchEngine.php:151-158 | src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php:56-63 | src/applications/differential/query/DifferentialRevisionSearchEngine.php:255-262 | src/applications/files/query/PhabricatorFileSearchEngine.php:200-207 | src/applications/herald/query/HeraldRuleSearchEngine.php:157-164 | src/applications/legalpad/query/LegalpadDocumentSearchEngine.php:180-187 | src/applications/macro/query/PhabricatorMacroSearchEngine.php:197-204 | src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php:163-171 | src/applications/passphrase/query/PassphraseCredentialSearchEngine.php:119-126 | src/applications/pholio/query/PholioMockSearchEngine.php:138-145 | src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php:134-141 | src/applications/ponder/query/PonderQuestionSearchEngine.php:188-195 | src/applications/project/query/PhabricatorProjectSearchEngine.php:344-351 | src/applications/repository/query/PhabricatorRepositorySearchEngine.php:273-280 | src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php:171-178 | src/applications/spaces/query/PhabricatorSpacesNamespaceSearchEngine.php:106-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 17 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 17 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/query/PhabricatorBadgesSearchEngine.php:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 7) · ×1
  • Duplicated block (8–9 lines × 7) src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:30 — src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:30-37 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:62-70 | src/applications/harbormaster/query/HarbormasterBuildQuery.php:87-95 | src/applications/harbormaster/query/HarbormasterBuildStepQuery.php:59-67 | src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php:183-191 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:69-77 | src/applications/harbormaster/query/HarbormasterBuildableQuery.php:93-101 — before extracting anything, compare `src/applications/harbormaster/query/HarbormasterBuildQuery.php` and `src/applications/harbormaster/query/HarbormasterBuildStepQuery.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 `src/applications/harbormaster/query/HarbormasterBuildMessageQuery.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/harbormaster/query/HarbormasterBuildMessageQuery.php:37` calls `mpull`, `array` and `src/applications/harbormaster/query/HarbormasterBuildQuery.php:95` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:40 — src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:40-49 | src/applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php:53-61 | src/applications/phame/xaction/PhameBlogParentSiteTransaction.php:51-59 | src/applications/phame/xaction/PhameBlogSubtitleTransaction.php:47-55 | src/applications/phame/xaction/PhamePostSubtitleTransaction.php:47-55 | src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.php:40-49 — before extracting anything, compare `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php` and `src/applications/project/xaction/trigger/PhabricatorProjectTriggerNameTransaction.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) src/applications/badges/controller/PhabricatorBadgesCommentController.php:52 — src/applications/badges/controller/PhabricatorBadgesCommentController.php:52-61 | src/applications/pholio/controller/PholioMockCommentController.php:70-78 | src/applications/ponder/controller/PonderAnswerCommentController.php:51-60 | src/applications/ponder/controller/PonderQuestionCommentController.php:47-56 | src/applications/slowvote/controller/PhabricatorSlowvoteCommentController.php:52-61 — before extracting anything, compare `src/applications/badges/controller/PhabricatorBadgesCommentController.php` and `src/applications/slowvote/controller/PhabricatorSlowvoteCommentController.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:84 — src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:84-91 | src/applications/phortune/controller/account/PhortuneAccountManagersController.php:68-76 | src/applications/phortune/controller/merchant/PhortuneMerchantDetailsController.php:131-138 | src/applications/phortune/controller/merchant/PhortuneMerchantManagersController.php:70-78 — 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 `src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/phortune/controller/account/PhortuneAccountDetailsController.php:81` calls `id`, `PHUIObjectItemListView`, `setSimple` and `src/applications/phortune/controller/account/PhortuneAccountManagersController.php:66` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5–9 lines × 4) · ×1
  • Duplicated block (5–9 lines × 4) src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1117 — src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1117-1125 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1126-1134 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1135-1143 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1144-1148 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1115` calls `phutil_count`, `renderHandleList` and `src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1125` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) src/applications/diffusion/controller/DiffusionLintController.php:231 — src/applications/diffusion/controller/DiffusionLintController.php:231-237 | src/applications/diffusion/controller/DiffusionLintController.php:508-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/diffusion/controller/DiffusionLintController.php:508` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 21) · ×1
  • Duplicated block (8 lines × 21) src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:37 — src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php:37-45 | src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php:57-65 | src/applications/countdown/xaction/PhabricatorCountdownTitleTransaction.php:36-43 | src/applications/differential/xaction/DifferentialRevisionTitleTransaction.php:38-46 | src/applications/drydock/xaction/DrydockBlueprintNameTransaction.php:41-50 | src/applications/files/xaction/PhabricatorFileNameTransaction.php:37-44 | src/applications/fund/xaction/FundInitiativeNameTransaction.php:52-60 | src/applications/herald/xaction/HeraldRuleNameTransaction.php:28-37 | src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php:57-65 | src/applications/nuance/xaction/NuanceQueueNameTransaction.php:28-36 | src/applications/nuance/xaction/NuanceSourceNameTransaction.php:28-36 | src/applications/passphrase/xaction/PassphraseCredentialNameTransaction.php:52-61 | src/applications/phame/xaction/PhameBlogNameTransaction.php:37-45 | src/applications/phame/xaction/PhamePostTitleTransaction.php:37-45 | src/applications/pholio/xaction/PholioMockNameTransaction.php:71-78 | src/applications/phortune/xaction/PhortuneAccountNameTransaction.php:37-45 | src/applications/phortune/xaction/PhortuneMerchantNameTransaction.php:37-45 | src/applications/phurl/xaction/PhabricatorPhurlURLAliasTransaction.php:37-47 | src/applications/ponder/xaction/PonderQuestionTitleTransaction.php:37-45 | src/applications/project/xaction/PhabricatorProjectNameTransaction.php:69-76 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php:44-52 — before extracting anything, compare `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.php` and `src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/badges/xaction/PhabricatorBadgesBadgeNameTransaction.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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:44 — src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:44-51 | src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:204-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (3–5 lines × 5) · ×1
  • Duplicated block (3–5 lines × 5) src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php:45 — src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php:45-49 | src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php:36-40 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php:33-37 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php:39-41 | src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:215-217 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php:31` calls `getRef` and `src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php:34` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22 lines × 6) · ×1
  • Duplicated block (22 lines × 6) src/applications/almanac/editor/AlmanacDeviceEditor.php:7 — src/applications/almanac/editor/AlmanacDeviceEditor.php:7-28 | src/applications/almanac/editor/AlmanacNetworkEditor.php:7-28 | src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7-32 | src/applications/drydock/editor/DrydockBlueprintEditor.php:7-32 | src/applications/harbormaster/editor/HarbormasterBuildPlanEditor.php:7-30 | src/applications/passphrase/editor/PassphraseCredentialTransactionEditor.php:7-32 — before extracting anything, compare `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php` and `src/applications/drydock/editor/DrydockBlueprintEditor.php` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/almanac/editor/AlmanacDeviceEditor.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (34 lines × 3) · ×1
  • Duplicated block (34 lines × 3) src/applications/badges/icon/PhabricatorBadgesIconSet.php:9 — src/applications/badges/icon/PhabricatorBadgesIconSet.php:9-54 | src/applications/calendar/icon/PhabricatorCalendarIconSet.php:9-42 | src/applications/dashboard/icon/PhabricatorDashboardIconSet.php:9-53 — 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 `src/applications/badges/icon/PhabricatorBadgesIconSet.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (45 lines × 9) · ×1
  • Duplicated block (45 lines × 9) src/applications/badges/xaction/PhabricatorBadgesBadgeDescriptionTransaction.php:9 — src/applications/badges/xaction/PhabricatorBadgesBadgeDescriptionTransaction.php:9-53 | src/applications/calendar/xaction/PhabricatorCalendarEventDescriptionTransaction.php:9-53 | src/applications/countdown/xaction/PhabricatorCountdownDescriptionTransaction.php:9-53 | src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php:9-68 | src/applications/passphrase/xaction/PassphraseCredentialDescriptionTransaction.php:9-61 | src/applications/phame/xaction/PhameBlogDescriptionTransaction.php:9-57 | src/applications/phortune/xaction/PhortuneMerchantDescriptionTransaction.php:9-53 | src/applications/phurl/xaction/PhabricatorPhurlURLDescriptionTransaction.php:9-57 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceDescriptionTransaction.php:9-53 — before extracting anything, compare `src/applications/phame/xaction/PhameBlogDescriptionTransaction.php` and `src/applications/phurl/xaction/PhabricatorPhurlURLDescriptionTransaction.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 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 `src/applications/badges/xaction/PhabricatorBadgesBadgeDescriptionTransaction.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17 lines × 7) · ×1
  • Duplicated block (17 lines × 7) src/applications/auth/revoker/PhabricatorAuthRevoker.php:15 — src/applications/auth/revoker/PhabricatorAuthRevoker.php:15-35 | src/applications/cache/purger/PhabricatorCachePurger.php:11-27 | src/applications/metamta/engine/PhabricatorMailEngineExtension.php:10-44 | src/applications/metamta/stamp/PhabricatorMailStamp.php:12-85 | src/applications/transactions/engineextension/PhabricatorEditorExtension.php:11-79 | src/infrastructure/export/engine/PhabricatorExportEngineExtension.php:8-28 | src/infrastructure/export/format/PhabricatorExportFormat.php:10-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/revoker/PhabricatorAuthRevoker.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) src/applications/calendar/xaction/PhabricatorCalendarEventNameTransaction.php:9 — src/applications/calendar/xaction/PhabricatorCalendarEventNameTransaction.php:9-41 | src/applications/phurl/xaction/PhabricatorPhurlURLNameTransaction.php:9-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/xaction/PhabricatorCalendarEventNameTransaction.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (24 lines × 5) · ×1
  • Duplicated block (24 lines × 5) src/applications/calendar/xaction/PhabricatorCalendarEventNameTransaction.php:9 — src/applications/calendar/xaction/PhabricatorCalendarEventNameTransaction.php:9-41 | src/applications/calendar/xaction/PhabricatorCalendarExportNameTransaction.php:9-32 | src/applications/harbormaster/xaction/plan/HarbormasterBuildPlanNameTransaction.php:9-43 | src/applications/phurl/xaction/PhabricatorPhurlURLNameTransaction.php:9-41 | src/applications/repository/xaction/PhabricatorRepositoryNameTransaction.php:9-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/xaction/PhabricatorCalendarEventNameTransaction.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (35 lines × 6) · ×1
  • Duplicated block (35 lines × 6) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/chatlog/application/PhabricatorChatLogApplication.php:6-40 | src/applications/fund/application/PhabricatorFundApplication.php:6-70 | src/applications/phlux/application/PhabricatorPhluxApplication.php:6-40 | src/applications/phortune/application/PhabricatorPhortuneApplication.php:6-165 | src/applications/phrequent/application/PhabricatorPhrequentApplication.php:6-46 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/fund/application/PhabricatorFundApplication.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (65 lines × 12) · ×1
  • Duplicated block (65 lines × 12) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/conpherence/application/PhabricatorConpherenceApplication.php:6-82 | src/applications/diviner/application/PhabricatorDivinerApplication.php:6-80 | src/applications/fund/application/PhabricatorFundApplication.php:6-70 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 | src/applications/herald/application/PhabricatorHeraldApplication.php:6-91 | src/applications/owners/application/PhabricatorOwnersApplication.php:6-75 | src/applications/pholio/application/PhabricatorPholioApplication.php:6-85 | src/applications/phriction/application/PhabricatorPhrictionApplication.php:6-80 | src/applications/project/application/PhabricatorProjectApplication.php:6-174 | src/applications/slowvote/application/PhabricatorSlowvoteApplication.php:6-70 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/diviner/application/PhabricatorDivinerApplication.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 615 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (58 lines × 8) · ×1
  • Duplicated block (58 lines × 8) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/countdown/application/PhabricatorCountdownApplication.php:6-63 | src/applications/drydock/application/PhabricatorDrydockApplication.php:6-118 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 | src/applications/herald/application/PhabricatorHeraldApplication.php:6-91 | src/applications/owners/application/PhabricatorOwnersApplication.php:6-75 | src/applications/slowvote/application/PhabricatorSlowvoteApplication.php:6-70 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/countdown/application/PhabricatorCountdownApplication.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 589 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (24 lines × 4) · ×1
  • Duplicated block (24 lines × 4) src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7 — src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7-32 | src/applications/drydock/editor/DrydockBlueprintEditor.php:7-32 | src/applications/harbormaster/editor/HarbormasterBuildPlanEditor.php:7-30 | src/applications/passphrase/editor/PassphraseCredentialTransactionEditor.php:7-32 — before extracting anything, compare `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php` and `src/applications/drydock/editor/DrydockBlueprintEditor.php` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (75 lines × 3) · ×1
  • Duplicated block (75 lines × 3) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/diviner/application/PhabricatorDivinerApplication.php:6-80 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/diviner/application/PhabricatorDivinerApplication.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 615 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14 lines × 10) · ×1
  • Duplicated block (14 lines × 10) src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7 — src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7-32 | src/applications/diviner/editor/DivinerLiveBookEditor.php:7-20 | src/applications/drydock/editor/DrydockBlueprintEditor.php:7-32 | src/applications/harbormaster/editor/HarbormasterBuildPlanEditor.php:7-30 | src/applications/herald/editor/HeraldWebhookEditor.php:7-28 | src/applications/meta/editor/PhabricatorApplicationEditor.php:7-43 | src/applications/nuance/editor/NuanceItemEditor.php:7-20 | src/applications/nuance/editor/NuanceQueueEditor.php:7-20 | src/applications/nuance/editor/NuanceSourceEditor.php:7-24 | src/applications/passphrase/editor/PassphraseCredentialTransactionEditor.php:7-32 — before extracting anything, compare `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php` and `src/applications/drydock/editor/DrydockBlueprintEditor.php` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (79 lines × 2) · ×1
  • Duplicated block (79 lines × 2) src/applications/drydock/constants/DrydockLeaseStatus.php:14 — src/applications/drydock/constants/DrydockLeaseStatus.php:14-111 | src/applications/drydock/constants/DrydockResourceStatus.php:13-91 — before extracting anything, compare `src/applications/drydock/constants/DrydockLeaseStatus.php` and `src/applications/drydock/constants/DrydockResourceStatus.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/drydock/constants/DrydockLeaseStatus.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.
D4 · Code Duplication · Duplicated block (38 lines × 15) · ×1
  • Duplicated block (38 lines × 15) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/countdown/application/PhabricatorCountdownApplication.php:6-63 | src/applications/diviner/application/PhabricatorDivinerApplication.php:6-80 | src/applications/drydock/application/PhabricatorDrydockApplication.php:6-118 | src/applications/flag/application/PhabricatorFlagsApplication.php:6-43 | src/applications/fund/application/PhabricatorFundApplication.php:6-70 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 | src/applications/herald/application/PhabricatorHeraldApplication.php:6-91 | src/applications/macro/application/PhabricatorMacroApplication.php:6-63 | src/applications/owners/application/PhabricatorOwnersApplication.php:6-75 | src/applications/phortune/application/PhabricatorPhortuneApplication.php:6-165 | src/applications/phrequent/application/PhabricatorPhrequentApplication.php:6-46 | src/applications/slowvote/application/PhabricatorSlowvoteApplication.php:6-70 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 | src/applications/tokens/application/PhabricatorTokensApplication.php:6-43 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/countdown/application/PhabricatorCountdownApplication.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 589 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/fund/application/PhabricatorFundApplication.php:6-70 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/fund/application/PhabricatorFundApplication.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (121 lines × 2) · ×1
  • Duplicated block (121 lines × 2) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 1356 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (65 lines × 6) · ×1
  • Duplicated block (65 lines × 6) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 | src/applications/herald/application/PhabricatorHeraldApplication.php:6-91 | src/applications/owners/application/PhabricatorOwnersApplication.php:6-75 | src/applications/slowvote/application/PhabricatorSlowvoteApplication.php:6-70 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 1356 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (22 lines × 5) · ×1
  • Duplicated block (22 lines × 5) src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7 — src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7-32 | src/applications/drydock/editor/DrydockBlueprintEditor.php:7-32 | src/applications/harbormaster/editor/HarbormasterBuildPlanEditor.php:7-30 | src/applications/herald/editor/HeraldWebhookEditor.php:7-28 | src/applications/passphrase/editor/PassphraseCredentialTransactionEditor.php:7-32 — before extracting anything, compare `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php` and `src/applications/drydock/editor/DrydockBlueprintEditor.php` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 13) · ×1
  • Duplicated block (8 lines × 13) src/applications/auth/engine/PhabricatorAuthSessionEngineExtension.php:7 — src/applications/auth/engine/PhabricatorAuthSessionEngineExtension.php:7-28 | src/applications/auth/revoker/PhabricatorAuthRevoker.php:15-35 | src/applications/cache/purger/PhabricatorCachePurger.php:11-27 | src/applications/metamta/engine/PhabricatorMailEngineExtension.php:10-44 | src/applications/metamta/message/PhabricatorMailExternalMessage.php:7-14 | src/applications/metamta/stamp/PhabricatorMailStamp.php:12-85 | src/applications/policy/capability/PhabricatorPolicyCapability.php:19-64 | src/applications/search/index/PhabricatorFulltextEngineExtension.php:6-43 | src/applications/search/index/PhabricatorIndexEngineExtension.php:9-45 | src/applications/system/engine/PhabricatorDestructionEngineExtension.php:6-33 | src/applications/transactions/engineextension/PhabricatorEditorExtension.php:11-79 | src/infrastructure/export/engine/PhabricatorExportEngineExtension.php:8-28 | src/infrastructure/export/format/PhabricatorExportFormat.php:10-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 13 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 13 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/engine/PhabricatorAuthSessionEngineExtension.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (41 lines × 8) · ×1
  • Duplicated block (41 lines × 8) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/fund/application/PhabricatorFundApplication.php:6-70 | src/applications/multimeter/application/PhabricatorMultimeterApplication.php:7-52 | src/applications/nuance/application/PhabricatorNuanceApplication.php:6-73 | src/applications/phortune/application/PhabricatorPhortuneApplication.php:6-165 | src/applications/phrequent/application/PhabricatorPhrequentApplication.php:6-46 | src/applications/phriction/application/PhabricatorPhrictionApplication.php:6-80 | src/applications/project/application/PhabricatorProjectApplication.php:6-174 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/fund/application/PhabricatorFundApplication.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (18 lines × 6) · ×1
  • Duplicated block (18 lines × 6) src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7 — src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7-32 | src/applications/drydock/editor/DrydockBlueprintEditor.php:7-32 | src/applications/harbormaster/editor/HarbormasterBuildPlanEditor.php:7-30 | src/applications/meta/editor/PhabricatorApplicationEditor.php:7-43 | src/applications/nuance/editor/NuanceSourceEditor.php:7-24 | src/applications/passphrase/editor/PassphraseCredentialTransactionEditor.php:7-32 — before extracting anything, compare `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php` and `src/applications/drydock/editor/DrydockBlueprintEditor.php` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/dashboard/editor/PhabricatorDashboardPortalEditor.php:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (67 lines × 3) · ×1
  • Duplicated block (67 lines × 3) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/packages/application/PhabricatorPackagesApplication.php:6-86 | src/applications/phurl/application/PhabricatorPhurlApplication.php:6-72 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/phurl/application/PhabricatorPhurlApplication.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 429 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (83 lines × 2) · ×1
  • Duplicated block (83 lines × 2) src/applications/paste/application/PhabricatorPasteApplication.php:6 — src/applications/paste/application/PhabricatorPasteApplication.php:6-88 | src/applications/ponder/application/PhabricatorPonderApplication.php:6-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/paste/application/PhabricatorPasteApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (43 lines × 4) · ×1
  • Duplicated block (43 lines × 4) src/applications/people/menuitem/PhabricatorPeopleBadgesProfileMenuItem.php:9 — src/applications/people/menuitem/PhabricatorPeopleBadgesProfileMenuItem.php:9-51 | src/applications/people/menuitem/PhabricatorPeopleCommitsProfileMenuItem.php:9-51 | src/applications/people/menuitem/PhabricatorPeopleRevisionsProfileMenuItem.php:9-51 | src/applications/people/menuitem/PhabricatorPeopleTasksProfileMenuItem.php:9-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/people/menuitem/PhabricatorPeopleBadgesProfileMenuItem.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) src/applications/auth/tokentype/PhabricatorAuthTemporaryTokenType.php:11 — src/applications/auth/tokentype/PhabricatorAuthTemporaryTokenType.php:11-22 | src/applications/calendar/importlog/PhabricatorCalendarImportLogType.php:7-36 | src/applications/drydock/operation/DrydockRepositoryOperationType.php:22-63 | src/applications/guides/guidance/PhabricatorGuidanceEngineExtension.php:7-36 | src/applications/harbormaster/artifact/HarbormasterArtifact.php:11-61 | src/applications/people/userlog/PhabricatorUserLogType.php:7-16 | src/infrastructure/markup/markuprule/PhutilRemarkupHyperlinkEngineExtension.php:9-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/auth/tokentype/PhabricatorAuthTemporaryTokenType.php:11` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (49 lines × 3) · ×1
  • Duplicated block (49 lines × 3) src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php:9 — src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php:9-68 | src/applications/phame/xaction/PhameBlogDescriptionTransaction.php:9-57 | src/applications/phurl/xaction/PhabricatorPhurlURLDescriptionTransaction.php:9-57 — before extracting anything, compare `src/applications/phame/xaction/PhameBlogDescriptionTransaction.php` and `src/applications/phurl/xaction/PhabricatorPhurlURLDescriptionTransaction.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 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 `src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (80 lines × 4) · ×1
  • Duplicated block (80 lines × 4) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php:6-126 | src/applications/pholio/application/PhabricatorPholioApplication.php:6-85 | src/applications/project/application/PhabricatorProjectApplication.php:6-174 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 1356 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (41 lines × 4) · ×1
  • Duplicated block (41 lines × 4) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/fund/application/PhabricatorFundApplication.php:6-70 | src/applications/phortune/application/PhabricatorPhortuneApplication.php:6-165 | src/applications/phrequent/application/PhabricatorPhrequentApplication.php:6-46 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/fund/application/PhabricatorFundApplication.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (32 lines × 5) · ×1
  • Duplicated block (32 lines × 5) src/applications/conduit/application/PhabricatorConduitApplication.php:6 — src/applications/conduit/application/PhabricatorConduitApplication.php:6-66 | src/applications/multimeter/application/PhabricatorMultimeterApplication.php:7-52 | src/applications/phpast/application/PhabricatorPHPASTApplication.php:6-44 | src/applications/uiexample/application/PhabricatorUIExamplesApplication.php:6-47 | src/applications/xhprof/application/PhabricatorXHProfApplication.php:6-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/conduit/application/PhabricatorConduitApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (67 lines × 2) · ×1
  • Duplicated block (67 lines × 2) src/applications/calendar/application/PhabricatorCalendarApplication.php:6 — src/applications/calendar/application/PhabricatorCalendarApplication.php:6-148 | src/applications/phurl/application/PhabricatorPhurlApplication.php:6-72 — before extracting anything, compare `src/applications/calendar/application/PhabricatorCalendarApplication.php` and `src/applications/phurl/application/PhabricatorPhurlApplication.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 429 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/calendar/application/PhabricatorCalendarApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (98 lines × 2) · ×1
  • Duplicated block (98 lines × 2) src/applications/project/trigger/PhabricatorProjectTriggerAddProjectsRule.php:9 — src/applications/project/trigger/PhabricatorProjectTriggerAddProjectsRule.php:9-106 | src/applications/project/trigger/PhabricatorProjectTriggerRemoveProjectsRule.php:9-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/project/trigger/PhabricatorProjectTriggerAddProjectsRule.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (46 lines × 3) · ×1
  • Duplicated block (46 lines × 3) src/applications/metamta/application/PhabricatorMetaMTAApplication.php:6 — src/applications/metamta/application/PhabricatorMetaMTAApplication.php:6-51 | src/applications/search/application/PhabricatorSearchApplication.php:6-55 | src/applications/spaces/application/PhabricatorSpacesApplication.php:6-81 — 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 `src/applications/metamta/application/PhabricatorMetaMTAApplication.php:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (50 lines × 2) · ×1
  • Duplicated block (50 lines × 2) src/applications/search/engineextension/PhabricatorHovercardEngineExtension.php:8 — src/applications/search/engineextension/PhabricatorHovercardEngineExtension.php:8-57 | src/applications/search/engineextension/PhabricatorSearchEngineExtension.php:9-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/search/engineextension/PhabricatorHovercardEngineExtension.php:8` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) src/applications/search/engineextension/PhabricatorSearchEngineExtension.php:9 — src/applications/search/engineextension/PhabricatorSearchEngineExtension.php:9-84 | src/applications/transactions/engineextension/PhabricatorEditEngineExtension.php:8-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/search/engineextension/PhabricatorSearchEngineExtension.php:9` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (9 lines × 41) · ×1
  • Duplicated block (9 lines × 41) src/applications/almanac/query/AlmanacBindingSearchEngine.php:60 — src/applications/almanac/query/AlmanacBindingSearchEngine.php:60-68 | src/applications/almanac/query/AlmanacInterfaceSearchEngine.php:51-59 | src/applications/almanac/query/AlmanacNamespaceSearchEngine.php:51-59 | src/applications/almanac/query/AlmanacNetworkSearchEngine.php:51-59 | src/applications/almanac/query/AlmanacServiceSearchEngine.php:78-86 | src/applications/auth/query/PhabricatorAuthInviteSearchEngine.php:47-55 | src/applications/auth/query/PhabricatorAuthSSHKeySearchEngine.php:65-73 | src/applications/calendar/query/PhabricatorCalendarExportSearchEngine.php:48-56 | src/applications/calendar/query/PhabricatorCalendarImportLogSearchEngine.php:54-62 | src/applications/calendar/query/PhabricatorCalendarImportSearchEngine.php:45-53 | src/applications/diffusion/query/DiffusionPullLogSearchEngine.php:162-170 | src/applications/diffusion/query/DiffusionRepositoryIdentitySearchEngine.php:88-96 | src/applications/diffusion/query/DiffusionSyncLogSearchEngine.php:130-138 | src/applications/diviner/query/DivinerAtomSearchEngine.php:115-123 | src/applications/drydock/query/DrydockAuthorizationSearchEngine.php:94-102 | src/applications/drydock/query/DrydockLogSearchEngine.php:133-141 | src/applications/drydock/query/DrydockRepositoryOperationSearchEngine.php:70-78 | src/applications/flag/query/PhabricatorFlagSearchEngine.php:84-92 | src/applications/fund/query/FundBackerSearchEngine.php:86-94 | src/applications/harbormaster/query/HarbormasterArtifactSearchEngine.php:59-67 | src/applications/harbormaster/query/HarbormasterBuildLogSearchEngine.php:59-67 | src/applications/harbormaster/query/HarbormasterBuildStepSearchEngine.php:39-47 | src/applications/harbormaster/query/HarbormasterBuildTargetSearchEngine.php:109-117 | src/applications/harbormaster/query/HarbormasterBuildableSearchEngine.php:108-116 | src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php:130-138 | src/applications/nuance/query/NuanceItemSearchEngine.php:42-50 | src/applications/nuance/query/NuanceQueueSearchEngine.php:41-49 | src/applications/nuance/query/NuanceSourceSearchEngine.php:50-58 | src/applications/packages/query/PhabricatorPackagesPackageSearchEngine.php:64-72 | src/applications/packages/query/PhabricatorPackagesPublisherSearchEngine.php:54-62 | src/applications/packages/query/PhabricatorPackagesVersionSearchEngine.php:63-71 | src/applications/people/query/PhabricatorPeopleLogSearchEngine.php:116-124 | src/applications/phortune/query/PhortuneChargeSearchEngine.php:81-89 | src/applications/phortune/query/PhortuneMerchantSearchEngine.php:45-53 | src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php:117-125 | src/applications/phriction/query/PhrictionContentSearchEngine.php:57-65 | src/applications/project/query/PhabricatorProjectColumnSearchEngine.php:57-65 | src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php:83-91 | src/applications/settings/query/PhabricatorUserPreferencesSearchEngine.php:42-50 | src/applications/transactions/query/PhabricatorEditEngineSearchEngine.php:48-56 | src/applications/xhprof/query/PhabricatorXHProfSampleSearchEngine.php:41-49 — before extracting anything, compare `src/applications/almanac/query/AlmanacNamespaceSearchEngine.php` and `src/applications/almanac/query/AlmanacNetworkSearchEngine.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 26) · ×1
  • Duplicated block (6 lines × 26) src/applications/almanac/storage/AlmanacDevice.php:177 — src/applications/almanac/storage/AlmanacDevice.php:177-182 | src/applications/almanac/storage/AlmanacNamespace.php:118-123 | src/applications/almanac/storage/AlmanacNetwork.php:71-76 | src/applications/almanac/storage/AlmanacService.php:196-201 | src/applications/calendar/storage/PhabricatorCalendarImport.php:123-128 | src/applications/countdown/storage/PhabricatorCountdown.php:122-127 | src/applications/dashboard/storage/PhabricatorDashboard.php:158-163 | src/applications/dashboard/storage/PhabricatorDashboardPanel.php:142-147 | src/applications/dashboard/storage/PhabricatorDashboardPortal.php:90-95 | src/applications/differential/storage/DifferentialRevision.php:479-484 | src/applications/diviner/storage/DivinerLiveBook.php:105-110 | src/applications/drydock/storage/DrydockBlueprint.php:314-319 | src/applications/fund/storage/FundInitiative.php:116-121 | src/applications/herald/storage/HeraldWebhook.php:183-188 | src/applications/nuance/storage/NuanceQueue.php:62-67 | src/applications/nuance/storage/NuanceSource.php:118-123 | src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php:80-85 | src/applications/owners/storage/PhabricatorOwnersPackage.php:605-610 | src/applications/packages/storage/PhabricatorPackagesPackage.php:149-154 | src/applications/passphrase/storage/PassphraseCredential.php:140-145 | src/applications/pholio/storage/PholioMock.php:180-185 | src/applications/phriction/storage/PhrictionDocument.php:192-197 | src/applications/phurl/storage/PhabricatorPhurlURL.php:129-134 | src/applications/spaces/storage/PhabricatorSpacesNamespace.php:75-80 | src/applications/transactions/storage/PhabricatorApplicationTransaction.php:1981-1986 | src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php:166-171 — before extracting anything, compare `src/applications/almanac/storage/AlmanacDevice.php` and `src/applications/almanac/storage/AlmanacService.php` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/applications/fund/storage/FundInitiative.php:125` calls `getPHID`, `getOwnerPHID` and `src/applications/almanac/storage/AlmanacDevice.php:186` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 16) · ×1
  • Duplicated block (10 lines × 16) src/applications/dashboard/xaction/panel/PhabricatorDashboardPanelStatusTransaction.php:21 — src/applications/dashboard/xaction/panel/PhabricatorDashboardPanelStatusTransaction.php:21-30 | src/applications/drydock/xaction/DrydockBlueprintDisableTransaction.php:21-30 | src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php:27-37 | src/applications/passphrase/xaction/PassphraseCredentialConduitTransaction.php:17-26 | src/applications/people/xaction/PhabricatorUserApproveTransaction.php:53-62 | src/applications/people/xaction/PhabricatorUserDisableTransaction.php:21-30 | src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php:53-62 | src/applications/project/xaction/PhabricatorProjectLockTransaction.php:17-27 | src/applications/project/xaction/PhabricatorProjectWorkboardTransaction.php:21-31 | src/applications/repository/xaction/PhabricatorRepositoryDangerousTransaction.php:17-27 | src/applications/repository/xaction/PhabricatorRepositoryEnormousTransaction.php:17-27 | src/applications/repository/xaction/PhabricatorRepositoryNotifyTransaction.php:21-31 | src/applications/slowvote/xaction/PhabricatorSlowvoteShuffleTransaction.php:21-31 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceArchiveTransaction.php:17-26 | src/applications/transactions/xaction/PhabricatorEditEngineDisableTransaction.php:21-30 | src/applications/transactions/xaction/PhabricatorEditEngineIsEditTransaction.php:21-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 16 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 16 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) src/applications/differential/phid/DifferentialChangesetPHIDType.php:32 — src/applications/differential/phid/DifferentialChangesetPHIDType.php:32-38 | src/applications/harbormaster/phid/HarbormasterBuildArtifactPHIDType.php:32-36 | src/infrastructure/daemon/workers/phid/PhabricatorWorkerBulkJobPHIDType.php:32-38 | src/infrastructure/daemon/workers/phid/PhabricatorWorkerTriggerPHIDType.php:32-38 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) src/applications/differential/phid/DifferentialDiffPHIDType.php:32 — src/applications/differential/phid/DifferentialDiffPHIDType.php:32-39 | src/applications/drydock/phid/DrydockAuthorizationPHIDType.php:32-38 | src/applications/drydock/phid/DrydockLeasePHIDType.php:36-44 | src/applications/drydock/phid/DrydockRepositoryOperationPHIDType.php:32-38 | src/applications/herald/phid/HeraldTranscriptPHIDType.php:32-39 | src/applications/phortune/phid/PhortuneChargePHIDType.php:32-39 | src/applications/phortune/phid/PhortuneProductPHIDType.php:32-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) src/applications/differential/typeahead/DifferentialNoReviewersDatasource.php:67 — src/applications/differential/typeahead/DifferentialNoReviewersDatasource.php:67-75 | src/applications/diffusion/typeahead/DiffusionIdentityUnassignedDatasource.php:67-74 | src/applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php:66-73 | src/infrastructure/customfield/datasource/PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource.php:60-67 | src/infrastructure/customfield/datasource/PhabricatorCustomFieldApplicationSearchNoneFunctionDatasource.php:62-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (36 lines × 3) · ×1
  • Duplicated block (36 lines × 3) src/applications/diffusion/query/DiffusionPullLogSearchEngine.php:63 — src/applications/diffusion/query/DiffusionPullLogSearchEngine.php:63-98 | src/applications/people/query/PhabricatorPeopleLogSearchEngine.php:148-186 | src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php:108-185 — before extracting anything, compare `src/applications/diffusion/query/DiffusionPullLogSearchEngine.php` and `src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) src/applications/drydock/xaction/DrydockBlueprintDisableTransaction.php:34 — src/applications/drydock/xaction/DrydockBlueprintDisableTransaction.php:34-45 | src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php:41-52 | src/applications/passphrase/xaction/PassphraseCredentialConduitTransaction.php:30-41 | src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php:66-77 | src/applications/project/xaction/PhabricatorProjectLockTransaction.php:31-43 | src/applications/slowvote/xaction/PhabricatorSlowvoteShuffleTransaction.php:35-48 | src/applications/spaces/xaction/PhabricatorSpacesNamespaceArchiveTransaction.php:30-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) src/applications/almanac/controller/AlmanacNetworkListController.php:11 — src/applications/almanac/controller/AlmanacNetworkListController.php:11-16 | src/applications/conduit/controller/PhabricatorConduitListController.php:11-15 | src/applications/differential/controller/DifferentialRevisionListController.php:10-15 | src/applications/meta/controller/PhabricatorApplicationsListController.php:11-16 | src/applications/metamta/controller/PhabricatorMetaMTAMailListController.php:7-12 | src/applications/people/controller/PhabricatorPeopleInviteListController.php:7-12 | src/applications/people/controller/PhabricatorPeopleLogsController.php:7-12 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (6 lines × 13) · ×1
  • Duplicated block (6 lines × 13) src/applications/badges/mail/PhabricatorBadgesMailReceiver.php:16 — src/applications/badges/mail/PhabricatorBadgesMailReceiver.php:16-21 | src/applications/calendar/mail/PhabricatorCalendarEventMailReceiver.php:16-21 | src/applications/conpherence/mail/ConpherenceThreadMailReceiver.php:16-21 | src/applications/countdown/mail/PhabricatorCountdownMailReceiver.php:16-21 | src/applications/files/mail/FileMailReceiver.php:15-20 | src/applications/macro/mail/PhabricatorMacroMailReceiver.php:15-20 | src/applications/paste/mail/PasteMailReceiver.php:15-20 | src/applications/phame/mail/PhamePostMailReceiver.php:16-21 | src/applications/pholio/mail/PholioMockMailReceiver.php:15-20 | src/applications/phurl/mail/PhabricatorPhurlURLMailReceiver.php:16-21 | src/applications/ponder/mail/PonderAnswerMailReceiver.php:15-20 | src/applications/ponder/mail/PonderQuestionMailReceiver.php:15-20 | src/applications/slowvote/mail/PhabricatorSlowvoteMailReceiver.php:16-21 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 13 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 13 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.
D4 · Code Duplication · Duplicated block (10 lines × 14) · ×1
  • Duplicated block (10 lines × 14) src/applications/cache/garbagecollector/PhabricatorCacheGeneralGarbageCollector.php:17 — src/applications/cache/garbagecollector/PhabricatorCacheGeneralGarbageCollector.php:17-27 | src/applications/cache/garbagecollector/PhabricatorCacheMarkupGarbageCollector.php:17-26 | src/applications/conduit/garbagecollector/ConduitLogGarbageCollector.php:17-27 | src/applications/daemon/garbagecollector/PhabricatorDaemonLockLogGarbageCollector.php:17-26 | src/applications/daemon/garbagecollector/PhabricatorDaemonLogEventGarbageCollector.php:17-26 | src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php:17-26 | src/applications/diffusion/garbagecollector/DiffusionPullEventGarbageCollector.php:17-26 | src/applications/herald/garbagecollector/HeraldTranscriptGarbageCollector.php:17-33 | src/applications/herald/garbagecollector/HeraldWebhookRequestGarbageCollector.php:17-26 | src/applications/metamta/garbagecollector/MetaMTAMailReceivedGarbageCollector.php:17-26 | src/applications/notification/garbagecollector/FeedStoryNotificationGarbageCollector.php:17-27 | src/applications/people/garbagecollector/PeopleUserLogGarbageCollector.php:17-26 | src/applications/system/garbagecollector/PhabricatorSystemActionGarbageCollector.php:17-26 | src/applications/system/garbagecollector/PhabricatorSystemDestructionGarbageCollector.php:17-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 14 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 14 times. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (5 lines × 15) · ×1
  • Duplicated block (5 lines × 15) src/applications/calendar/remarkup/PhabricatorCalendarRemarkupRule.php:11 — src/applications/calendar/remarkup/PhabricatorCalendarRemarkupRule.php:11-16 | src/applications/countdown/remarkup/PhabricatorCountdownRemarkupRule.php:11-15 | src/applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php:13-18 | src/applications/differential/remarkup/DifferentialRemarkupRule.php:10-14 | src/applications/fund/remarkup/FundInitiativeRemarkupRule.php:10-15 | src/applications/harbormaster/remarkup/HarbormasterRemarkupRule.php:10-14 | src/applications/herald/remarkup/HeraldRemarkupRule.php:10-14 | src/applications/legalpad/remarkup/LegalpadDocumentRemarkupRule.php:10-15 | src/applications/maniphest/remarkup/ManiphestRemarkupRule.php:10-15 | src/applications/owners/remarkup/PhabricatorOwnersPackageRemarkupRule.php:11-16 | src/applications/passphrase/remarkup/PassphraseRemarkupRule.php:10-15 | src/applications/phame/remarkup/PhamePostRemarkupRule.php:11-16 | src/applications/phurl/remarkup/PhabricatorPhurlRemarkupRule.php:11-16 | src/applications/ponder/remarkup/PonderRemarkupRule.php:10-14 | src/applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php:11-15 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 15 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 15 times.
D4 · Code Duplication · Duplicated block (7 lines × 10) · ×1
  • Duplicated block (7 lines × 10) src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php:13 — src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php:13-19 | src/applications/fund/controller/FundInitiativeListController.php:11-18 | src/applications/herald/controller/HeraldRuleListController.php:10-17 | src/applications/legalpad/controller/LegalpadDocumentListController.php:10-17 | src/applications/macro/controller/PhabricatorMacroListController.php:10-17 | src/applications/notification/controller/PhabricatorNotificationListController.php:7-14 | src/applications/passphrase/controller/PassphraseCredentialListController.php:10-17 | src/applications/phame/controller/post/PhamePostListController.php:10-16 | src/applications/phriction/controller/PhrictionListController.php:11-18 | src/applications/ponder/controller/PonderQuestionListController.php:10-17 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 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 10 times. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (99 lines × 2) · ×1
  • Duplicated block (99 lines × 2) src/applications/maniphest/query/ManiphestTaskSearchEngine.php:49 — src/applications/maniphest/query/ManiphestTaskSearchEngine.php:49-147 | src/applications/project/query/PhabricatorProjectSearchEngine.php:22-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (32–42 lines × 2) · ×1
  • Duplicated block (32–42 lines × 2) src/applications/uiexample/examples/PHUIButtonExample.php:184 — src/applications/uiexample/examples/PHUIButtonExample.php:184-225 | src/applications/uiexample/examples/PHUILeftRightExample.php:39-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) src/applications/uiexample/examples/PHUIBoxExample.php:95 — src/applications/uiexample/examples/PHUIBoxExample.php:95-120 | src/applications/uiexample/examples/PHUIListExample.php:271-298 — before extracting anything, compare `src/applications/uiexample/examples/PHUIBoxExample.php` and `src/applications/uiexample/examples/PHUIListExample.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–24 lines × 3) · ×1
  • Duplicated block (18–24 lines × 3) src/applications/uiexample/examples/PHUIColorPalletteExample.php:110 — src/applications/uiexample/examples/PHUIColorPalletteExample.php:110-127 | src/applications/uiexample/examples/PHUIIconExample.php:224-247 | src/applications/uiexample/examples/PHUIImageMaskExample.php:66-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 all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–19 lines × 4) · ×1
  • Duplicated block (11–19 lines × 4) src/applications/uiexample/examples/PHUIBoxExample.php:94 — src/applications/uiexample/examples/PHUIBoxExample.php:94-104 | src/applications/uiexample/examples/PHUIButtonExample.php:200-214 | src/applications/uiexample/examples/PHUILeftRightExample.php:51-61 | src/applications/uiexample/examples/PHUIListExample.php:262-280 — before extracting anything, compare `src/applications/uiexample/examples/PHUIBoxExample.php` and `src/applications/uiexample/examples/PHUIListExample.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) src/applications/uiexample/examples/PHUIBoxExample.php:82 — src/applications/uiexample/examples/PHUIBoxExample.php:82-92 | src/applications/uiexample/examples/PHUIFeedStoryExample.php:143-153 | src/applications/uiexample/examples/PHUIListExample.php:245-257 — before extracting anything, compare `src/applications/uiexample/examples/PHUIBoxExample.php` and `src/applications/uiexample/examples/PHUIListExample.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/applications/uiexample/examples/PHUIListExample.php:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–10 lines × 5) · ×1
  • Duplicated block (7–10 lines × 5) src/applications/uiexample/examples/PHUIListExample.php:68 — src/applications/uiexample/examples/PHUIListExample.php:68-77 | src/applications/uiexample/examples/PHUIListExample.php:134-143 | src/applications/uiexample/examples/PHUIListExample.php:148-154 | src/applications/uiexample/examples/PHUIListExample.php:155-164 | src/applications/uiexample/examples/PHUIListExample.php:166-175 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/applications/uiexample/examples/PHUIListExample.php:133` calls `setSelected` and `src/applications/uiexample/examples/PHUIListExample.php:67` 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.
M1 · Documentation (README) · README may be stale · ×1
  • README may be stale — 82 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
P1 · CI/CD gates · No CI pipeline · ×1
  • No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 183 plain JS — the untyped files are support/aphlict/server/aphlict_server.js, support/aphlict/server/lib/AphlictAdminServer.js, support/aphlict/server/lib/AphlictClientServer.js, support/aphlict/server/lib/AphlictListener.js, support/aphlict/server/lib/AphlictListenerList.js, support/aphlict/server/lib/AphlictLog.js (+177 more).
R10 · Code Duplication · Duplication concentrated across 4 sibling directories (23 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (23 clone groups) webroot/rsrc/js/application/diff/DiffPathView.js:189 — 23 duplicated blocks under webroot/rsrc/js/ have copies in at least two of the sibling directories application, core, phui, phuix — 14 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 23 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 23 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 23 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 6 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 6 sibling directories (5 clone groups) webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:810 — 5 duplicated blocks under webroot/rsrc/js/application/ have copies in at least two of the sibling directories conpherence, diff, files, owners, pholio, projects — 2 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:10 — webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:10 · webroot/rsrc/js/application/search/behavior-reorder-queries.js:10 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (23 lines × 2 locations) · ×1
  • Duplicated block (23 lines × 2 locations) webroot/rsrc/js/application/herald/HeraldRuleEditor.js:179 — webroot/rsrc/js/application/herald/HeraldRuleEditor.js:179 · webroot/rsrc/js/application/herald/HeraldRuleEditor.js:258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) support/aphlict/server/lib/AphlictAdminServer.js:41 — support/aphlict/server/lib/AphlictAdminServer.js:41 · support/aphlict/server/lib/AphlictClientServer.js:46 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) webroot/rsrc/js/application/transactions/behavior-reorder-configs.js:10 — webroot/rsrc/js/application/transactions/behavior-reorder-configs.js:10 · webroot/rsrc/js/application/transactions/behavior-reorder-fields.js:10 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) webroot/rsrc/js/core/behavior-lightbox-attachments.js:212 — webroot/rsrc/js/core/behavior-lightbox-attachments.js:212 · webroot/rsrc/js/core/behavior-lightbox-attachments.js: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.
R10 · Code Duplication · Duplicated block (13 lines × 6 locations) · ×1
  • Duplicated block (13 lines × 6 locations) webroot/rsrc/js/application/diff/DiffPathView.js:191 — webroot/rsrc/js/application/diff/DiffPathView.js:191 · webroot/rsrc/js/application/fact/Chart.js:228 · webroot/rsrc/js/phuix/PHUIXActionView.js:180 · webroot/rsrc/js/phuix/PHUIXButtonView.js:87 · +2 more site(s) not listed — the 6 copies are spread across 5 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) webroot/rsrc/js/application/policy/behavior-policy-control.js:45 — webroot/rsrc/js/application/policy/behavior-policy-control.js:45 · webroot/rsrc/js/application/policy/behavior-policy-control.js:61 — 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 (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) webroot/rsrc/js/application/projects/behavior-project-boards.js:22 — webroot/rsrc/js/application/projects/behavior-project-boards.js:22 · webroot/rsrc/js/phui/behavior-phui-dropdown-menu.js:9 — the two spans are one implementation copied and then locally edited — 91 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (12 lines × 3 locations) · ×1
  • Duplicated block (12 lines × 3 locations) webroot/rsrc/js/application/diff/DiffChangesetList.js:2066 — webroot/rsrc/js/application/diff/DiffChangesetList.js:2066 · webroot/rsrc/js/application/diff/DiffChangesetList.js:2083 · webroot/rsrc/js/application/diff/DiffChangesetList.js:2100 — 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. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `install(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything.
R10 · Code Duplication · Duplicated block (12 lines × 7 locations) · ×1
  • Duplicated block (12 lines × 7 locations) webroot/rsrc/js/application/diff/DiffPathView.js:194 — webroot/rsrc/js/application/diff/DiffPathView.js:194 · webroot/rsrc/js/application/trigger/TriggerRule.js:119 · webroot/rsrc/js/core/HovercardList.js:92 · webroot/rsrc/js/phuix/PHUIXActionView.js:183 · +3 more site(s) not listed — the 7 copies are spread across 6 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×1
  • Duplicated block (12 lines × 2 locations) webroot/rsrc/js/core/DragAndDropFileUpload.js:237 — webroot/rsrc/js/core/DragAndDropFileUpload.js:237 · webroot/rsrc/js/core/DragAndDropFileUpload.js:368 — 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 (9 lines × 4 locations) · ×1
  • Duplicated block (9 lines × 4 locations) webroot/rsrc/js/application/projects/behavior-reorder-columns.js:10 — webroot/rsrc/js/application/projects/behavior-reorder-columns.js:10 · webroot/rsrc/js/application/search/behavior-reorder-profile-menu-items.js:10 · webroot/rsrc/js/application/search/behavior-reorder-queries.js:10 · webroot/rsrc/js/core/behavior-reorder-applications.js:10 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (7 lines × 3 locations) · ×1
  • Duplicated block (7 lines × 3 locations) support/aphlict/server/aphlict_server.js:184 — support/aphlict/server/aphlict_server.js:184 · webroot/rsrc/js/application/pholio/behavior-pholio-mock-edit.js:200 · webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:249 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function _update (cyclomatic 30, cognitive 46) · ×1
  • Complex function _update (cyclomatic 30, cognitive 46) webroot/rsrc/js/phuix/PHUIXAutocomplete.js:428 — _update has cyclomatic complexity 30 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function assist (cyclomatic 29, cognitive 26) · ×1
  • Complex function assist (cyclomatic 29, cognitive 26) webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js:188 — assist has cyclomatic complexity 29 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function updateCard (cyclomatic 26, cognitive 52) · ×1
  • Complex function updateCard (cyclomatic 26, cognitive 52) webroot/rsrc/js/application/projects/WorkboardBoard.js:601 — updateCard has cyclomatic complexity 26 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _onjumpkey (cyclomatic 24, cognitive 44) · ×1
  • Complex function _onjumpkey (cyclomatic 24, cognitive 44) webroot/rsrc/js/application/diff/DiffChangesetList.js:650 — _onjumpkey has cyclomatic complexity 24 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 23, cognitive 39) · ×1
  • Complex function (anonymous) (cyclomatic 23, cognitive 39) webroot/rsrc/js/application/diffusion/behavior-commit-graph.js:8 — (anonymous) has cyclomatic complexity 23 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.
R2 · Cyclomatic Complexity · Complex function redraw (cyclomatic 21, cognitive 36) · ×1
  • Complex function redraw (cyclomatic 21, cognitive 36) webroot/rsrc/js/application/diff/DiffTreeView.js:87 — redraw has cyclomatic complexity 21 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.
R2 · Cyclomatic Complexity · Complex function _getFragmentLocation (cyclomatic 19, cognitive 35) · ×1
  • Complex function _getFragmentLocation (cyclomatic 19, cognitive 35) webroot/rsrc/js/application/diff/DiffChangesetList.js:2643 — _getFragmentLocation has cyclomatic complexity 19 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.
R2 · Cyclomatic Complexity · Complex function getSelectableItems (cyclomatic 18, cognitive 30) · ×1
  • Complex function getSelectableItems (cyclomatic 18, cognitive 30) webroot/rsrc/js/application/diff/DiffChangeset.js:435 — getSelectableItems has cyclomatic complexity 18 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.
R2 · Cyclomatic Complexity · Complex function _getInlinesByType (cyclomatic 17, cognitive 44) · ×1
  • Complex function _getInlinesByType (cyclomatic 17, cognitive 44) webroot/rsrc/js/application/diff/DiffChangesetList.js:1968 — _getInlinesByType has cyclomatic complexity 17 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _newHoverMap (cyclomatic 16, cognitive 28) · ×1
  • Complex function _newHoverMap (cyclomatic 16, cognitive 28) webroot/rsrc/js/application/diff/DiffChangesetList.js:1539 — _newHoverMap has cyclomatic complexity 16 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function seek_anchor (cyclomatic 16, cognitive 25) · ×1
  • Complex function seek_anchor (cyclomatic 16, cognitive 25) webroot/rsrc/js/core/behavior-watch-anchor.js:34 — seek_anchor has cyclomatic complexity 16 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _onresults (cyclomatic 16, cognitive 24) · ×1
  • Complex function _onresults (cyclomatic 16, cognitive 24) webroot/rsrc/js/phuix/PHUIXAutocomplete.js:230 — _onresults has cyclomatic complexity 16 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getNewValue (cyclomatic 16, cognitive 22) · ×1
  • Complex function getNewValue (cyclomatic 16, cognitive 22) webroot/rsrc/js/core/behavior-time-typeahead.js:82 — getNewValue has cyclomatic complexity 16 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _redrawBanner (cyclomatic 15, cognitive 23) · ×1
  • Complex function _redrawBanner (cyclomatic 15, cognitive 23) webroot/rsrc/js/application/diff/DiffChangesetList.js:1817 — _redrawBanner has cyclomatic complexity 15 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _onmove (cyclomatic 15, cognitive 23) · ×1
  • Complex function _onmove (cyclomatic 15, cognitive 23) webroot/rsrc/js/core/DraggableList.js:486 — _onmove has cyclomatic complexity 15 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 15, cognitive 19) · ×1
  • Complex function (anonymous) (cyclomatic 15, cognitive 19) webroot/rsrc/js/application/projects/behavior-project-boards.js:13 — (anonymous) has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function openSearch (cyclomatic 15, cognitive 16) · ×1
  • Complex function openSearch (cyclomatic 15, cognitive 16) webroot/rsrc/js/application/repository/repository-crossreference.js:123 — openSearch has cyclomatic complexity 15 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _redrawFrame (cyclomatic 14, cognitive 21) · ×1
  • Complex function _redrawFrame (cyclomatic 14, cognitive 21) webroot/rsrc/js/application/projects/WorkboardColumn.js:394 — _redrawFrame has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function onstartselect (cyclomatic 14, cognitive 16) · ×1
  • Complex function onstartselect (cyclomatic 14, cognitive 16) webroot/rsrc/js/core/behavior-oncopy.js:11 — onstartselect has cyclomatic complexity 14 and cognitive complexity 16; 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 · webroot/rsrc/js/application/diff/DiffChangesetList.js · ×1
  • webroot/rsrc/js/application/diff/DiffChangesetList.js: 2282 lines of code webroot/rsrc/js/application/diff/DiffChangesetList.js:1 — webroot/rsrc/js/application/diff/DiffChangesetList.js has 2282 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 · webroot/rsrc/js/application/diff/DiffInline.js · ×1
  • webroot/rsrc/js/application/diff/DiffInline.js: 943 lines of code webroot/rsrc/js/application/diff/DiffInline.js:1 — webroot/rsrc/js/application/diff/DiffInline.js has 943 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 · webroot/rsrc/js/application/diff/DiffChangeset.js · ×1
  • webroot/rsrc/js/application/diff/DiffChangeset.js: 883 lines of code webroot/rsrc/js/application/diff/DiffChangeset.js:1 — webroot/rsrc/js/application/diff/DiffChangeset.js has 883 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 · webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js · ×1
  • webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js: 684 lines of code webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js:1 — webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js has 684 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 · webroot/rsrc/js/core/DraggableList.js · ×1
  • webroot/rsrc/js/core/DraggableList.js: 681 lines of code webroot/rsrc/js/core/DraggableList.js:1 — webroot/rsrc/js/core/DraggableList.js has 681 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 · webroot/rsrc/js/phuix/PHUIXAutocomplete.js · ×1
  • webroot/rsrc/js/phuix/PHUIXAutocomplete.js: 645 lines of code webroot/rsrc/js/phuix/PHUIXAutocomplete.js:1 — webroot/rsrc/js/phuix/PHUIXAutocomplete.js has 645 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 · webroot/rsrc/js/application/projects/WorkboardBoard.js · ×1
  • webroot/rsrc/js/application/projects/WorkboardBoard.js: 621 lines of code webroot/rsrc/js/application/projects/WorkboardBoard.js:1 — webroot/rsrc/js/application/projects/WorkboardBoard.js has 621 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 · webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js · ×1
  • webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js: 458 lines of code webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js:1 — webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Minor — 215 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×143
  • Orphaned file src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.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 src/applications/phriction/editor/PhrictionTransactionEditor.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 src/applications/conpherence/controller/ConpherenceUpdateController.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 src/applications/conpherence/view/ConpherenceDurableColumnView.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 src/applications/celerity/CelerityResourceMapGenerator.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 src/view/phui/calendar/PHUICalendarDayView.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 src/applications/files/builtin/PhabricatorFilesComposeAvatarBuiltinFile.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 src/applications/conpherence/storage/ConpherenceThread.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 src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.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 src/applications/diffusion/DiffusionLintSaveRunner.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 src/applications/auth/provider/PhabricatorOAuth2AuthProvider.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 src/applications/celerity/postprocessor/CelerityDarkModePostprocessor.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 src/infrastructure/cluster/search/PhabricatorSearchService.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 src/applications/conpherence/editor/ConpherenceEditor.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 src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.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 src/applications/conpherence/ConpherenceTransactionRenderer.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 src/applications/conpherence/controller/ConpherenceViewController.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 src/applications/differential/editor/DifferentialDiffEditor.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 src/applications/phame/controller/blog/PhameBlogManageController.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 src/applications/conpherence/view/ConpherenceTransactionView.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 src/applications/phame/controller/blog/PhameBlogProfilePictureController.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 src/applications/owners/xaction/PhabricatorOwnersPackagePathsTransaction.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 src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.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 src/applications/conpherence/controller/ConpherenceRoomPictureController.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 src/applications/phurl/storage/PhabricatorPhurlURL.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.
  • + 118 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 7 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate webroot/rsrc/js/application/diff/DiffChangesetList.js:2784 — `!node.childNodes || !node.childNodes.length` appears character-identically in 2 files — webroot/rsrc/js/application/diff/DiffChangesetList.js, webroot/rsrc/js/core/behavior-oncopy.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/applications/repository/management/PhabricatorRepositoryManagementMovePathsWorkflow.php:127 — `!$is_force && !phutil_console_confirm($prompt)` appears character-identically in 2 files — src/applications/repository/management/PhabricatorRepositoryManagementMovePathsWorkflow.php, src/applications/repository/management/PhabricatorRepositoryManagementThawWorkflow.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 src/aphront/AphrontRequest.php:501 — `$base_uri === null || !strlen($base_uri)` appears character-identically in 2 files — src/aphront/AphrontRequest.php, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/applications/repository/storage/PhabricatorRepositoryCommit.php:496 — `$committer !== null && strlen($committer)` appears character-identically in 2 files — src/applications/repository/storage/PhabricatorRepositoryCommit.php, src/applications/repository/storage/PhabricatorRepositoryCommitData.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 src/applications/phriction/editor/PhrictionTransactionEditor.php:310 — `$description !== null && strlen($description)` appears character-identically in 2 files — src/applications/phriction/editor/PhrictionTransactionEditor.php, src/applications/project/typeahead/PhabricatorProjectDatasource.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 src/applications/diffusion/controller/DiffusionController.php:107 — `$identifier !== null && strlen($identifier)` appears character-identically in 3 files — src/applications/diffusion/controller/DiffusionController.php, src/applications/diffusion/engine/DiffusionCommitHookEngine.php, src/applications/diviner/workflow/DivinerGenerateWorkflow.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 src/applications/transactions/editfield/PhabricatorEditField.php:421 — `$instructions !== null && strlen($instructions)` appears character-identically in 2 files — src/applications/transactions/editfield/PhabricatorEditField.php, src/infrastructure/customfield/field/PhabricatorCustomFieldList.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 src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php:336 — `$limit && ($count >= ($offset + $limit))` appears character-identically in 2 files — src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php, src/applications/diffusion/conduit/DiffusionQueryPathsConduitAPIMethod.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 src/applications/differential/query/DifferentialRevisionSearchEngine.php:48 — `$map['createdStart'] || $map['createdEnd']` appears character-identically in 5 files — src/applications/differential/query/DifferentialRevisionSearchEngine.php, src/applications/diffusion/query/DiffusionPullLogSearchEngine.php, src/applications/diffusion/query/DiffusionSyncLogSearchEngine.php, src/applications/people/query/PhabricatorPeopleLogSearchEngine.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 src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php:113 — `$map['upcoming'] && $map['upcoming'][0] == 'upcoming'` appears character-identically in 2 files — src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php, src/applications/countdown/query/PhabricatorCountdownSearchEngine.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 src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php:55 — `$other && ($other->getID() != $object->getID())` appears character-identically in 4 files — src/applications/almanac/xaction/AlmanacDeviceNameTransaction.php, src/applications/almanac/xaction/AlmanacNamespaceNameTransaction.php, src/applications/almanac/xaction/AlmanacNetworkNameTransaction.php, src/applications/almanac/xaction/AlmanacServiceNameTransaction.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 src/applications/repository/xaction/PhabricatorRepositoryCallsignTransaction.php:75 — `$other && ($other->getID() !== $object->getID())` appears character-identically in 2 files — src/applications/repository/xaction/PhabricatorRepositoryCallsignTransaction.php, src/applications/repository/xaction/PhabricatorRepositorySlugTransaction.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 src/applications/config/option/PhabricatorCoreConfigOptions.php:281 — `$protocol !== 'http' && $protocol !== 'https'` appears character-identically in 2 files — src/applications/config/option/PhabricatorCoreConfigOptions.php, src/applications/config/option/PhabricatorSecurityConfigOptions.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 src/applications/project/state/PhabricatorWorkboardViewState.php:45 — `$query_key !== null && strlen($query_key)` appears character-identically in 2 files — src/applications/project/state/PhabricatorWorkboardViewState.php, src/applications/transactions/bulk/PhabricatorBulkEngine.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 src/applications/search/controller/PhabricatorApplicationSearchController.php:118 — `$query_key === null || !strlen($query_key)` appears character-identically in 2 files — src/applications/search/controller/PhabricatorApplicationSearchController.php, src/applications/search/engine/PhabricatorApplicationSearchEngine.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 src/applications/herald/typeahead/HeraldRuleDatasource.php:25 — `$raw_query !== null && strlen($raw_query)` appears character-identically in 4 files — src/applications/herald/typeahead/HeraldRuleDatasource.php, src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php, src/applications/project/typeahead/PhabricatorProjectDatasource.php, src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.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 src/applications/diffusion/request/DiffusionGitRequest.php:6 — `$symbol !== null && preg_match('/^[a-f0-9]{40}\z/', $symbol)` appears character-identically in 2 files — src/applications/diffusion/request/DiffusionGitRequest.php, src/applications/diffusion/request/DiffusionMercurialRequest.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 src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php:84 — `($ex instanceof HTTPFutureResponseStatus) && ($ex->getStatusCode() == 404)` appears character-identically in 4 files — src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php, src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php, src/applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php, src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.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 src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php:49 — `($is_child && $is_future) || ($is_parent && !$is_future)` appears character-identically in 2 files — src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php, src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.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 src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php:68 — `($response instanceof AphrontResponse) || ($response instanceof AphrontResponseProducerInterface)` appears character-identically in 2 files — src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php, src/applications/settings/controller/PhabricatorSettingsMainController.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 scripts/daemon/exec/exec_daemon.php:58 — `function_exists('posix_isatty') && posix_isatty(STDIN)` appears character-identically in 2 files — scripts/daemon/exec/exec_daemon.php, src/infrastructure/daemon/PhutilDaemonOverseer.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 src/applications/diffusion/remarkup/DiffusionSourceLinkRemarkupRule.php:24 — `isFlatText($matches[0]) || $text_mode || $mail_mode` appears character-identically in 2 files — src/applications/diffusion/remarkup/DiffusionSourceLinkRemarkupRule.php, src/applications/macro/markup/PhabricatorIconRemarkupRule.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 src/infrastructure/markup/blockrule/PhutilRemarkupHeaderBlockRule.php:21 — `isset($lines[$cursor]) && !strlen(trim($lines[$cursor]))` appears character-identically in 2 files — src/infrastructure/markup/blockrule/PhutilRemarkupHeaderBlockRule.php, src/infrastructure/markup/blockrule/PhutilRemarkupHorizontalRuleBlockRule.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 src/infrastructure/markup/blockrule/PhutilRemarkupQuotesBlockRule.php:12 — `isset($lines[$pos]) && preg_match('/^>/', $lines[$pos])` appears character-identically in 2 files — src/infrastructure/markup/blockrule/PhutilRemarkupQuotesBlockRule.php, src/infrastructure/markup/blockrule/PhutilRemarkupReplyBlockRule.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 src/applications/base/controller/PhabricatorController.php:189 — `shouldAllowPublic() && PhabricatorEnv::getEnvConfig('policy.allow-public')` appears character-identically in 2 files — src/applications/base/controller/PhabricatorController.php, src/applications/conduit/call/ConduitCall.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×2
  • Hand-rolled JSON/XML parsing via regex src/infrastructure/markup/blockrule/PhutilRemarkupTableBlockRule.php:8 — 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 src/infrastructure/markup/blockrule/PhutilRemarkupTableBlockRule.php:14 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This PHP code already uses a real parser in the same package; use it here too.
X7 · Silent fallback defaults · Silent fallback default in catch · ×2
  • Silent fallback default in catch externals/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.
  • Silent fallback default in catch src/applications/harbormaster/customfield/HarbormasterBuildStepCoreCustomField.php:14 — `createFields` swallows every exception into `return array()` — 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.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 51 significant file(s) lose their only recent owner: src/applications/repository/storage/PhabricatorRepository.php, src/applications/transactions/storage/PhabricatorApplicationTransaction.php, src/applications/files/storage/PhabricatorFile.php, src/applications/calendar/parser/data/PhutilCalendarRecurrenceRule.php, src/applications/search/engine/PhabricatorApplicationSearchEngine.php, src/applications/calendar/storage/PhabricatorCalendarEvent.php, src/applications/differential/storage/DifferentialRevision.php, src/applications/policy/filter/PhabricatorPolicyFilter.php (+43 more). Pair on, review, or document these before any departure.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 143 of 1776 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 1776 of the 5927 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php, src/applications/phriction/editor/PhrictionTransactionEditor.php, src/applications/conpherence/controller/ConpherenceUpdateController.php, src/applications/conpherence/view/ConpherenceDurableColumnView.php, src/applications/celerity/CelerityResourceMapGenerator.php, src/view/phui/calendar/PHUICalendarDayView.php, src/applications/files/builtin/PhabricatorFilesComposeAvatarBuiltinFile.php, src/applications/conpherence/storage/ConpherenceThread.php (and 135 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
M1 · Documentation (README) · Thin README · ×1
  • Thin README — The root README is 33 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift externals/octicons/README.md:172 — externals/octicons/README.md links to `./CHANGELOG.md`, but `externals/octicons/CHANGELOG.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add phpstan or psalm (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X5 · Nullable reference types · PHP static analysis does not check null everywhere · ×1
  • PHP static analysis does not check null everywhere — This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-841cb50c24644f43b970313e0aaff15d/history.json --exit-code 0 --source .18artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-841cb50c24644f43b970313e0aaff15d/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .36artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)—none (no readable dependency manifest): 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 (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `externals/stripe-php/lib/Stripe/ApiRequestor.php` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (no readable dependency manifest)—none (no readable dependency manifest): 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 (a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Swift Package.swift/Package.resolved, a Cargo manifest, a Go module (go.mod/go.sum), a Gradle version catalogue, a Maven POM, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems) — not scanned yet).0—

Run 01a170fe-08ee-709a-b3cf-d1624c9be835 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

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