Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeremy-rifkin/cpp-dependency-analyzer
A static-analysis tool for dependencies within a C/C++ codebase.
https://github.com/jeremy-rifkin/cpp-dependency-analyzer
Last synced: 3 months ago
JSON representation
A static-analysis tool for dependencies within a C/C++ codebase.
- Host: GitHub
- URL: https://github.com/jeremy-rifkin/cpp-dependency-analyzer
- Owner: jeremy-rifkin
- License: mit
- Created: 2020-11-10T04:16:13.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T04:38:22.000Z (9 months ago)
- Last Synced: 2024-04-19T14:11:02.988Z (9 months ago)
- Language: Python
- Homepage:
- Size: 1.34 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This project is now mostly folded into https://github.com/jeremy-rifkin/build-blame
---
This is a small static analysis project to analyze dependency graphs in C/C++ programs. Based off of
a main file in a codebase, this tool will automatically parse, resolve, and traverse includes in
order to build up a dependency graph. That graph is displayed as an adjacency matrix. The transitive
closure of the graph is also displayed reflecting the indirect dependencies between parts of a
codebase. One application of this tool is for analyzing technical debt within a codebase.![](screenshots/matrix.png)
![](screenshots/direct_deps.png)
![](screenshots/indirect_deps.png)
Nodes are colored based on how many translation units (.c or .cpp files) transitively include a given header.
Usage:
```
python3 main.py --compile-commands COMPILE_COMMANDS [--exclude EXCLUDE] [--sentinel SENTINEL]
```By default the script will transitively walk all include headers it can resolve, either based on local resolution rules
or paths specified with `-I` flags in compile_commands.json. If you want to see the includes for an unresolved library
include, e.g. `fmt/format.h`, pass `--sentinel fmt/format.h`.