Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Removing a dependency from a manifest does not prove it is absent from the software you build, deploy, or run. It may still arrive through another package, be resolved during a build, exist in a copied-in file or cache, or remain in an older production artifact. The practical fix is to verify the specific stage you care about—not treat one changed file as proof of a clean system.

What “dependency residue” means

“Dependency residue” is a useful label for a gap between the dependency state a team thinks it has changed and the state that still exists elsewhere in the software lifecycle. It is not presented here as a formal industry standard. The underlying problem is straightforward: a manifest, a lock file, a build artifact, a deployment, and a running system describe different things.

The phrase “most expensive” is a risk framing, not a measured universal cost ranking. Unused packages increase a project’s dependency footprint and potential exposure, according to Google Cloud’s dependency guidance. If a component is malicious, cleanup may also span developer machines, package caches, and production software, as Microsoft Security Engineering’s guidance explains. No general dollar figure establishes how much dependency residue costs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why can a dependency remain after I remove it?

Another package may still require it

A direct dependency is one your application names itself. A transitive dependency is brought in because another dependency requires it. Those relationships can extend through multiple levels, so deleting one direct declaration may leave the package in the resolved dependency tree. A lock file records resolved versions for a particular installation or build; inspect the tree and paths, not just the top-level manifest. Google Cloud explains direct and transitive dependencies and lock files, while GitHub documents dependency graph data and paths.

The dependency may be resolved during the build

Some ecosystems resolve indirect dependencies at build time. A static dependency graph may not show every component unless the relevant build information is submitted. GitHub says its graph can identify indirect dependencies when they are defined in manifests or lock files, and supports build-time dependency submissions to add visibility. The exact coverage depends on the ecosystem and the data available to the graph. GitHub’s dependency graph documentation describes these limits.

A copied-in file may not be a package-manager dependency

A library copied into a repository, bundled in an archive, or included as a loose binary may not appear as an ordinary manifest or lock-file entry. GitHub’s troubleshooting documentation calls out such loose dependencies as items that are not automatically included in the dependency graph. That means a clean graph is not, by itself, proof that copied-in code is absent. See GitHub’s dependency graph troubleshooting guidance.

An old cache or artifact may still contain it

A changed dependency declaration affects future resolution; it does not retroactively rewrite packages already downloaded into a cache, artifacts already built, or software already deployed. A new build and a check of the relevant artifact or deployment are needed to establish what those states contain. In an incident involving a malicious component, Microsoft specifically identifies developer desktops, package-caching solutions, and production software or services as places that may need cleanup. Microsoft Security Engineering’s open-source practices covers that response scope.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Dynamic behavior can hide real use—or make absence hard to prove

Reflection, dynamic proxies, class loading, generated code, and less common execution paths can make static “unused” findings uncertain. A package can also be present for a transitive relationship or platform-specific role that is not obvious from a simple search. Static analysis, build inventories, and runtime observation therefore provide different evidence; none should be treated as a universal view of every component in every situation. CISA’s 2023 SBOM types paper describes the differing visibility and limitations of source, build, analyzed, deployed, and runtime inventories.

Why “unused” is a hypothesis, not a removal order

A tool’s unused-dependency recommendation is useful evidence, but it is not proof that removal is safe. In a 2022 peer-reviewed Java study, Chuang and colleagues found that augmenting analysis with critical OPAL call-graph edges caused 12 dependencies initially flagged as unused in the studied application to be identified as used. Their decision framework produced one-third fewer false positives than the compared state-of-the-art approach in an industrial Java case study; that result is specific to the paper’s method and study, not a general rate for other languages or repositories. Read the 2022 study.

The same paper’s selective removal tests illustrate why a flag deserves review: all three tested dependencies classified as used caused functionality-test failures when removed. Of six selected recommendations that required additional developer steps, half failed tests; one selected dependency classified as unused passed. These are small, selected counts from that study, not expected failure rates for a different project. The authors also describe developer review decisions involving transitive relationships, future upgrades, edge cases, and needed functionality.

What does an inventory actually prove?

