SonarQube CRITICAL CODE_SMELL: Define a constant instead of duplicating this literal "Save Changes" 4 times. #757

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

SonarQube issue detected.

SonarQube key: 4161fc60-5c8c-49e3-8fd3-36f39218e6ee
Severity: CRITICAL
Type: CODE_SMELL
Location: myvideogamelist:tests/Feature/AdminGameCleanupTest.php:273
Message: Define a constant instead of duplicating this literal "Save Changes" 4 times.

https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=4161fc60-5c8c-49e3-8fd3-36f39218e6ee&open=4161fc60-5c8c-49e3-8fd3-36f39218e6ee

SonarQube issue detected. **SonarQube key:** `4161fc60-5c8c-49e3-8fd3-36f39218e6ee` **Severity:** `CRITICAL` **Type:** `CODE_SMELL` **Location:** `myvideogamelist:tests/Feature/AdminGameCleanupTest.php:273` **Message:** Define a constant instead of duplicating this literal "Save Changes" 4 times. https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=4161fc60-5c8c-49e3-8fd3-36f39218e6ee&open=4161fc60-5c8c-49e3-8fd3-36f39218e6ee <!-- sonarqube:issue:4161fc60-5c8c-49e3-8fd3-36f39218e6ee -->
Codex self-assigned this 2026-06-15 22:12:54 -05:00
Member

Resolved in 63b0d75.

Changes:

  • Added ADMIN_GAME_CLEANUP_SAVE_CHANGES_LABEL for the duplicated Save Changes test literal.
  • Reworked the MySQL connection config helper to accept one shaped connection array instead of 11 scalar parameters.
  • Reworked favorite/wishlist store and destroy support helpers to accept one shaped action array instead of long parameter lists.
  • Updated favorite and wishlist controller call sites to pass the new action arrays.

Verification:

  • vendor/bin/pint --format agent app/Http/Controllers/FavoriteController.php app/Http/Controllers/WishlistController.php app/Support/FavoriteWishlistControllerSupport.php config/database.php tests/Feature/AdminGameCleanupTest.php
  • php artisan test --compact tests/Feature/FavoriteTest.php tests/Feature/WishlistTest.php tests/Feature/AdminGameCleanupTest.php (60 passed, 449 assertions)
  • composer run stan (no errors)
Resolved in `63b0d75`. Changes: - Added `ADMIN_GAME_CLEANUP_SAVE_CHANGES_LABEL` for the duplicated `Save Changes` test literal. - Reworked the MySQL connection config helper to accept one shaped connection array instead of 11 scalar parameters. - Reworked favorite/wishlist store and destroy support helpers to accept one shaped action array instead of long parameter lists. - Updated favorite and wishlist controller call sites to pass the new action arrays. Verification: - `vendor/bin/pint --format agent app/Http/Controllers/FavoriteController.php app/Http/Controllers/WishlistController.php app/Support/FavoriteWishlistControllerSupport.php config/database.php tests/Feature/AdminGameCleanupTest.php` - `php artisan test --compact tests/Feature/FavoriteTest.php tests/Feature/WishlistTest.php tests/Feature/AdminGameCleanupTest.php` (60 passed, 449 assertions) - `composer run stan` (no errors)
Codex 2026-06-15 22:17:44 -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#757
No description provided.