Detekt: split ZoomableDraweeView that exceeds TooManyFunctions
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
- Read the classes and choose one cohesive group of functions in each. A likely group is touch dispatch or the zoom-controller wiring.
- Delete only those
<ID>lines fromapp/detekt-baseline.xml. - Run
./gradlew :app:detektand confirm the report names these types and no other new finding. - 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.
- If the moved code is logic, add or extend a unit test for the new class. Existing tests must still pass.
- Run
./gradlew :app:ktlintCheck :app:detekt testBetaDebugUnitTestand confirm all checks pass. - Open one pull request for this bucket only. In the description, name this issue and say it is part of #7063.
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.
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.
Sorry for the delay!