-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removes - unused methods and classess using Android Studio Tool - Part 2 #19850
Conversation
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found out some unused fields while reviewing. Then I noticed this PR only covers methods and classes and I refrained from delving into the details to find more unused fields.
When I run unused declaration for only methods and classes, there are still 317 warnings. Some of these warnings are false alarms, but others are really unused. Did you intentionally leave them in the code? Here are few examples:
AztecEditorFragment.canUndo()
AztecEditorFragment.MediaPredicate.getTempMediaIdPredicate()
AppPrefs.getReaderRecommendedTagsDeletedForLoggedOutUser()
LocaleManager.createLanguageDetailDisplayStrings()
Was your intention to remove all unused methods and classes? If that is the case, I can go over all warnings to find unused declarations that are really unused.
I have smoke-tested the basic features, and they are still working properly 🟢. I believe this PR is safe. We can either add more unused code and merge this, or merge this and perform other cleanups in a separate PR.
properties.put(NEWS_CARD_ORIGIN, origin); | ||
properties.put(NEWS_CARD_VERSION, String.valueOf(version)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove also AnalyticsUtil.NEWS_CARD_ORIGIN
and AnalyticsUtil.NEWS_CARD_VERSION
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also remove the definition of these keys, DeletablePrefKey.STATS_WIDGET_KEYS_BLOGS
, DeletablePrefKey.STATS_WIDGET_DATA
, DeletablePrefKey.STATS_WIDGET_DATA
, DeletablePrefKey.STATS_WIDGET_PROMO_ANALYTICS
, UndeletablePrefKey.IAP_SYNC_REQUIRED
, DeletablePrefKey.PENDING_DRAFTS_NOTIFICATION_LAST_NOTIFICATION_DATES
.
Generated by 🚫 dangerJS |
Generated by 🚫 Danger |
Hey @irfano Thanks for the review. 🙌🏼
I reverted some commits, which deleted the unused functions in the Editor libs. I intend to take it up removing of the unused methods from Editor libs in a separate PR.
Yup, I was concentrating more on Classes and Methods. There is a chance that I might have missed some methods or classes. If you can, go over all the warnings that are still there. It would be really helpful. I suggest you do it in a separate PR if possible. Otherwise, I can take it up and create a Part 3 PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed with Ajesh and decided to continue removing the remaining warnings in other PRs.
The changes in this PR LGTM! 👍🏻 Merging now.
Fixes #
Description
This PR removes unused code from the Repo using Android Tool.
Code → Analyze → Run inspection by name..., type Unused declaration
2nd Part of #19788
To Test:
Regression Notes
Potential unintended areas of impact
App is not working as expected
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing and Smoke testing
What automated tests I added (or what prevented me from doing so)
Nothing
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: