Overview › Module Dependencies & API Surface

Module Dependencies & API Surface

Detailed static-analysis report for module dependencies & api surface.

Source: codebase scan · 2026-05-07

Executive summary

Costco Android has 56 modules (1 app + 22 features + 30 shared + 3 core/lib). The graph is densely connected — features import 15-24 shared modules each — and the public-API discipline of those shared modules is poor: shared/sdui exposes ~209 public top-level declarations with only 0-2% marked internal. Three shared modules (util, blankutil, common) have overlapping responsibilities. feature/savings appears to be a candidate for consolidation.

Module fan-in (most-depended-upon shared modules)

These are the modules every feature touches. Changes ripple far.

Shared moduleFan-in (dependents)Risk
shared/storage20High — any change touches everything
shared/statemanagement18High
shared/common14High
shared/ui13High
shared/pallet7Medium

Heavy-coupled features (highest fan-out)

Feature moduleShared depsNotes
feature/account24Couples to auth, data, featurehelper, sdui, security, geofence
feature/discover16
feature/warehouse15
feature/dmc15

Findings

HIGH

Overlapping shared utility modules

shared/util (8 lines, depends on core/core + shared/storage) and shared/blankutil (UI-leaning utilities) and shared/common (general utilities) have unclear boundaries. New utility code likely lands in the closest module by accident.
Recommendation: Merge into a single shared/util module with sub-packages (util/text, util/time, util/format, util/ui). Run a one-time package move + internal sweep to firewall implementation details.
HIGH

Public API leaks in shared modules

ModulePublic decl.Internal decl.Encapsulation
shared/sdui~209~0-2CRITICAL <1%
shared/auth13911MEDIUM 8%
shared/common863HIGH 3.5%
shared/data112PASS 18%
Recommendation: Define each module's public surface explicitly (a top-level api/ package). Mark everything else internal. Use Kotlin's -Xexplicit-api=strict compiler flag on shared modules.
MEDIUM

Possibly orphan module: feature/savings

Only depends on shared/translation, only consumed by feature/warehouse. Either deprecate or absorb into feature/warehouse.
Recommendation: Confirm with product whether feature/savings still ships separately; if not, retire the module.
MEDIUM

Heavy feature coupling

feature/account imports 24 shared modules. Changes anywhere in shared/* have a high probability of forcing recompiles or bugs in Account.
Recommendation: Introduce module-level interfaces that account depends on (anti-corruption layer). Convert direct imports of shared/sdui implementation classes into interface-only imports.
INFO

No dependency-graph artifact in CI

Modularization at this scale benefits from a generated module graph in CI to detect new cycles and unintended dependencies.
Recommendation: Add the kotlinx-dataframe-driven dependency-graph Gradle plugin (or Ben Mansfield's module-graph-assert) to generate a Mermaid graph per build and fail PRs that introduce new cycles.
Costco Android · Code Review Report · Generated 2026-05-07 · 626 machine-curated findings