Repository navigation
refactor: clear the phpmd violations every open PR inherits from development - #1400
Merged
Merged
Conversation
…ller phpmd failed on SessionController after #1250 added the example-resident sign-in: 1087 lines (limit 1000), 26 methods (limit 25), and a guard with cyclomatic complexity 13 (limit 10). phpmd scans all of lib/, so every open PR inherited the failure. The route keeps its URL (/portal/api/session/example-resident) and its attributes; it now maps to ExampleResidentController::signIn. The switch, declaration and install-record checks move into ExampleResidentSignIn, which already reads the same switch for the site's demo card. The four tests move with the route, unchanged apart from the method name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
phpmd failed on PortalShell after #1253 added the resident menu groups: class complexity 53 (limit 50) and residentMenu() at cyclomatic complexity 11 (limit 10). PortalResidentMenu now owns that projection, split into groups and items, the way PortalSignInText owns the sign-in text. The output is unchanged; PortalShellTest covers it through PortalShell::project(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1394 split PortalShell::residentMenu() and added the leave-out list; the resident menu now lives in PortalResidentMenu, so its leaveOut() moves there. PortalShell on development is at class complexity 59 (limit 50); with the projection moved out it passes phpmd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The refusal tests gave the resident no portal account, so every refusal was also a missing-account 404: removing the switch check or the portal check left them green. The shared parts now include an active account, so a 404 can only come from the guard under test. New cases: a portal without the nextcloud mode, a lookup that answers with the resident's portal for another portal the caller named, and no portal lookup at all while the switch is off. Each guard in the controller and in ExampleResidentSignIn was removed in turn; every removal now fails a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Quality Report — ConductionNL/portaliq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| check-manifest | ✅ | ||||
| format | ✅ | ||||
| check-l10n-js | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| check-reuse | ✅ | ||||
| composer | ✅ | ✅ 108/108 | |||
| npm | ✅ | ✅ 984/984 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ | ||||
| Newman | ✅ | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ✅ |
Quality workflow — 2026-10-08 12:52 UTC
Download the full PDF report from the workflow artifacts.
The coverage guard failed the PR: the code it kept or added was covered at 96.44% against 96.94% on the base. The uncovered statements were the 503 when no session can be issued, the refusal when the portal lookup throws, ExampleResidentSignIn's early refusals, and a non-text value in PortalResidentMenu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Quality Report — ConductionNL/portaliq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| check-manifest | ✅ | ||||
| format | ✅ | ||||
| check-l10n-js | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| check-reuse | ✅ | ||||
| composer | ✅ | ✅ 108/108 | |||
| npm | ✅ | ✅ 984/984 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ✅ 2983/2983 · 1 skipped | ||||
| Newman | ✅ 1/1 | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ✅ |
Quality workflow — 2026-10-08 14:24 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
quality / PHP Quality (phpmd)has been red on every open PR intodevelopmentsince #1250 and #1253 landed (for example #1243, #1364, #1366, #1391 to #1397). phpmd scans all oflib/, not only the PR diff, so each PR inherits the failure, and theQuality Reportthat sums up the checks goes red with it. phpmd is not a required check, so the PRs could still merge while red, and that is how the debt got ontodevelopment.The violations, all in code from those PRs:
SessionControllerSessionControllerSessionController::exampleResidentUser()PortalShellPortalShell::residentMenu()What
GET /portal/api/session/example-residentkeeps its URL and its attributes (#[PublicPage],#[NoCSRFRequired],#[AnonRateLimit(10/60)],#[BruteForceProtection]), so the frontend is unchanged. It now maps toExampleResidentController::signIn(exampleResident#signIn).ExampleResidentSignIn(open(),userFor()). That service already reads the same switch for the site's demo card.nextcloudmode.PortalResidentMenu: card label, groups and items, and the leave-out list that feat(site): a portal may leave items out of the resident menu (resident-menu-leave-out) #1394 added. It works the same wayPortalSignInTextowns the sign-in text. The output ofPortalShell::project()is unchanged, and feat(site): a portal may leave items out of the resident menu (resident-menu-leave-out) #1394's leave-out test passes through the new class.ExampleResidentControllerTestand are tightened.nextcloudmode, a lookup that answers with the resident's portal for another portal the caller named, and no portal lookup while the switch is off.ExampleResidentSignInTestandPortalResidentMenuTestfor the service's early refusals, the menu limits and non-text values.No suppressions were added. The existing
@SuppressWarningsonSessionController(coupling, class complexity, parameter list) are untouched.Test
phpmd lib text phpmd.xmland the unused-params ruleset → exit 0 (before: 7 violations).run-hydra-gates.sh --scope-to-diff --base origin/development→ exit 0, 45 of 45 applicable gates ran.appinfo/routes.phpexist ondevelopmenttoo.open(),nextcloudmode, portal slug, declaration, declared portal), and every removal fails a test inExampleResidentControllerTest.phpunit-unit.xml: 2969 tests, 62 errors, the same counts asdevelopmentbefore the merge. Those errors need a running Nextcloud (Class "OC" not found).SessionControllerTest(56),ExampleResidentControllerTest(7),ExampleResidentSignInTest(2),PortalResidentMenuTest(2),PortalShellTest(13),PortalRuntimeConfigResolverTest(25) andPortaliqRegisterConfigTest(26) all pass.🤖 Generated with Claude Code