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.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

A cyclic dependency is a directed path that eventually leads back to where it started: A → B → C → A. Find cycles at the graph level that matters—files, packages, projects, or architectural modules—then inspect the edges and remove the one that violates ownership or a boundary. A report is a map of dependencies the tool can resolve, not proof that every runtime relationship has been found.

What kind of dependency cycle are you looking for?

A dependency graph has components as nodes and dependencies as directed edges. A cycle exists when following those edges returns to the starting node. The meaning of a cycle depends on what counts as a node:

  • Source-file or module cycle: files import or include one another, directly or through other files.
  • Class or type cycle: types refer to one another. Some edges may be compile-time-only, such as type-only references.
  • Package, directory, or architectural-module cycle: groups depend on one another, even if no individual file pair forms a loop.
  • Project or build cycle: projects, libraries, or build modules require one another. Build tools may impose constraints different from source-level import rules.
  • Runtime initialization cycle: loading or initializing one component causes another to be loaded before the first is ready.
  • Object-reference cycle: objects keep references to one another. This concerns object lifetime and memory management, not necessarily imports or project references.

These are different graphs and call for different diagnostics. A clean file-level report does not establish that package or architectural dependencies are acyclic. Conversely, a static import cycle does not automatically mean the program fails: consequences vary with the language, runtime, build system, and design.

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

Use a repeatable detection workflow

  1. Choose the graph level and scope. Decide whether you need to inspect source imports, packages, projects, or intended architecture boundaries. Include the relevant production, test, generated, and monorepo areas deliberately.
  2. Configure dependency resolution. Check source roots, file extensions, aliases, compiler settings, conditional compilation, and external-dependency handling. Reflection, dynamic loading, and generated code may not be visible to a static analyzer.
  3. Run a focused cycle report. Start with the relevant directory, package, or module and request cycle-only output where available. A text path is often easier to investigate than a full-repository graph.
  4. Read warnings and skipped-file details. Unresolved imports or excluded files can make a report incomplete. Do not interpret “no cycles found” as proof of a clean graph until you know what the tool analyzed.
  5. Expand one path into its actual edges. For every step in a reported loop, find the import, reference, or project declaration that creates it. Check whether an index or barrel file is introducing indirect dependencies.
  6. Choose a specific edge or boundary to change. Use ownership and intended layering to decide what should move, what contract belongs at the boundary, or whether the relationship should disappear entirely.
  7. Verify the behavior and rerun the same analysis. Run focused tests and the required broader build or test suite, then repeat the detector with the same scope and resolution settings.

Tool recipes by ecosystem

JavaScript and TypeScript

Madge can list circular dependencies with madge --circular <path>. To create a graph of only those cycles, use madge --circular --image cycles.svg <path>; Graphviz is needed for image output. Madge supports CommonJS, AMD, and ES modules, and can analyze TypeScript with appropriate configuration. Use madge --warning <path> to check for skipped files and --debug for additional diagnostics.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

dependency-cruiser can create a starter rules configuration with npx dependency-cruiser --init and analyze source with npx depcruise src. Its rules can flag circular dependencies using a to: { circular: true } condition, including at folder scope. Its rules reference notes that a folder-level cycle can exist even when no individual-module cycle does. Configure resolution for the repository; a generic command may not account for TypeScript path mappings, custom resolvers, monorepo boundaries, or generated files. Review unresolved-dependency reporting as well.

Python

pydeps installs with pip install pydeps. Run pydeps <package> --show-cycles to focus on modules participating in cycles; graph rendering requires Graphviz. pydeps discovers imports from bytecode and includes modules it can resolve through Python’s import machinery. Unimported files and unresolved modules may be absent, and --include-missing affects missing-module inclusion.

Java

The JDK’s jdeps analyzes dependencies in class files, directories, and JARs. The cited Oracle manual is for JDK 10; check the documentation for the JDK you use before relying on version-specific options. In that manual, -verbose:package and -verbose:class select package- or class-level dependencies, and --dot-output <dir> writes DOT graph files, including an archive summary. This provides dependency data; it does not by itself decide which architecture rules your application should enforce.

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

Spring applications

Spring Modulith’s verification API includes module-cycle checks. A typical verification call is ApplicationModules.of(Application.class).verify();. Verification also checks other structural rules, including module API and internal-package access, so a failure is not necessarily a cycle. Use detectViolations() when you need to inspect violations programmatically.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

.NET and Visual Studio

Visual Studio dependency-diagram validation checks code against intended layer dependencies; it is not a generic cycle finder for every .NET project. It requires a modeling project and a linked dependency diagram. Microsoft specifies Visual Studio 2019 version 16.2 or later for .NET Core diagrams. The documented live validation supports C# and Visual Basic. Enable full-solution analysis to cover the solution; otherwise live analysis covers edited files only. Validation can be run from the diagram or with MSBuild using /p:ValidateArchitecture=true.

Decide whether a reported cycle matters

