diff --git a/openspec/changes/method-decomposition/.openspec.yaml b/openspec/changes/method-decomposition/.openspec.yaml new file mode 100644 index 0000000..eeb4152 --- /dev/null +++ b/openspec/changes/method-decomposition/.openspec.yaml @@ -0,0 +1,2 @@ +schema: conduction +created: 2026-03-20 diff --git a/openspec/changes/method-decomposition/design.md b/openspec/changes/method-decomposition/design.md new file mode 100644 index 0000000..fee2b62 --- /dev/null +++ b/openspec/changes/method-decomposition/design.md @@ -0,0 +1,7 @@ +# Design: method-decomposition + +## Architecture Overview + +See specs/method-decomposition/spec.md for detailed per-class decomposition plans. +The approach follows extract-method and extract-class refactoring patterns, with each +complex controller/service being broken into focused handler classes. diff --git a/openspec/changes/method-decomposition/proposal.md b/openspec/changes/method-decomposition/proposal.md new file mode 100644 index 0000000..ae3253a --- /dev/null +++ b/openspec/changes/method-decomposition/proposal.md @@ -0,0 +1,13 @@ +# Proposal: method-decomposition + +## Summary +Eliminate 145 PHPMD complexity suppressions by decomposing complex methods and classes into smaller, focused units. + +## Motivation +The SoftwareCatalog codebase has 326 @SuppressWarnings(PHPMD.*) annotations, of which 145 relate to structural complexity (CyclomaticComplexity, NPathComplexity, ExcessiveMethodLength, ExcessiveClassLength, ExcessiveClassComplexity, CouplingBetweenObjects, TooManyMethods). These indicate methods and classes that are too large and complex, making the code harder to maintain and test. + +## Scope +- Decompose SettingsController (23 suppressions) +- Decompose all controllers, services, and commands exceeding PHPMD thresholds +- Extract handler classes for sync, module registration, and configuration logic +- Maintain backward compatibility in all public API endpoints diff --git a/openspec/specs/method-decomposition/spec.md b/openspec/changes/method-decomposition/specs/method-decomposition/spec.md similarity index 100% rename from openspec/specs/method-decomposition/spec.md rename to openspec/changes/method-decomposition/specs/method-decomposition/spec.md diff --git a/openspec/changes/method-decomposition/tasks.md b/openspec/changes/method-decomposition/tasks.md new file mode 100644 index 0000000..948fd7f --- /dev/null +++ b/openspec/changes/method-decomposition/tasks.md @@ -0,0 +1,11 @@ +# Tasks: method-decomposition + +## Task 1: SettingsController decomposition +- **Spec ref**: specs/method-decomposition/spec.md#REQ-DECOMP-001 +- **Status**: todo +- **Acceptance criteria**: SettingsController reduced to thin action methods delegating to handler classes + +## Task 2: Remaining controller decompositions +- **Spec ref**: specs/method-decomposition/spec.md +- **Status**: todo +- **Acceptance criteria**: All controllers under PHPMD thresholds without suppressions