A command-line tool that analyzes C++ #include dependencies and generates dependency graphs in .dot format for visualization.
cpp-dependencies is a command-line tool that analyzes C++ source code to extract `#include` dependency information and generate visual dependency graphs. It helps developers understand, visualize, and manage dependencies between components in large C++ projects, identifying issues like circular dependencies that can impact build times and code maintainability.
C++ developers, software architects, and build engineers working on medium to large codebases who need to understand and optimize dependency structures.
It provides fast, practical dependency analysis without requiring full C++ parsing, making it suitable for interactive use on large projects. The GraphViz integration offers clear visualizations, and features like cycle detection and path analysis help pinpoint dependency issues efficiently.
Tool to check C++ #include dependencies (dependency graphs created in .dot format)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses optimized strstr scanning instead of full parsing, enabling analysis of a 1.5GB codebase in about 2.1 seconds, making it practical for large projects.
Generates .dot files compatible with GraphViz, allowing clear visual graphs of dependencies, which helps in identifying cycles and structural issues.
Identifies circular dependencies and finds shortest paths between components, aiding in debugging and refactoring efforts as shown in the example.
Can regenerate CMakeLists.txt files to reflect dependency changes, streamlining build system updates after refactoring.
Relies on string scanning rather than full C++ parsing, which can miss complex include patterns or macro expansions, as admitted in the rationale for performance trade-offs.
Requires GraphViz for visualization, adding an external tool dependency that might not be installed, and large graphs can take hours to render.
Specifically designed for C++ projects using #include directives, so it cannot analyze dependencies in other languages or with C++20 modules.