From e6687a8b457a6722f5b061d311186ef11e6e5ad5 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Mon, 3 Aug 2026 10:24:32 +0200 Subject: [PATCH] fix(quality): phpmd DevelopmentCodeFragment could never fire on namespaced code Every Conduction repo enables rulesets/design.xml/DevelopmentCodeFragment, and it has never reported anything in any of them. The cause is a config gap, not a phpmd bug: PDepend resolves an unqualified call inside a namespaced file to the current-namespace-qualified image, so `var_dump($x)` written inside `namespace OCA\MyApp\Service;` reaches the rule as `OCA\MyApp\Service\var_dump` and never matches the `unwanted-functions` list. All of our production PHP is namespaced, so with the default the rule is dead. The rule's own `ignore-namespaces` property is the switch. This mirrors the configuration already merged in openregister (ConductionNL/openregister#2286). Proof, phpmd 2.15.0 / PHP 8.3.32, against this repo's own phpmd.xml: namespaced probe class calling var_dump() -> exit 2, DevelopmentCodeFragment same class with the call removed -> exit 0, no finding Before the change the identical namespaced probe exited 0. Blast radius on this repo: measured 0 new findings over the scanned path on the base branch, with a per-run positive control (dropping the namespaced probe into the same extracted tree does produce exit 2, so the zero is a true zero). Nothing is baselined or suppressed here. Note: this repo does not run the shared quality workflow, so phpmd is not executed in CI here. This change fixes `composer check:strict` when run locally and stops the broken configuration propagating; it does not by itself add a CI gate. --- phpmd.xml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/phpmd.xml b/phpmd.xml index bc2e6a4..35a8024 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -57,7 +57,32 @@ - + + + + + +