apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Detekt: split ZoomableDraweeView that exceeds TooManyFunctions

Open benndip opened this issue 1 month ago • 3 comments

Part of #7063.

ZoomableDraweeView is flagged by Detekt TooManyFunctions. It has about 40 functions, so it needs its own pull request.

Detekt allows 11 functions in a class. These classes are over that limit.

The matching exception lines in app/detekt-baseline.xml are:

  • TooManyFunctions:ZoomableDraweeView.kt$ZoomableDraweeView : DraweeViewScrollingView

Steps

  1. Read the classes and choose one cohesive group of functions in each. A likely group is touch dispatch or the zoom-controller wiring.
  2. Delete only those <ID> lines from app/detekt-baseline.xml.
  3. Run ./gradlew :app:detekt and confirm the report names these types and no other new finding.
  4. Move that group onto the type that already owns the job, or into a new type if none does. Keep the behavior the same. Add a Javadoc on every new class and method. Do not reword existing comments.
  5. If the moved code is logic, add or extend a unit test for the new class. Existing tests must still pass.
  6. Run ./gradlew :app:ktlintCheck :app:detekt testBetaDebugUnitTest and confirm all checks pass.
  7. Open one pull request for this bucket only. In the description, name this issue and say it is part of #7063.

benndip avatar Oct 24 '26 14:10 benndip

Hi @nicolas-raoul, I have a pull request open for #5733 (#7075), and its conflict is resolved. I’d like to work on this issue next. Could it be assigned to me? I’ll start by reading the class and posting which group of functions I plan to move.

minahilnaseer8-max avatar Oct 27 '26 12:10 minahilnaseer8-max

Hi @nicolas-raoul, just a gentle follow-up. Is this issue still available for me? I’ve already read the class and have a plan for which functions to move, and I can share it here if that helps.

minahilnaseer8-max avatar Oct 28 '26 14:10 minahilnaseer8-max

Sorry for the delay!

nicolas-raoul avatar Oct 29 '26 01:10 nicolas-raoul