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.67k stars 115 forks source link

Count of transitive dependencies that would be required to add when removing an unused dependency #1145

Open ajohnsonz opened 3 months ago

ajohnsonz commented 3 months ago

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

When looking at the buildHealth report, there are a number of unused dependencies that can be removed, and a number of transitive dependencies that are suggested to add directly. For many of our internal libraries that are relatively lightweight, the transitive dependencies are okay to be included in a transparent way, if it means we add a single internal library instead of 15 other dependencies.

Describe the solution you'd like

For each suggested unused dependency to remove, I would like it to include a count of how many transitives from that dependency are used. If the count is zero, then that dependency can be removed no questions asked. If it's 10+, we'd probably just leave it for conciseness of the build file.

Describe alternatives you've considered

I think I saw an issue asking for the "reason" report to include all dependencies in one go - this would also be useful. Running the reason on every dependency one at a time isn't really practical for us.