SonarQube MAJOR CODE_SMELL: This method has 4 returns, which is more than the 3 allowed. #753

Closed
opened 2026-06-13 00:05:59 -05:00 by forgejo-actions · 1 comment

SonarQube issue detected.

SonarQube key: 7fa89a9b-2857-4557-a4c3-309c1c497099
Severity: MAJOR
Type: CODE_SMELL
Location: myvideogamelist:app/Http/Controllers/Admin/UserController.php:112
Message: This method has 4 returns, which is more than the 3 allowed.

https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=7fa89a9b-2857-4557-a4c3-309c1c497099&open=7fa89a9b-2857-4557-a4c3-309c1c497099

SonarQube issue detected. **SonarQube key:** `7fa89a9b-2857-4557-a4c3-309c1c497099` **Severity:** `MAJOR` **Type:** `CODE_SMELL` **Location:** `myvideogamelist:app/Http/Controllers/Admin/UserController.php:112` **Message:** This method has 4 returns, which is more than the 3 allowed. https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=7fa89a9b-2857-4557-a4c3-309c1c497099&open=7fa89a9b-2857-4557-a4c3-309c1c497099 <!-- sonarqube:issue:7fa89a9b-2857-4557-a4c3-309c1c497099 -->
Codex self-assigned this 2026-06-15 10:29:21 -05:00
Member

Resolved in 2af0f53.

Changes:

  • Moved admin user media upload/reset/url helpers into App\Http\Controllers\Admin\Concerns\ManagesUserMedia, bringing Admin\UserController below the SonarQube method-count threshold.
  • Refactored Admin\UserController::update() to use a single final response return.
  • Used the validation $attribute parameter in the role-assignment failure message.

Verification:

  • vendor/bin/pint --format agent app/Http/Controllers/Admin/UserController.php app/Http/Controllers/Admin/Concerns/ManagesUserMedia.php
  • php artisan test --compact tests/Feature/AdminUserProfileInfoTest.php tests/Feature/FiderUserStatusSyncTest.php (23 passed, 100 assertions)
  • composer run stan (no errors)
Resolved in `2af0f53`. Changes: - Moved admin user media upload/reset/url helpers into `App\Http\Controllers\Admin\Concerns\ManagesUserMedia`, bringing `Admin\UserController` below the SonarQube method-count threshold. - Refactored `Admin\UserController::update()` to use a single final response return. - Used the validation `$attribute` parameter in the role-assignment failure message. Verification: - `vendor/bin/pint --format agent app/Http/Controllers/Admin/UserController.php app/Http/Controllers/Admin/Concerns/ManagesUserMedia.php` - `php artisan test --compact tests/Feature/AdminUserProfileInfoTest.php tests/Feature/FiderUserStatusSyncTest.php` (23 passed, 100 assertions) - `composer run stan` (no errors)
Codex 2026-06-15 10:39:35 -05:00
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#753
No description provided.