chore(quality): point PHPMD at the central ruleset - #108
Merged
Conversation
phpmd.xml becomes a stub referencing vendor/conduction/hydra-gates/quality-config/phpmd.xml, and the local phpmd-unusedparams.xml is deleted in favour of the central copy. ExcessiveClassLength 1050 is preserved via <exclude> plus a re-declaration. DevelopmentCodeFragment with ignore-namespaces=false is NOT carried over: with that setting PDepend namespace-qualifies every unqualified call, so the rule matched nothing in this fully namespaced codebase. The central true takes over and the rule becomes live at no cost - phpmd output is byte-identical. The second leg also gains an explicit --baseline-file, because PHPMD auto-discovers phpmd.baseline.xml next to the FIRST ruleset argument and the ruleset has moved into vendor/.
rubenvdlinde
requested review from
Rem-Dam,
SudoThijn,
WilcoLouwerse,
bbrands02,
remko48 and
rjzondervan
as code owners
August 12, 2026 21:42
Contributor
Quality Report — ConductionNL/launchpad @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| composer | ✅ | ✅ 104/104 | |||
| npm | ✅ | ✅ 548/548 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ | ||||
| Hydra gates | ❌ |
Quality workflow — 2026-08-12 22:22 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.
What
Step 2a of the Nextcloud CI/CD alignment, following the merged reference
larpingapp#314.
phpmd.xmlvendor/conduction/hydra-gates/quality-config/phpmd.xml+ this app's one live deviationphpmd-unusedparams.xmlWhat is preserved, and what is deliberately dropped
Preserved —
ExcessiveClassLengthat 1050. A real, reasoned relaxation, soit is re-declared verbatim with its comment via
<exclude>+ re-declaration.Dropped —
DevelopmentCodeFragmentwithignore-namespaces=false. That rulewas dead, and this PR brings it to life. PDepend resolves an unqualified call
inside a namespaced file to the current-namespace-qualified image, so
var_dump($x)innamespace OCA\Launchpad\Service;reaches the rule asOCA\Launchpad\Service\var_dumpand never matchesunwanted-functions. All ofthis app's production PHP is namespaced, so with the default
falsethe rulematched nothing anywhere — see ConductionNL/openregister#2286. The central
ruleset sets
ignore-namespaces=true, which is the working configuration, sothe local declaration is simply not carried over.
Measured consequence: none today. With the rule now genuinely active,
composer phpmdoutput is byte-identical — there is novar_dump/print_r/debug_zval_dump/debug_print_backtraceinlib/for it to find. The changeis that from now on there cannot be one. (Hydra gate 2,
forbidden-patterns, isthe broader independent guard and stays as it is.)
A second, quieter difference: the unused-params exclude-pattern
The local ruleset excluded
*/Migration/*; the central one excludes*/lib/Migration/*. PDepend compiles these into unanchored regexes, so thebroad form also swallows any
lib/*/Migration/directory —lib/Service/Migration/,lib/Command/Migration/— where signatures are not interface-mandated.Checked rather than assumed:
find lib -path '*/Migration/*' -name '*.php'resolves to
lib/Migrationand nothing else in this app, so the two patternsselect the same files here. Both forms produce 0 findings. The narrower central
pattern is strictly safer going forward.
--baseline-filebecomes explicit on the second legPHPMD only honours a baseline you name. Otherwise
Baseline\BaselineFileFinder::find()looks forphpmd.baseline.xmlin thedirectory of the first ruleset argument:
While
phpmd-unusedparams.xmlsat at the app root, the second leg wasauto-discovering
./phpmd.baseline.xml(106 violations, 1 of themUnusedFormalParameter) without ever naming it. Pointed intovendor/, itwould find no baseline at all. The flag is now passed explicitly.
The first leg still relies on auto-discovery, and that is fine:
phpmd.xmlstays at the app root, so the finder still lands on
./phpmd.baseline.xml. Itis left as-is to keep this diff to the lines the migration actually requires.
Verification
1. The effective rule set, before and after
Dumped rule by rule through PHPMD's own
RuleSetFactory(class, rule name,priority,
since, and every resolved property):Exactly two rules differ, and both are the intended changes above:
The count staying at 43 is the check on the
<exclude>+ re-declare pattern: ifthe exclude had been ignored,
ExcessiveClassLengthwould appear twice at 1050and 1000, and the stricter one would win.
composer phpmdoutput is byte-identical before and after (0 findings, exit 0).2. Positive control — the second leg is alive
A scratch copy of
lib/was given three probe classes and the post-changescript re-run:
lib/ProbeControl/ProbeMainLeg.php— anelsebranchlib/ProbeControl/ProbeUnusedParam.php— an unused parameterlib/Migration/ProbeMigrationUnusedParam.php— same violationExit code
2, i.e. the run can still fail with the baseline in place. The probesexist only in the scratch copy; nothing in this diff.
Deliberately not in this PR
ExcessiveClassLengthdebt — preserved at 1050, comment intact..github@main4c37371d), sodevelopmentalready carries this app's wholebacklog. This PR adds nothing to it;
phpmditself stays green.Quality Reportis an aggregator and never an independent defect.