Detekt: shorten long methods in WikidataFeedback, ReviewImageFragment and PlaceAdapterDelegate (3 findings)
Opened by @nicolas-raoul · Assignees: @Medhansh-741
Solve & Merge Reward: Up to +271 XP & +60 Coins
+30 XP on PR open · +180 XP & +60 coins on merge · +61 star XP (1,221 stars)
Claim Status & GitHub Signal
Assigned on GitHub (@Medhansh-741). Check recent comments before starting duplicate work.
Estimated from issue labels (good first issue, code-quality), Kotlin context, and discussion depth. There are 3 GitHub comments to review for maintainer clarifications. Note: this is an estimate, not a guarantee.
What It's About
Detekt: shorten long methods in WikidataFeedback, ReviewImageFragment and PlaceAdapterDelegate (3 findings). Part of the Detekt static analysis clean-up, split out of 7062. Difficulty: Starter. Three set-up methods that are only a little over the limit. Good for a first contribution. Findings to fix - [PlaceAdapterDelegate.placeAdapterDelegate](https://github.com/com
Why It Matters
Resolving #7502 improves reliability and developer experience in commons-app/apps-android-commons.
Expected Outcome
A focused pull request addressing #7502 with relevant checks or tests verified locally.
Log in to compare this issue's requirements against your profile skills. Required concepts: HTTP & REST APIs.
Progressive AI Hints
Hint #1 is always free and calibrated to your experience level. Extra hints unlock with coins without spoiling the full solution.
Skill-Gap Learning
No Boot.dev course directly matches your missing Kotlin gaps (HTTP & REST APIs, Kotlin), so DevWeave won't pad with an unrelated language course.
Issue Description
Part of the Detekt static analysis clean-up, split out of #7062.
Difficulty: Starter. Three set-up methods that are only a little over the limit. Good for a first contribution.
Findings to fix
PlaceAdapterDelegate.placeAdapterDelegate:LongMethod: 73 lines (maximum 60)ReviewImageFragment.onCreateView:LongMethod: 82 lines (maximum 60)WikidataFeedback.onCreate:LongMethod: 84 lines (maximum 60)
Steps
- Delete the matching
<ID>...</ID>lines fromapp/detekt-baseline.xml(only the ones listed above). - Run
./gradlew :app:detektto see the exact locations. - Fix the findings in code, without changing behaviour. Add or extend unit tests covering the refactored methods.
- Do not add
@Suppressor new baseline entries. If keeping a method as it is really makes more sense, say why in the pull request. - Run
./gradlew :app:ktlintCheck :app:detekt testBetaDebugUnitTestand check that everything passes. - Test the affected screens on a device and describe what you tested.
- Open a pull request with
Fixes #<this issue>in its description.
Part of #7062. Please ask to be assigned here before starting.
Linked Pull Requests (0)
No linked or cross-referenced pull requests detected via GitHub timeline. Check comments below for informal claims before starting.
GitHub Comments (3)
@nicolas-raoul i'd like to take this
Hi @Medhansh-741! You have been assigned to this issue. ✨
@nicolas-raoul opened #7521 for this.
Issue Troubleshooting Threads (0)
No troubleshooting threads opened for this issue yet. If you hit a test, build, or navigation blocker, post what you've tried so fellow contributors can help.
PR Verification & Rewards
Sign in and link GitHub to verify your PR against this issue and earn XP + coins.
Contribution Workflow
Track your local progress before opening a pull request on GitHub.
Repository Context
Top Repository Paths
CONTRIBUTING.md Excerpt
Thanks for considering to contribute to this project! A few guidelines for people who want to contribute their code to this software are documented in this project's Wiki. If you're not sure where to start head on to this wiki page.
Here's a gist of the guidelines,
-
Make separate commits for logically separate changes
-
Describe your changes well in the commit message
The first line of the commit message should be a short description of what has changed. It is also good to prefix the first line with "area: " where the "area" is a filename or identifier for the general area of the code being modified. The body should provide a meaningful commit message.
-
Write Javadocs
We require contributors to include Javadocs for all new methods and classes submitted via PRs (after 1 May 2018). This is aimed at making it easier for new contributors to dive into our codebase, especially those who are new to Android development. A few things to note:
- This should not replace the need for code that is easily-readable in and of itself
- Please make sure that your Javadocs are reasonably descriptive, not just a copy of the method name
- Please do not use
@authortags - we aim for collective code ownership, and if needed, Git allows us to see who wrote something without needing to add these tags (git blame)
-
Write tests for your code (if possible)
-
Make sure the Wiki pages don't become stale by updating them (if needed)
-
Document every new string for translators
When you add a string to
app/src/main/res/values/strings.xmlorvalues/error.xml, add a non-empty entry with the same name to the file of the same name inapp/src/main/res/values-qq/. That folder is not a language: translatewiki.net shows it to translators next to the English text, and they usually translate without seeing the app. If you change what a string means, or add or remove a placeholder, update its qq entry too. If you remove a string, remove its qq entry. Strings withtranslatable="false"don't need one. CI checks all of this.A good qq entry says:
- where the text shows up and what it is (screen title, button, dialog,
... (truncated)
Advisory PR Assistant
Helps structure your PR description or unpack reviewer feedback. Does not perform GitHub actions.