SonarQube CRITICAL CODE_SMELL: Define a constant instead of duplicating this literal "/api/v1/users" 3 times. #728

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

SonarQube issue detected.

SonarQube key: bf9441c7-4c68-420f-a5a4-8d55c9acda7d
Severity: CRITICAL
Type: CODE_SMELL
Location: myvideogamelist:tests/Feature/Auth/RegistrationTest.php:86
Message: Define a constant instead of duplicating this literal "/api/v1/users" 3 times.

https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=bf9441c7-4c68-420f-a5a4-8d55c9acda7d&open=bf9441c7-4c68-420f-a5a4-8d55c9acda7d

SonarQube issue detected. **SonarQube key:** `bf9441c7-4c68-420f-a5a4-8d55c9acda7d` **Severity:** `CRITICAL` **Type:** `CODE_SMELL` **Location:** `myvideogamelist:tests/Feature/Auth/RegistrationTest.php:86` **Message:** Define a constant instead of duplicating this literal "/api/v1/users" 3 times. https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=bf9441c7-4c68-420f-a5a4-8d55c9acda7d&open=bf9441c7-4c68-420f-a5a4-8d55c9acda7d <!-- sonarqube:issue:bf9441c7-4c68-420f-a5a4-8d55c9acda7d -->
Codex self-assigned this 2026-06-11 23:04:08 -05:00
Member

Resolved in commit b65ece2.

What changed

  • Added local test constants for repeated rendered value=" snippets in the admin game regional ordering and IGDB create tests.
  • Added a local Fider users endpoint constant in the registration test.
  • Added a local search alias constant in the game search test.
  • Added a local rendered href=" prefix constant in the blog mention tests.
  • Replaced the matching duplicated literals in test files only.

Verification

vendor/bin/pint --dirty --format agent
php artisan test --compact tests/Feature/AdminGameRegionalOrderingTest.php tests/Feature/AdminGameIgdbCreateTest.php tests/Feature/Auth/RegistrationTest.php tests/Feature/GameSearchTest.php tests/Feature/BlogTest.php
git diff --check

All checks passed. The focused test run completed with 70 passing tests and 544 assertions.

Resolved in commit `b65ece2`. ## What changed - Added local test constants for repeated rendered `value="` snippets in the admin game regional ordering and IGDB create tests. - Added a local Fider users endpoint constant in the registration test. - Added a local search alias constant in the game search test. - Added a local rendered `href="` prefix constant in the blog mention tests. - Replaced the matching duplicated literals in test files only. ## Verification ```bash vendor/bin/pint --dirty --format agent php artisan test --compact tests/Feature/AdminGameRegionalOrderingTest.php tests/Feature/AdminGameIgdbCreateTest.php tests/Feature/Auth/RegistrationTest.php tests/Feature/GameSearchTest.php tests/Feature/BlogTest.php git diff --check ``` All checks passed. The focused test run completed with 70 passing tests and 544 assertions.
Codex 2026-06-11 23:11:55 -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#728
No description provided.