chore: sync canonical root configs + mechanical phpmd cleanup#228
Merged
Conversation
Phase 2 fleet rollout for docudesk. Drops per-app phpcs/phpmd/psalm/phpstan extensions in favour of the canonical from nextcloud-app-template, then cleans the mechanical phpmd violations unmasked by the sync. Pattern from shillinq#300 and decidesk#243. Config changes: - phpcs.xml: sync canonical (adds SpecTagSniff/NoLegacyServerAccessorsSniff wiring, ignore_warnings_on_exit, vendor-bin + lib/Resources/template excludes, lineLimit 150). Preserves DocuDesk description string. - phpmd.xml: byte-canonical (preserves DocuDesk ruleset name). - psalm.xml: sync canonical (adds CalendarEventService + 16 other OCP/OR referencedClass entries fleetwide-promoted in nextcloud-app-template#49, plus docudesk-specific entries: OpenRegister EntityRelationMapper + RiskLevelService, thiagoalessio TesseractOCR). - phpstan.neon: sync canonical (adds includes phpstan-baseline.neon, Doctrine\DBAL + broader OC\ + OCA\DAV\ + OCP stub-gap ignoreErrors, vendor-bin + lib/Resources/template excludePaths). - phpstan-baseline.neon: NEW, captures the 15 tracked phpstan errors that remain after canonical sync - all tracked in #227 for source-level cleanup. - phpcs-custom-sniffs/.../SpecTagSniff.php + phpcs-custom-sniffs/.../NoLegacyServerAccessorsSniff.php: NEW, copied from canonical so they can be referenced by the synced phpcs.xml. - phpstan-bootstrap.php: NEW, copied from canonical. Source changes - 49 mechanical phpmd fixes + 452 phpcbf auto-fixes: - 38 MissingImport: add `use Exception;` / `use DateTimeImmutable;` / `use DateTimeInterface;` / `use RuntimeException;` / `use Imagick;` / `use OCP\Files\File;` at the top of each affected file and replace `\Foo` references with the short name. - 5 ElseExpression: refactor `if/else` into pre-assign default + conditional override (preserves behaviour, no `else` keyword left) in OcrService, EntityConsolidationService, BatchAnonymizationController, SigningService (3 sites). - 1 UnusedLocalVariable: drop the unused 3rd-arg out-parameter on preg_match_all() in SigningVerificationService. - 1 UnusedLocalVariable: drop the assigned-but-unused $userId in FileListingService while keeping the side-effecting call (auth check). - 3 UnusedFormalParameter / UnusedPrivateMethod: annotate with `@SuppressWarnings(PHPMD.UnusedFormalParameter)` / `@SuppressWarnings(PHPMD.UnusedPrivateMethod)` where the parameter is part of a stable controller signature or the method is referenced via string callable. - 452 phpcbf auto-fixes: blank-line-between-function-defs style cleanup across the lib/ tree. After this PR: - phpcs: 0 violations (295 advisory @SPEC warnings, gated by ignore_warnings_on_exit). - psalm: 0 errors. - phpstan: 0 unmatched (15 baselined per #227). - phpmd: 9 architectural violations remain (ShortVariable, TooManyPublicMethods, Cyclomatic/NPath complexity, CountInLoopExpression, CouplingBetweenObjects, Superglobals) - tracked in #227 for follow-up PRs. phpmd does not support a native baseline file, so its CI gate stays red until #227 closes. This is the agreed-upon tracked-debt pattern for the fleet: per-app deviations are forbidden, but a tracked GitHub issue with a removal plan is acceptable. Refs: #227
Contributor
Quality Report — ConductionNL/docudesk @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ❌ | ✅ 108/108 | |||
| npm | ✅ | ✅ 575/575 | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-05-21 20:45 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.
Summary
Phase 2 fleet rollout for docudesk. Adopts the canonical root configs (phpcs/phpmd/psalm/phpstan) from
nextcloud-app-template, then cleans the mechanical phpmd violations unmasked by the sync.Pattern from shillinq#300 (merged) and decidesk#243 (merged).
Config changes
phpcs.xml: sync canonical (adds SpecTagSniff/NoLegacyServerAccessorsSniff wiring,ignore_warnings_on_exit, vendor-bin + lib/Resources/template excludes, lineLimit 150). Preserves DocuDesk description string.phpmd.xml: byte-canonical (preserves DocuDesk ruleset name).psalm.xml: sync canonical, plus 3 docudesk-specific referencedClass entries (OpenRegisterEntityRelationMapper+RiskLevelService,thiagoalessio\TesseractOCR\TesseractOCR).phpstan.neon: sync canonical (addsincludes: phpstan-baseline.neon, broader Doctrine/OC/OCA/OCP stub-gap ignores, vendor-bin + lib/Resources/template excludes).phpstan-baseline.neon: NEW. Captures the 15 tracked phpstan errors that remain after canonical sync (all "property never read, only written" on DI-injected services). Tracked in Lint debt cleanup post-canonical-sync (Phase 2 fleet rollout) #227 for source-level cleanup.phpcs-custom-sniffs/.../SpecTagSniff.php+NoLegacyServerAccessorsSniff.php: NEW, copied from canonical.phpstan-bootstrap.php: NEW, copied from canonical.Source changes
49 mechanical phpmd fixes + 452 phpcbf auto-fixes across the lib/ tree:
MissingImport: adduse Exception;/use DateTimeImmutable;/use DateTimeInterface;/use RuntimeException;/use Imagick;/use OCP\Files\File;at the top of each file, replace\Fooreferences with the short name.ElseExpression: refactor into pre-assign default + conditional override (Ocr, EntityConsolidation, BatchAnonymizationController, SigningService x3).UnusedLocalVariable(preg_match_all 3rd-arg in SigningVerificationService): drop the out-parameter.UnusedLocalVariable($userId in FileListingService): drop assignment, keep side-effecting auth-check call.UnusedFormalParameter/UnusedPrivateMethod:@SuppressWarningson stable controller signatures + string-callable-referenced private methods.After this PR
@specwarnings, gated byignore_warnings_on_exit).phpmd has no native baseline file, so its CI gate stays red until #227 closes. This is the agreed-upon tracked-debt pattern for the fleet: per-app deviations are forbidden, but a tracked GitHub issue with a removal plan is acceptable.
Test plan
Refs #227