An SBOM—a software bill of materials—is a formal record of software components and supply-chain relationships. It is useful only in relation to its scope: what was inventoried, at which lifecycle stage, and for which software version. NTIA’s 2021 minimum-elements report defines the record and its purpose. CISA’s taxonomy distinguishes source, build, analyzed, deployed, and runtime SBOMs because each offers different visibility. A source inventory can describe declared components but miss some runtime-loaded elements; runtime observation can reveal what was loaded during observed activity but depends on the system being exercised. These are complementary views, not interchangeable proof. CISA’s SBOM types paper.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Inventory view Useful for Important limit
Source or manifest view Seeing declared dependencies and source-level relationships. May not include components resolved only during a build, copied-in loose files, or dynamically loaded components. GitHub documents graph omissions.
Lock file or resolved dependency tree Seeing versions selected for a particular resolution and tracing transitive paths. Does not alone establish what is in an older cache, artifact, deployment, or current runtime. Google Cloud’s dependency guidance.
Build inventory or submitted build snapshot Adding visibility into dependencies resolved during the build. Coverage depends on the build process, ecosystem support, and submitted data. GitHub dependency graph data.
Deployed inventory Checking components associated with a particular released or deployed version. Does not necessarily show what is loaded during execution. CISA’s taxonomy.
Runtime observation Seeing components loaded during the observed operation of a system. Observed results depend on exercised paths and conditions; untested behavior may remain unseen. CISA’s taxonomy.

CISA’s August 2025 minimum-elements update calls for transitive dependency coverage and for authors to identify “known unknowns” when component information is incomplete. It also says each software version or update should have an associated SBOM. Those practices make an inventory more useful without implying that any one SBOM can prove absence across every stage. CISA’s 2025 SBOM Minimum Elements.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to verify a dependency is really gone

  1. Define the claim. Specify whether you mean the manifest entry is gone, the resolved tree changed, a newly built artifact excludes the component, a cache has been cleaned, or deployed and running systems no longer contain it. Each is a different check.
  2. Trace the dependency path. Review direct and transitive relationships in the lock file or equivalent, and inspect build-resolved snapshots where your ecosystem supports them. Check for copied-in binaries, archives, plugins, generated code, and platform-specific relationships when relevant. GitHub’s graph documentation describes transitive paths and build-time submissions.
  3. Investigate “unused” findings before acting. Check for reflection, dynamic invocation, proxies, class loading, generated code, and paths that tests may not exercise. Ask why the package was added and whether another dependency, planned upgrade, or required feature still relies on it. The 2022 Java study shows why automated findings benefit from analysis and developer review. Study details.
  4. Review the dependency change before merging. Removing or updating one direct package can change indirect packages too. GitHub’s dependency review can surface added, removed, or updated components and known vulnerability information in pull requests. GitHub dependency review.
  5. Build and test the changed software. Regenerate the resolved dependency state, run tests that cover relevant functionality, and inspect the output of the build or package manager. A manifest diff alone is not artifact verification.
  6. Check the artifact and deployment you care about. Confirm the produced software and, where relevant, the deployed inventory for the exact version. If the question is whether the component is currently loaded, use runtime evidence and document the activity observed; an unexercised path may not appear.
  7. For a malicious component, clean every relevant copy. Investigate developer machines, package caches, build outputs, and production services or software that consumed it. Preserve version and provenance information for incident response. Microsoft’s guidance.
  8. Keep inventories versioned and disclose gaps. Associate SBOMs with the software version or update they describe, include transitive dependencies where possible, and record known unknowns rather than implying completeness. CISA’s 2025 minimum-elements document.

Choosing an inventory approach

When evaluating a dependency graph, software composition analysis tool, or SBOM workflow, compare the evidence it can provide rather than asking whether it “finds everything.” Useful dimensions include:

  • Lifecycle stage: Does it describe source declarations, build resolution, analyzed software, deployment, or runtime?
  • Dependency coverage: Can it represent transitive components, build-time resolution, copied-in files, and dynamic components relevant to your environment?
  • Version specificity: Is the result tied to the exact artifact or software version you need to assess?
  • Build and ecosystem fit: Does it work with the actual package manager, build process, and deployment model in use?
  • Disclosure of omissions: Does it identify unsupported inputs, incomplete data, or known unknowns?

A manifest scanner, build-generated inventory, and runtime observation can all contribute, but answer related rather than identical questions. GitHub’s dependency graph and review documentation describe relevant graph and pull-request capabilities; CISA’s taxonomy and 2025 minimum-elements guidance explain why stage, scope, and disclosed gaps matter. GitHub graph data, GitHub dependency review, CISA SBOM types, CISA 2025 SBOM Minimum Elements.

What to remember

A dependency removal is complete only relative to a defined state and the evidence used to check it. The manifest change is the start of verification: trace why the package was present, rebuild, and check the artifact, deployment, cache, or runtime state that matters. The potential cost depends on the component and the exposure; the avoidable mistake is treating one inventory view as proof about all the others.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.