feat(06-sonarqube-quality): reduce cognitive complexity in loadDeliveryServices (S3776 fix, 06-04)
Extract private helpers to flatten 5-level nesting in AllegroIntegrationController and ShopproIntegrationsController: loadAllegroDeliveryServices(), fetchAllegroDeliveryResponse(), loadApaczkaServices(). sync() and saveStatusMappings() were already compliant from plan 06-06. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
49
.paul/phases/06-sonarqube-quality/06-04-SUMMARY.md
Normal file
49
.paul/phases/06-sonarqube-quality/06-04-SUMMARY.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# SUMMARY: 06-04 — Cognitive Complexity (S3776)
|
||||
|
||||
## Status: COMPLETE
|
||||
|
||||
## Execution Log
|
||||
|
||||
### Task 1: AllegroIntegrationController
|
||||
- **oauthCallback()** — już uproszczone z poprzedniego planu (AC-1 ✓ bez zmian)
|
||||
- **loadDeliveryServices()** — zrefaktoryzowane: wydzielono 3 private helpers:
|
||||
- `loadAllegroDeliveryServices(array $settings): array`
|
||||
- `fetchAllegroDeliveryResponse(string $env, string $accessToken, array $oauth): array`
|
||||
- `loadApaczkaServices(): array`
|
||||
- Główna metoda: max 2 poziomy zagnieżdżenia (z 5) ✓
|
||||
- `php -l` — PASS ✓
|
||||
|
||||
### Task 2: ShopproIntegrationsController
|
||||
- **saveStatusMappings()** — już max 2 poziomy zagnieżdżenia (AC-3 ✓ bez zmian)
|
||||
- **loadDeliveryServices()** — zrefaktoryzowane: wydzielono 3 private helpers:
|
||||
- `loadAllegroDeliveryServices(): array`
|
||||
- `fetchAllegroDeliveryResponse(string $env, string $accessToken, array $oauth): array`
|
||||
- `loadApaczkaServices(): array`
|
||||
- Główna metoda: max 2 poziomy zagnieżdżenia (z 5) ✓
|
||||
- `php -l` — PASS ✓
|
||||
|
||||
### Task 3: ShopproOrdersSyncService
|
||||
- **sync()** — już w pełni zrefaktoryzowane z planu 06-06:
|
||||
- `sync()` → `syncOneIntegration()` → `processPageCandidates()` → `importOneOrder()`
|
||||
- `sync()` max 2 poziomy, `syncOneIntegration()` max 3 poziomy ✓
|
||||
- AC-4 i AC-5 spełnione bez dodatkowych zmian ✓
|
||||
- `php -l` — PASS ✓
|
||||
|
||||
## Verification Checklist
|
||||
- [x] php -l AllegroIntegrationController.php — 0 błędów
|
||||
- [x] php -l ShopproIntegrationsController.php — 0 błędów
|
||||
- [x] php -l ShopproOrdersSyncService.php — 0 błędów
|
||||
- [x] loadDeliveryServices() (Allegro) — max 2 poziomy zagnieżdżenia
|
||||
- [x] loadDeliveryServices() (Shoppro) — max 2 poziomy zagnieżdżenia
|
||||
- [x] sync() (ShopproOrdersSyncService) — max 3 poziomy zagnieżdżenia
|
||||
- [x] sonar-scanner uruchomiony — ANALYSIS SUCCESSFUL
|
||||
|
||||
## Deviations
|
||||
- AC-1 (oauthCallback) i AC-4 (sync) były już spełnione z poprzednich planów
|
||||
- AC-3 (saveStatusMappings) był już spełniony — pętla for z if na 2 poziomach
|
||||
- Refaktoryzacja skupiona na loadDeliveryServices() w obu kontrolerach (faktyczny problem)
|
||||
|
||||
## Files Modified
|
||||
- `src/Modules/Settings/AllegroIntegrationController.php` — loadDeliveryServices() + 3 nowe helpers
|
||||
- `src/Modules/Settings/ShopproIntegrationsController.php` — loadDeliveryServices() + 3 nowe helpers
|
||||
- `src/Modules/Settings/ShopproOrdersSyncService.php` — bez zmian (już OK)
|
||||
Reference in New Issue
Block a user