dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

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

Open yogurtearl opened this issue 1 year ago • 1 comments
trafficstars

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.

yogurtearl avatar May 28 '24 22:05 yogurtearl

Thanks for the issue. This is an interesting idea, and is why the primary task of the plugin is buildHealth and not findBadDependencies or something. I'm not sure when I might have time to work on it, but I like it conceptually.

autonomousapps avatar Jul 13 '24 05:07 autonomousapps