SonarQube CRITICAL CODE_SMELL: Define a constant instead of duplicating this literal "Start typing in the searc #700

Closed
opened 2026-06-10 19:33:01 -05:00 by forgejo-actions · 1 comment

SonarQube issue detected.

SonarQube key: 69d5ad23-d7f9-4bd1-a915-254c6e7cc22c
Severity: CRITICAL
Type: CODE_SMELL
Location: myvideogamelist:tests/Feature/GameSearchTest.php:44
Message: Define a constant instead of duplicating this literal "Start typing in the search bar above to find games." 3 times.

https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=69d5ad23-d7f9-4bd1-a915-254c6e7cc22c&open=69d5ad23-d7f9-4bd1-a915-254c6e7cc22c

SonarQube issue detected. **SonarQube key:** `69d5ad23-d7f9-4bd1-a915-254c6e7cc22c` **Severity:** `CRITICAL` **Type:** `CODE_SMELL` **Location:** `myvideogamelist:tests/Feature/GameSearchTest.php:44` **Message:** Define a constant instead of duplicating this literal "Start typing in the search bar above to find games." 3 times. https://sonarqube.linuxbox.ninja/project/issues?id=myvideogamelist&issues=69d5ad23-d7f9-4bd1-a915-254c6e7cc22c&open=69d5ad23-d7f9-4bd1-a915-254c6e7cc22c <!-- sonarqube:issue:69d5ad23-d7f9-4bd1-a915-254c6e7cc22c -->
Codex self-assigned this 2026-06-10 19:51:53 -05:00
Member

Resolved by extracting duplicated GameSearchTest literals into descriptive Pest file-level constants for the empty search prompt, exact search target title, and prefixed partial title.

Verification:

  • php artisan test --compact tests/Feature/GameSearchTest.php --filter="search page renders for guests and authenticated users|blank and whitespace searches render a clear validation message|search orders exact name matches before prefix partial and alternate title matches" (3 passed, 14 assertions)
  • vendor/bin/pint --dirty --format agent

Note: an initial full-file GameSearchTest run produced no output after several minutes and was interrupted; the touched tests were rerun with a focused filter and passed.

Committed and pushed as ae5a2c1.

Resolved by extracting duplicated GameSearchTest literals into descriptive Pest file-level constants for the empty search prompt, exact search target title, and prefixed partial title. Verification: - php artisan test --compact tests/Feature/GameSearchTest.php --filter="search page renders for guests and authenticated users|blank and whitespace searches render a clear validation message|search orders exact name matches before prefix partial and alternate title matches" (3 passed, 14 assertions) - vendor/bin/pint --dirty --format agent Note: an initial full-file GameSearchTest run produced no output after several minutes and was interrupted; the touched tests were rerun with a focused filter and passed. Committed and pushed as ae5a2c1.
Codex 2026-06-10 20:04:25 -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#700
No description provided.