Remove warning#18038
Conversation
|
First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible. |
|
can someone please review the changes and say why my changes got error |
lukstbit
left a comment
There was a problem hiding this comment.
Hey, thank you for contributing, I left some issues to fix. Also, please squash the code this should consist of only one commit.
can someone please review the changes and say why my changes got error
The test is failing because you introduced breaking changes to the code. See review comments.
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/analytics/UsageAnalytics.kt
Outdated
Show resolved
Hide resolved
| * @see BrowserConfig.activeColumnsKey | ||
| */ | ||
|
|
||
| @Suppress("Unused", "KDocUnresolvedReference") |
There was a problem hiding this comment.
The issues here shouldn't be suppressed, the proper imports should be added so the documentation references work. This mean importing the BrowserConfig and Backend classes.
There was a problem hiding this comment.
import com.ichi2.libanki.BrowserConfig.ACTIVE_CARD_COLUMNS_KEY
import com.ichi2.libanki.BrowserConfig.ACTIVE_NOTE_COLUMNS_KEY
as both have no usage if i import it a new warning will appear that's why did not import it
There was a problem hiding this comment.
I see but if you change the documentation to prefix the properties then it should work(I missed that the BrowserConfig class is already imported):
[BrowserConfig.ACTIVE_CARD_COLUMNS_KEY]
[BrowserConfig.ACTIVE_NOTE_COLUMNS_KEY]
and for the other two:
* @see [Backend.setActiveBrowserColumns]
* @see [BrowserConfig.activeColumnsKey]
after importing the net.ankiweb.rsdroid.Backend class. Suppressing is not the proper way to fix these.
lukstbit
left a comment
There was a problem hiding this comment.
Left some comments, also please squash the commits into a single commit for merging.
| * @see BrowserConfig.activeColumnsKey | ||
| */ | ||
|
|
||
| @Suppress("Unused", "KDocUnresolvedReference") |
There was a problem hiding this comment.
I see but if you change the documentation to prefix the properties then it should work(I missed that the BrowserConfig class is already imported):
[BrowserConfig.ACTIVE_CARD_COLUMNS_KEY]
[BrowserConfig.ACTIVE_NOTE_COLUMNS_KEY]
and for the other two:
* @see [Backend.setActiveBrowserColumns]
* @see [BrowserConfig.activeColumnsKey]
after importing the net.ankiweb.rsdroid.Backend class. Suppressing is not the proper way to fix these.
AnkiDroid/src/main/java/com/ichi2/anki/analytics/UsageAnalytics.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/analytics/UsageAnalytics.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/browser/BrowserColumnCollection.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/browser/BrowserColumnCollection.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/browser/BrowserColumnCollection.kt
Outdated
Show resolved
Hide resolved
Arthur-Milchior
left a comment
There was a problem hiding this comment.
This is really not easy to review as there are a lot of related changes together, and it's hard to know which part is related to what. For example, cliboard is removed. I don't know why. I guess it was not actually useful.
I'd help if you could split in multiple logical commit. For example one that remove everything related to clipboard, with a commit message stating that all of that was unused. Then a different commit (or even a different PR) that add the "unused" suppression.
For "unused", please always add a comment explaining why we need the function/class that appears unused. The warning is here to tell us something is strange. If it's strange but actually the right implementation, we really should explain why it is the case.
In every "unused" you added, I've no idea why they are needed. So I need you to do the research, probably looking at the history, and explain to us why those are needed.
Most importantly, I assume you're here for GSoC. If so, as a mentor, I should warn you I would not consider this kind of PR sufficient to consider your application. I always appreciate code cleaning. But it does not really allow me to check whether you know how to look at a bug, investigate it, correct it, ask question if you're stuck, the way solving a user facing issue or adding a feature help us evaluate you
AnkiDroid/src/main/java/com/ichi2/anki/analytics/AcraAnalyticsInteraction.kt
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/analytics/UsageAnalytics.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/analytics/AcraAnalyticsInteraction.kt
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/browser/BrowserColumnCollection.kt
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
david-allison
left a comment
There was a problem hiding this comment.
I have squashed and force pushed this, let's get it in
Purpose / Description
Reducing Android Studio warnings by cleaning up unused code and fixing initialization.
Fixes
Contributes towards Cleanup Fix Android Studio Warnings
Approach
By using android studio suggestions and deleting never used variables or using suppression
How Has This Been Tested?
I run my code after change on emulator android 11 it runs as previous
Checklist
Please, go through these checks before submitting the PR.
You have a descriptive commit message with a short title (first line, max 50 chars).
You have performed a self-review of your own code