autonomousapps / dependency-analysis-gradle-plugin

Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins
Apache License 2.0
1.66k stars 116 forks source link

Feature Request: Advice on modules that could/should be combined #1193

Open yogurtearl opened 1 month ago

yogurtearl commented 1 month ago

Is your feature request related to a problem? Please describe.

Sometimes when you modularize a codebase the final structure is not clear and you might "over-modularize", meaning things that should be in a single module are separated into multiple modules

Describe the solution you'd like Would like the plugin to give advice on which module are good candidates for combining into a single module.

a couple of heuristics on when you might want to combine modules:

  1. when any given module depends on A it also depends on module B XX% (configurable) of the time, and vice versa.
  2. module A and module B apply the same (or mostly the same) plugins ("mostly same" should be configurable)
  3. module A and module B have the same (or mostly the same) dependencies ("mostly same" should be configurable)
  4. module A and module B are less than NNN (configurable) lines of code when combined (don't want to create huge modules)

if some combination of those things are true, then "combineModuleAdvice" should propose combining module A and B

Additional context

I generally like to start with smallest modules possible, see what structure emerges, and then combine modules that are similar.