Skip to content

refactor(FileDisplayActivity): extract file resolution and clarify ac…#16461

Draft
joshtrichards wants to merge 1 commit intomasterfrom
jtr/refactor-FileDisplayActivity-initFiles
Draft

refactor(FileDisplayActivity): extract file resolution and clarify ac…#16461
joshtrichards wants to merge 1 commit intomasterfrom
jtr/refactor-FileDisplayActivity-initFiles

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Feb 6, 2026

…count init logic

Addresses CI/CD detekt output:

/home/runner/actions-runner/_work/android/android/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt - 20min debt
	LongMethod - 62/60 - [The function initFile is too long (62). The maximum length is 60.] at /home/runner/actions-runner/_work/android/android/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt:2805:17
  • Extracted the file selection and validation logic into a dedicated helper method (resolveCurrentFile)
  • Renamed initFile to initializeCurrentFile for clarity
  • Dropped no-op conditional parameter from updateActionBarTitleAndHomeButton() call.
  • Clarified and documented process when initializing file state and user/account changes, with improved KDoc and targeted comments.
  • Slightly simplified conditional UI refresh logic.
  • Preserved all core functionality and app behavior; this is a structural refactor with no functional impact.
  • Tests written, or not not needed

…count init logic

Signed-off-by: Josh <josh.t.richards@gmail.com>
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Codacy

SpotBugs

CategoryBaseNew
Bad practice4242
Correctness7474
Dodgy code257257
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3434
Performance4343
Security1818
Total478478

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16461.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

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.

1 participant