An IntelliJ IDEA / Android Studio plugin that visualizes Android module dependency graphs as an interactive node diagram and analyzes them for unused or redundant dependencies.
The interactive dependency graph, shown on the bundled synthetic clean-architecture playground project.
- Automatic dependency extraction — reads from the IntelliJ/Gradle project model, no manual configuration
- Hierarchical layout — modules arranged by dependency depth with horizontal depth-ruler lines
- Force-directed layout — Barnes-Hut optimized physics simulation as an alternative view
- Smart module typing — auto-detects 12 module types from naming conventions (see table below)
- App-scope filtering — select one or more app modules to show only their transitive dependency trees
- Module type filtering — toggle module types on/off via color-coded chips in the sidebar
- Configurable prefix exclusions — exclude module prefixes like
build-logicorbuildSrc - Color-coded dependency edges — green for outgoing, blue for incoming, red for wrong-direction (deeper → shallower), dashed red for unused
- Interactive graph — pan (drag), zoom (scroll wheel or
+/-), click to select, double-click to openbuild.gradle - Viewport culling — only renders visible nodes/edges for smooth performance on large projects
- Legend overlay — shows module type colors for currently present types
- Test module toggle — optionally show
test,androidTest, andtestFixturessource sets - Persistent settings — exclusion filters and test visibility saved per project
- Unused dependency detection — scans source files for imports, fully-qualified references, and resource/manifest references to determine if a dependency is actually used
- Transitive redundancy detection — identifies dependencies that are already available transitively through a sibling module
- Sibling api() exposure — detects when a dependency is transitively available via a sibling's
api()configuration, marking it as truly redundant (high confidence) - Type leakage detection — checks if a sibling module's public API exposes types from the target dependency, which may mean the dependency is needed for compilation even without direct imports
- DI/codegen awareness — lowers confidence for modules containing Dagger/Hilt, Room, or other infrastructure annotations that may be consumed via code generation rather than direct imports
- Confidence scoring — each finding includes a confidence percentage based on package count, analysis type, and contextual signals
- Reason display — every result shows a human-readable explanation of why it was flagged (visible in the analysis list, module detail panel, and markdown export)
- Convention plugin filtering — dependencies injected by convention plugins (not explicitly declared in the module's build.gradle) are excluded from results
- Markdown export — copy all results as formatted markdown with module grouping, confidence, and reasons
The analyzer runs in two phases:
Phase 1 — Unused dependency detection: For each non-test dependency, the source module's files are scanned for references to the target module's packages:
- Import matching — checks if any import statement starts with a target package prefix
- FQN references — scans source code (with comments and strings stripped) for fully-qualified package references
- Resource/manifest references — checks
AndroidManifest.xmland XML resource files for target package references - DI/codegen heuristic — if no references are found but the target contains infrastructure annotations (
@Module,@Provides,@Entity, etc.), confidence is lowered
Phase 2 — Transitive redundancy: For each dependency, checks whether the target module is already reachable through another direct dependency via api() (compile-scoped, exported) or implementation() (available at runtime but may break compilation if removed).
Post-processing — Sibling enrichment: Results are refined by checking sibling dependencies:
- If a sibling exposes the target via
api(), the dependency is marked as redundant with high confidence - If a sibling uses
implementation()for the target, the analyzer checks for type leakage in the sibling's public API — if found, confidence is lowered since the dependency may be needed for compilation
Dependencies confirmed as used in Phase 1 are excluded from Phase 2 results, preventing false positives where a directly-used dependency also happens to be transitively available.
- Download the
.zipfile from Releases - In Android Studio, go to Settings > Plugins > Gear icon > Install Plugin from Disk...
- Select the downloaded
.zipfile
# Launch a sandboxed IDE with the plugin
./gradlew runIde
# Build the plugin zip
./gradlew buildPluginThe playground/ directory contains four synthetic multi-module Gradle
projects (≈110 fictional modules in total) for trying the plugin and reproducing issues
without needing a real codebase:
| Project | Modules | Shape |
|---|---|---|
clean-architecture |
49 | Strict app → feature → domain → repository → data → core layering; every module type; multiple apps |
feature-api-impl |
22 | Feature modules split into :feature-x-api / :feature-x-impl |
mvvm-presentation |
25 | UI / presentation heavy, package-by-layer |
legacy-monolith |
12 | One large app + unused dependencies — exercises Analyze |
They are pure Kotlin/JVM, so they sync with only a JDK (no Android SDK). Open any of them in
the sandbox IDE (./gradlew runIde), then open the Dependency Graph tool window. If you're
filing a bug, pointing at the exact playground module/edge that misbehaves makes it easy to
reproduce. See playground/README.md for details.
| Selecting a module shows its dependencies/dependents | The feature-api-impl architecture |
|---|---|
![]() |
![]() |
- IntelliJ IDEA 2024.3+ or Android Studio based on 2024.3+
- JDK 21+
- An Android/Gradle project that has been synced (so the Gradle project model is available)
- Open an Android project in IntelliJ IDEA or Android Studio
- Make sure the Gradle project is synced
- Open the Dependency Graph tool window (bottom panel)
- The graph loads automatically — use the toolbar to refresh, fit to content, or switch layouts
- Click Analyze to scan for unused and redundant dependencies — results appear in the Analysis tab
| Action | Description |
|---|---|
| Refresh | Re-extract dependencies from the Gradle project model |
| Fit to Content | Zoom and pan to show all nodes |
| Force Layout | Toggle between hierarchical and force-directed layout |
| Analyze | Scan for unused and transitive-redundant dependencies |
| Test Modules | Show/hide test source set modules |
| Module Filters | Configure excluded module prefixes |
| Key | Action |
|---|---|
Esc |
Deselect current module |
F |
Fit graph to content |
+ / = |
Zoom in |
- |
Zoom out |
| Action | Effect |
|---|---|
| Click node | Select/deselect module |
| Double-click node | Open module's build.gradle in editor |
| Right-click node | Context menu (select, navigate to build file) |
| Drag canvas | Pan the view |
| Scroll wheel | Zoom in/out at cursor position |
| Hover node | Highlight with hand cursor |
Modules are auto-classified by name segments (split on :, -, _):
| Type | Color | Detected Keywords |
|---|---|---|
| App | Red | Detected via com.android.application plugin or applicationId in build.gradle |
| Feature | Teal | feature, feat |
| Domain | Blue | domain, usecase, interactor |
| Core | Salmon | core, common, shared, base, foundation, platform, infrastructure |
| Repository | Mint | repository, repo |
| Library | Plum | library, lib, sdk, util, utils, helper, toolkit |
| Data | Sky Blue | data, database, db, storage, cache |
| UI | Orange | ui, compose, view, widget, presentation |
| Navigation | Purple | navigation, nav, routing, deeplink |
| DI | Green | di, inject, hilt, dagger, koin, wiring |
| Test | Khaki | Shown when test module toggle is enabled |
| Unknown | Gray | No keywords matched |
# Build the plugin
./gradlew build
# Run tests
./gradlew test
# Launch a sandboxed IDE with the plugin
./gradlew runIdeContributions are welcome! Please read the CLA carefully before submitting your contribution to Mercari. Under any circumstances, by submitting your contribution, you are deemed to accept and agree to be bound by the terms and conditions of the CLA.
To report a security vulnerability, please follow the process in SECURITY.md. Do not open public issues for security reports.
This project is licensed under the MIT License.
Copyright (c) 2026 Mercari, Inc.