A cycle report identifies a structural relationship, not its severity or the correct repair. Inspect the concrete path and ask what the relationship means in context.

  • Check the edges. Confirm each reported dependency in the source, project configuration, or generated output. A barrel or index export can pull unrelated files into an indirect loop.
  • Check the edge type. A type-only reference may not behave like a runtime import. Decide intentionally whether your rule should count it; excluding type-only edges can also make a report less useful for other concerns.
  • Check analysis artifacts. Test-only imports, incorrect aliases, unresolved paths, skipped files, generated sources, or conditional code may change what the analyzer sees. Read its diagnostics before dismissing a finding.
  • Prioritize boundary-crossing loops. Give attention first to cycles between modules that are supposed to be independently reusable, cycles that violate layering, and cycles that interfere with builds or initialization.
  • Assess coordination and ownership costs. A cycle can make changes require coordination across components or blur which component owns behavior, even when it causes no immediate runtime failure.
  • Document acceptable exceptions narrowly. If a relationship is deliberate, record why and scope the exception to the smallest relevant rule. A blanket ignore can hide unrelated regressions.

For Python specifically, module initialization order can make some import cycles fail. Python places a module in sys.modules before executing its code, so a reentrant import can encounter a partially initialized module. The Python 3.12 import reference describes module loading; the Python Programming FAQ explains why a top-level from module import name may fail in a cycle and recommends restructuring where possible.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Break the cycle by changing ownership or direction

There is no universal edge to remove. Follow neighboring dependencies and the intended responsibilities of the modules. A 2023 study of two-class dependency-cycle fixes in 38 open-source projects observed patterns including removing unused or deprecated code, moving behavior to a third class, moving code between the two classes, and shortening call chains. The authors also report unsuccessful untangling cases; these observations are not guarantees for other languages or codebases. See Feng et al., “An Empirical Study of Untangling Patterns of Two-Class Dependency Cycles”.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Move behavior to the module that should own it

If a class or package depends on another only to use a misplaced helper or policy, move that behavior to its proper owner. Shared behavior may belong in a third, cohesive module; alternatively, one existing module may clearly own the policy. Recheck neighboring dependencies after the move: adding a shared module is useful only if it clarifies ownership rather than becoming a new catch-all.

Extract a narrow abstraction at the right boundary

When a high-level component needs a service supplied by a lower-level implementation, define a small contract at the boundary that owns the need. Let both sides depend on that contract, and provide the implementation from the application’s composition root. This reverses a concrete dependency without requiring either side to know the other’s internals. Avoid adding interfaces that have no meaningful boundary; excess indirection creates maintenance work.

Reverse the dependency to protect policy

Make the component that owns the policy define what it needs, then have the implementation satisfy that contract. This is a practical form of dependency inversion: the high-level rule no longer imports a lower-level detail merely to call it. Choose the contract’s owner based on responsibility, not just on which file is easiest to edit.

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

Use a callback or event for a notification relationship

If one component only needs to notify another, a callback or event can remove a direct dependency or decouple timing. This shifts complexity rather than eliminating it: account for delivery, ordering, error handling, and observability. Prefer this approach when notification or temporal decoupling is genuinely part of the design, not as a way to obscure an ordinary direct call.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Shorten the call chain or remove obsolete behavior

Trace what the dependency is used for. If the loop exists only because an intermediate layer forwards a call, a shorter path may remove an edge. If the behavior is unused or deprecated, deleting it may be safer than preserving an unnecessary relationship.

Merge modules only when the boundary is artificial

If two components are one cohesive unit with no useful independent responsibility, merging them can remove a boundary that creates needless coupling. Do not merge unrelated responsibilities just to make a cycle report disappear; larger, less coherent modules make future changes harder to reason about.

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

Handle common false positives and runtime-specific cases

Barrel or index files

A barrel that re-exports many modules can create indirect imports when those modules import back through the barrel. Importing a defining file directly or changing the export structure may remove the loop. Confirm the package or folder graph afterwards; a cleaner file-level report does not automatically resolve a wider architectural cycle.

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

Type-only references and test dependencies

Determine whether the report represents runtime imports, compile-time type references, test-only edges, or a mixture. Configure the rule to match the question you are trying to answer, and retain checks for other edge types where they matter.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Python local imports

Moving an import inside a function can avoid some initialization-order failures by delaying the import until the function runs. The Python FAQ describes this as a possible workaround, but it does not remove the architectural dependency. Use it when delayed loading is deliberate; otherwise, restructure the modules so ownership and import direction are clear.

Runtime loading, reflection, and generated code

Static tools cannot be assumed to see every relationship created through dynamic loading, reflection, conditional compilation, or generated files. Validate the analyzer’s scope and resolution settings against how the application actually runs. A clean static report answers only the graph question the tool was configured to model.

Object-reference and build cycles

For object-reference loops, investigate ownership, object lifetime, and the language’s garbage-collection or reference-counting model. For project or build cycles, use build-system or architecture diagnostics at that level. Neither problem is necessarily fixed by changing source imports.

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

Verify the repair and keep new cycles out

  1. Test affected behavior. Run focused tests for the code moved or redirected, then the broader tests and build checks the project requires.
  2. Repeat the same analysis. Keep the detector, scope, and resolution configuration consistent so the before-and-after results are comparable.
  3. Add an automated boundary rule. In JavaScript or TypeScript, dependency-cruiser can enforce forbidden circular-dependency rules in CI. For other stacks, use the ecosystem’s module or architecture verification appropriate to the graph being protected.
  4. Adopt legacy debt narrowly. If an existing codebase has many findings, record the accepted baseline and fail CI on new cycles. Document exceptions and a path for reducing them rather than disabling enforcement globally.
  5. Review the boundary when architecture changes. A rule is useful only if its allowed dependencies match the design you want to preserve.

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.