Skip to content

Lint debt cleanup post-canonical-sync (Phase 2 pilot) #242

@rubenvdlinde

Description

@rubenvdlinde

Context

Decidesk is the pilot for the fleetwide root-config consolidation (template + 17 PHP apps). After syncing the canonical phpcs.xml/phpmd.xml/psalm.xml/phpstan.neon from nextcloud-app-template, lint runs surface a tracked lint debt that needs cleanup. The directive for the fleet is no per-app validation rules — exceptions are fleetwide or they don't exist. This issue captures the per-app code-level debt that the canonical sync unmasked.

phpstan errors (6)

  • lib/Controller/ApiController.php:85Constant SCOPE_MAP is unused. Awaiting REQ-OAUTH-002 implementation. Either delete the constant or wire it into OAuth scope enforcement.
  • lib/Controller/SettingsController.php:141Parameter #1 $settings of AuthorizedAdminSetting expects class-string<IDelegatedSettings>. Pass an IDelegatedSettings::class literal instead of a string.
  • lib/Service/ActionItemAnalyticsService.php:224Comparison ">" between int<1, max> and 0 is always true. PHPDoc says int<1, max> but the comparison checks > 0. Either fix the PHPDoc or remove the dead branch.
  • lib/Service/ActionItemAnalyticsService.php:226Else branch is unreachable (same root cause as above).
  • lib/Service/EmailLinkService.php:189Offset 0 on array... in isset() always exists. Refactor the defensive isset away (offset is guaranteed by preg_match_all contract).
  • lib/Service/MotionCoauthorService.php:265Strict comparison using === between true and false will always evaluate to false. Refactor the dead branch.

phpmd violations (87)

Mechanical (will be fixed in the pilot PR)

  • 38 × MissingImport — add use Exception; etc. where FQCNs are used
  • 15 × ElseExpression — refactor if/else to if/early return
  • 3 × UnusedLocalVariable — remove unused $dateFromDt, $dateToDt etc.
  • 3 × UnusedFormalParameter — remove or use unused parameters
  • 1 × BooleanArgumentFlag — rename / restructure boolean parameter API

Architectural (separate follow-up PRs)

  • AppInfo/Application.php register() 468 lines — split into registerEventListeners(), registerSearchProviders(), registerNotifications(), etc. Big change; needs care to preserve registration order.
  • Controller/MinutesController.php coupling 16/13 — extract service aggregator(s) to reduce constructor surface.
  • Controller/OriController.php serializeOri() cyclomatic 12, NPath 768 — extract nested conditionals into private helpers.
  • Service/ALVMinutesService.php generateALVDraft() — cyclomatic 15, NPath 3457, length 155. Split into per-section generators.
  • Service/ALVMinutesService.php distribute() — cyclomatic 18, NPath 3061, length 110. Extract per-channel distribution methods.
  • Service/CommentService.php — 1× cyclomatic, 1× NPath. Audit and refactor.
  • Service/ActionItemAnalyticsService.php getSummary() — cyclomatic 11, plus the two phpstan "always true" issues above.
  • Service/WorkspaceService.php — 1× cyclomatic, 1× NPath, 1× ExcessiveMethodLength.
  • Service/MinutesService.php — 1× cyclomatic, 1× NPath, 1× ExcessiveMethodLength.
  • Service/TaskService.php — 1× cyclomatic.
  • Service/EngagementService.php — 1× cyclomatic.
  • Service/DelegationService.php — 1× cyclomatic.
  • Service/VotingService.php — 1× cyclomatic.
  • Service/MeetingService.php — 1× cyclomatic.
  • Service/LiveDecisionService.php — 1× ExcessiveClassComplexity. Class split.
  • Service/DecisionNotificationService.php — 1× cyclomatic.
  • Service/MotionService.php — 1× cyclomatic.

Plan

The pilot PR will:

  1. Sync canonical root configs (phpcs.xml, phpmd.xml, psalm.xml, phpstan.neon, phpstan-bootstrap.php, phpstan-baseline.neon, custom sniff files).
  2. Apply mechanical phpmd fixes (the ~60 in the first checklist).
  3. Update description strings to "Decidesk" cosmetically.

Architectural refactoring will land in follow-up PRs that close the second checklist. Each architectural PR should ship with tests where the touched logic has any.

Drives the Phase 2 fleet rollout of the root-config consolidation. Once decidesk is green on the canonical (mechanical + architectural), the same recipe applies to the remaining 13 apps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions