Skip to content

chore: Resolve static analysis warnings and reduce detekt baseline suppressions - #3924

Merged
shobhitagarwal1612 merged 7 commits into
masterfrom
lint
Sep 9, 2026
Merged

chore: Resolve static analysis warnings and reduce detekt baseline suppressions#3924
shobhitagarwal1612 merged 7 commits into
masterfrom
lint

Conversation

@shobhitagarwal1612

Copy link
Copy Markdown
Member

This PR addresses several static analysis findings identified by Android Lint, Detekt, and the Kotlin compiler, tunes analyzer configurations for tests, and significantly reduces suppressions in baseline.xml (from 8 down to 2).

All changes are non-breaking, verified with ./gradlew checkCode, and accompanied by passing unit tests across all modules.

Key Changes

  • Compiler & Lint:
    • Adopted Android KTX extensions (toColorInt, toUri, bitmap[x, y]).
    • Fixed accessibility (android:focusable="true") and layout performance (android:baselineAligned="false").
    • Updated deprecated hiltViewModel Compose import and removed redundant Elvis operator.
    • Replaced unmanaged SavedStateHandle instantiation in HomeScreenViewModel with a plain property.
    • Stubbed default remoteConfig.getString(...) in TestFirebaseModule to match Firebase contracts.
  • Detekt Baseline Reduction (8 $\to$ 2):
    • Eliminated labeled returns (@getMapAsync, @withReady) in GoogleMapsFragment and DataCollectionViewModel.
    • Simplified getDraftSubmission() in HomeScreenViewModel and reduced nesting depth in SubmissionDataConverter.
    • Removed obsolete DataCollectionTaskFragment suppression.
  • Configuration:
    • Excluded test source sets from Detekt's LargeClass rule (removing DataCollectionFragmentTest from baseline).
    • Documented rationale for display_700.xml lint exclusion.

@andreia-ferreira PTAL?

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.69231% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.73%. Comparing base (16608a6) to head (631e65a).

Files with missing lines Patch % Lines
...ta/local/room/converter/SubmissionDataConverter.kt 36.36% 5 Missing and 2 partials ⚠️
...droid/ui/datacollection/DataCollectionViewModel.kt 78.57% 2 Missing and 4 partials ⚠️
...dplatform/android/ui/map/gms/GoogleMapsFragment.kt 0.00% 3 Missing ⚠️
...undplatform/android/ui/home/HomeScreenViewModel.kt 0.00% 1 Missing and 1 partial ⚠️
...org/groundplatform/android/ui/main/MainActivity.kt 0.00% 2 Missing ⚠️
...roundplatform/android/ui/map/gms/mog/MogTileExt.kt 0.00% 1 Missing ⚠️
...va/org/groundplatform/android/ui/util/ColorUtil.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3924      +/-   ##
============================================
+ Coverage     69.71%   69.73%   +0.01%     
- Complexity     1985     1986       +1     
============================================
  Files           417      417              
  Lines         11426    11425       -1     
  Branches       1488     1486       -2     
============================================
+ Hits           7966     7967       +1     
+ Misses         2691     2689       -2     
  Partials        769      769              
Files with missing lines Coverage Δ
...oundplatform/android/ui/home/HomeScreenFragment.kt 73.91% <100.00%> (ø)
...rg/groundplatform/android/ui/main/MainViewModel.kt 67.21% <100.00%> (+1.63%) ⬆️
...g/groundplatform/android/ui/signin/SignInScreen.kt 63.07% <ø> (ø)
...latform/android/util/image/TileImageTransformer.kt 92.30% <100.00%> (ø)
...roundplatform/android/ui/map/gms/mog/MogTileExt.kt 20.00% <0.00%> (ø)
...va/org/groundplatform/android/ui/util/ColorUtil.kt 80.00% <0.00%> (ø)
...undplatform/android/ui/home/HomeScreenViewModel.kt 80.43% <0.00%> (+2.88%) ⬆️
...org/groundplatform/android/ui/main/MainActivity.kt 44.31% <0.00%> (+0.49%) ⬆️
...dplatform/android/ui/map/gms/GoogleMapsFragment.kt 18.10% <0.00%> (ø)
...droid/ui/datacollection/DataCollectionViewModel.kt 80.93% <78.57%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread app/src/main/java/org/groundplatform/android/ui/home/HomeScreenViewModel.kt Outdated
@shobhitagarwal1612
shobhitagarwal1612 merged commit 1e93f3d into master Sep 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants