SonarQube CRITICAL CODE_SMELL: Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allo #754

Closed
opened 2026-06-15 10:41:37 -05:00 by forgejo-actions · 1 comment

SonarQube issue detected.

SonarQube key: 378d9b77-7107-4524-8fd5-527c1f78a818
Severity: CRITICAL
Type: CODE_SMELL
Location: myvideogamelist:app/Http/Controllers/Admin/UserController.php:112
Message: Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.

https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=378d9b77-7107-4524-8fd5-527c1f78a818&open=378d9b77-7107-4524-8fd5-527c1f78a818

SonarQube issue detected. **SonarQube key:** `378d9b77-7107-4524-8fd5-527c1f78a818` **Severity:** `CRITICAL` **Type:** `CODE_SMELL` **Location:** `myvideogamelist:app/Http/Controllers/Admin/UserController.php:112` **Message:** Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed. https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=378d9b77-7107-4524-8fd5-527c1f78a818&open=378d9b77-7107-4524-8fd5-527c1f78a818 <!-- sonarqube:issue:378d9b77-7107-4524-8fd5-527c1f78a818 -->
Codex self-assigned this 2026-06-15 11:28:06 -05:00
Codex 2026-06-15 11:28:06 -05:00
Member

Resolved in 59b3089.

Changes:

  • Reduced Admin\UserController::update() cognitive complexity by making it an action dispatcher.
  • Moved the normal profile update workflow into updateUserProfile().
  • Moved update validation rules into validateUserUpdate().

Verification:

  • vendor/bin/pint --format agent app/Http/Controllers/Admin/UserController.php
  • php artisan test --compact tests/Feature/AdminUserProfileInfoTest.php tests/Feature/FiderUserStatusSyncTest.php (23 passed, 100 assertions)
  • composer run stan (no errors)
Resolved in `59b3089`. Changes: - Reduced `Admin\UserController::update()` cognitive complexity by making it an action dispatcher. - Moved the normal profile update workflow into `updateUserProfile()`. - Moved update validation rules into `validateUserUpdate()`. Verification: - `vendor/bin/pint --format agent app/Http/Controllers/Admin/UserController.php` - `php artisan test --compact tests/Feature/AdminUserProfileInfoTest.php tests/Feature/FiderUserStatusSyncTest.php` (23 passed, 100 assertions) - `composer run stan` (no errors)
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#754
No description provided.