Fix low SonarQube issues - #334
Merged
Merged
Conversation
- Renamed `latest_news` to `latest_news_title`. - Replaced the hardcoded "read" link text with the `latest_news_read_article` string resource. - Substituted the hardcoded content description for the event image with `latest_news_event_image_description`. - Updated `LatestNewsCardTest` to remove assertions on the now-localized "read" text. - Cleaned up several unused string and color resources.
fix info SonarQube issues - Clean up `LatestNewsViewModel` and `GlobalErrorViewModel` by removing commented-out Hilt annotations and unused private properties. - Remove a TODO comment about hardcoded colors in `DashboardEmergencyContactsCard`. - Delete a TODO comment from the `onCapabilitiesChanged` function in `DangerModeCardViewModel`.
medium SonarQube issues Refactor the `HazardMarker` composable by introducing the `HazardMarkerTestInjectables` data class. This change consolidates several testing-related dependencies into a single parameter, simplifying the function's signature and improving test code readability. The `AuthRepositoryFirebase` has also been slightly refactored for conciseness by removing explicit `return` statements from `Result` blocks.
eightysix-86
marked this pull request as ready for review
December 18, 2025 00:57
NailLaraqui
self-requested a review
December 18, 2025 01:02
# Conflicts: # app/src/main/java/com/github/warnastrophy/core/ui/features/dashboard/DangerModeCardViewModel.kt
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Goal
This pull request addresses and fixes low-priority SonarQube issues identified in the codebase. The goal is to improve code quality, ensure compliance with best practices, and remove redundant or unnecessary elements in the code while keeping the application's functionality intact.
Changes (All low SonarQube issues)
Test files:
assert(hasText("read"))inLatestNewsCardTest.ktHazardMarkerTestInjectablesdependency injection support inMapIconTest.ktto simplify function parameterssetUpHazardMarkerfunction and unused test cases inMapIconTest.ktAuthentication:
Result.successandResult.failureinAuthRepositoryFirebase.ktUI components:
DashboardEmergencyContactsCard.ktLatestNewsCard.ktto improve localization support and clarify textstrings.xmland removed unused or redundant entriesViewModels:
HiltViewModelannotations inLatestNewsViewModel.ktandGlobalErrorViewModel.ktfor future dependency injection enhancementsGeneral cleanup:
strings.xmlcolors.xmlNotes
Some part of the refactoring has been assisted by AI, especially the refactoring of methods (eg:
HazardMarker)