SonarQube CRITICAL CODE_SMELL: Define a constant instead of duplicating this literal "value="" 4 times. #713

Closed
opened 2026-06-11 11:33:05 -05:00 by forgejo-actions · 1 comment

SonarQube issue detected.

SonarQube key: 271dc673-52be-40b0-93fe-e3c47cb1bce0
Severity: CRITICAL
Type: CODE_SMELL
Location: myvideogamelist:tests/Feature/GameListPageTest.php:854
Message: Define a constant instead of duplicating this literal "value="" 4 times.

https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=271dc673-52be-40b0-93fe-e3c47cb1bce0&open=271dc673-52be-40b0-93fe-e3c47cb1bce0

SonarQube issue detected. **SonarQube key:** `271dc673-52be-40b0-93fe-e3c47cb1bce0` **Severity:** `CRITICAL` **Type:** `CODE_SMELL` **Location:** `myvideogamelist:tests/Feature/GameListPageTest.php:854` **Message:** Define a constant instead of duplicating this literal "value="" 4 times. https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=271dc673-52be-40b0-93fe-e3c47cb1bce0&open=271dc673-52be-40b0-93fe-e3c47cb1bce0 <!-- sonarqube:issue:271dc673-52be-40b0-93fe-e3c47cb1bce0 -->
Codex self-assigned this 2026-06-11 22:58:44 -05:00
Member

Resolved in commit 2836039.

What changed

  • Added descriptive constants in tests/Feature/GameListPageTest.php for the repeated edit-layout platform names.
  • Added a shared VALUE_ATTRIBUTE_PREFIX test constant for repeated rendered value=" assertion snippets.
  • Added a MUTABLE_GAME_NAME test constant for the repeated mutable-game fixture/assertion text.
  • Replaced the matching duplicated literals in the same test file only.

Verification

vendor/bin/pint --dirty --format agent
php artisan test --compact tests/Feature/GameListPageTest.php
git diff --check

All checks passed. The focused test run completed with 43 passing tests and 503 assertions.

Resolved in commit `2836039`. ## What changed - Added descriptive constants in `tests/Feature/GameListPageTest.php` for the repeated edit-layout platform names. - Added a shared `VALUE_ATTRIBUTE_PREFIX` test constant for repeated rendered `value="` assertion snippets. - Added a `MUTABLE_GAME_NAME` test constant for the repeated mutable-game fixture/assertion text. - Replaced the matching duplicated literals in the same test file only. ## Verification ```bash vendor/bin/pint --dirty --format agent php artisan test --compact tests/Feature/GameListPageTest.php git diff --check ``` All checks passed. The focused test run completed with 43 passing tests and 503 assertions.
Codex 2026-06-11 23:02:50 -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#713
No description provided.