Skip to content

refactor(demo): split install() so it clears the complexity thresholds again - #1816

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/demo-install-complexity
Sep 4, 2026
Merged

refactor(demo): split install() so it clears the complexity thresholds again#1816
rubenvdlinde merged 1 commit into
developmentfrom
fix/demo-install-complexity

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Why

PHPMD, on development:

DemoDataService.php:161  CyclomaticComplexity   install() has a Cyclomatic
    Complexity of 10. The configured threshold is 10.
DemoDataService.php:161  ExcessiveMethodLength  install() has 101 lines of
    code. Current threshold is set to 100.

Both are one over, and both are mine. #1806 added the objectsOnly() narrowing and #1808 added the unchanged counter and its guard. Each was fine alone; together they are one line and one branch past the line.

What changes

Neither reading the importer's reply nor logging it belongs in install(), which should read as: load, ask, land, judge, report. They move out as readLanding() and reportLanding(), and an early return in the partial-import warning removes the last branch.

No behaviour changes. 34 tests across DemoDataServiceTest and SetupControllerStatusTest pass unchanged.

How it was found, which is the part worth keeping

composer phpmd runs the whole of lib/ in one process and gets OOM-killed on this machine, so the run that "passed" had died rather than finished. A per-directory sweep is what surfaced it:

for d in lib/*/; do php -d memory_limit=2G ./vendor/bin/phpmd "$d" text phpmd.xml || echo "FAIL: $d"; done

Verification

PHPUnit, PHPCS, PHPStan, Psalm, a per-directory PHPMD sweep and all 77 applicable hydra gates exit 0.

🤖 Generated with Claude Code

…s again

PHPMD, on development:

    DemoDataService.php:161  CyclomaticComplexity   install() has a
        Cyclomatic Complexity of 10. The configured threshold is 10.
    DemoDataService.php:161  ExcessiveMethodLength  install() has 101 lines
        of code. Current threshold is set to 100.

Both are one over, and both are mine: #1806 added the objectsOnly() narrowing
and #1808 added the `unchanged` counter and its guard, each fine alone and
together one line and one branch past the line.

Neither the reading of the importer's reply nor the logging of it belongs in
install(), which should read as: load, ask, land, judge, report. So they move
out as `readLanding()` and `reportLanding()`, and the early-return in the
partial-import warning removes the last branch.

No behaviour changes: 34 tests across DemoDataServiceTest and
SetupControllerStatusTest pass unchanged, and PHPUnit, PHPCS, PHPStan, Psalm
and a per-directory PHPMD sweep all exit 0.

Worth recording that a per-directory PHPMD sweep is the only way this was
visible: `composer phpmd` runs the whole of lib/ in one process and gets
OOM-killed on this box, so the run that "passed" had died rather than
finished.
@rubenvdlinde
rubenvdlinde merged commit 1c53e58 into development Sep 4, 2026
34 checks passed
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/dossiq @ 97a3e0f

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-manifest
check-vue3-compile
test-l10n
format
check-schema-l10n
check-l10n-js
composer ✅ 106/106
npm ✅ 541/541
app:check-code ⏭️
info.xml
REUSE
PHPUnit
Newman ⏭️
Playwright ⏭️ deferred — runs on the promotion into beta/main, not on a pull request into development
Hydra gates

Quality workflow — 2026-09-04 19:29 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant