SonarQube CRITICAL CODE_SMELL: Define a constant instead of duplicating this literal "Year Only Game" 3 times. #762

Closed
opened 2026-06-19 12:11:31 -05:00 by forgejo-actions · 1 comment

SonarQube issue detected.

SonarQube key: 1bb1a165-fe9d-4608-8480-54f8a45b227e
Severity: CRITICAL
Type: CODE_SMELL
Location: myvideogamelist:tests/Feature/MostPopularUpcomingGamesCardTest.php:183
Message: Define a constant instead of duplicating this literal "Year Only Game" 3 times.

https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=1bb1a165-fe9d-4608-8480-54f8a45b227e&open=1bb1a165-fe9d-4608-8480-54f8a45b227e

SonarQube issue detected. **SonarQube key:** `1bb1a165-fe9d-4608-8480-54f8a45b227e` **Severity:** `CRITICAL` **Type:** `CODE_SMELL` **Location:** `myvideogamelist:tests/Feature/MostPopularUpcomingGamesCardTest.php:183` **Message:** Define a constant instead of duplicating this literal "Year Only Game" 3 times. https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=1bb1a165-fe9d-4608-8480-54f8a45b227e&open=1bb1a165-fe9d-4608-8480-54f8a45b227e <!-- sonarqube:issue:1bb1a165-fe9d-4608-8480-54f8a45b227e -->
Codex self-assigned this 2026-06-19 12:12:22 -05:00
Codex 2026-06-19 12:12:22 -05:00
Member

Resolved in 3589b55.

Changes:

  • Refactored UpcomingPopularGames::eligibleReleaseLabel() to use one final return value.
  • Added UPCOMING_POPULAR_YEAR_ONLY_GAME for the repeated year-only upcoming game test fixture name.

Verification:

  • vendor/bin/pint --format agent app/Support/UpcomingPopularGames.php tests/Feature/MostPopularUpcomingGamesCardTest.php
  • php artisan test --compact tests/Feature/MostPopularUpcomingGamesCardTest.php (6 passed, 52 assertions)
  • composer run stan (no errors)
Resolved in `3589b55`. Changes: - Refactored `UpcomingPopularGames::eligibleReleaseLabel()` to use one final return value. - Added `UPCOMING_POPULAR_YEAR_ONLY_GAME` for the repeated year-only upcoming game test fixture name. Verification: - `vendor/bin/pint --format agent app/Support/UpcomingPopularGames.php tests/Feature/MostPopularUpcomingGamesCardTest.php` - `php artisan test --compact tests/Feature/MostPopularUpcomingGamesCardTest.php` (6 passed, 52 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#762
No description provided.