Skip to content

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

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

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

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Feb 6, 2026

Copy link
Copy Markdown
Member

…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

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown

Codacy

SpotBugs

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

@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown

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.

@alperozturk96

Copy link
Copy Markdown
Collaborator

Hi! Thanks for your contribution.

This PR has been in draft for some time, so we'd like to check whether you're still planning to work on it.

If the PR is still valid and you intend to continue, please mark it as Ready for Review (remove the draft status) and add the review label. We'll then be happy to take a look.

If you no longer plan to continue with this PR, please let us know so we can keep the backlog up to date.

Thanks!

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