codeviz | Visual code dependency graph creation for C/C++ projects
kandi X-RAY | codeviz Summary
kandi X-RAY | codeviz Summary
Visualize code dependencies between files in your C/C++ projects. CodeViz is a simple, cross-platform, python3 script that creates a code dependency graph using source and header files. It works by first creating a dot file. The dot file is then then passed into graphviz, which is a supporting program that will automagically create a map of your code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse command line arguments
- Get all the files in the current working directory
- Print a string if verbose = True
- Create a graphviz dot file
- Create a graphic
- Run a bash command
- Build a list of Node objects from files
- Returns a list of highlighted files
- Find the edges of the given nodes
- Find a node in a list of nodes
codeviz Key Features
codeviz Examples and Code Snippets
Community Discussions
Trending Discussions on codeviz
QUESTION
Consider Chromium
codebase. It's huge, around 4gb of pure code, if I'm not mistaken. But however humongous it may be, it's still modular in its nature. And it implements a lot of interesting features in its internals.
What I mean is for example I'd like to extract websocket
implementation out of the sources, but it's not easy to do by hand. Ok, if we go to https://github.com/chromium/chromium/tree/main/net/websockets we'll see lots of header files. To compile the code as a "library" we're gonna need them + their implementation in .cpp
files . But the trick is that these header files include
other header files in other directories of the chromium
project. And those in their turn include
others...
BUT if there are no circular dependencies we should be able to get to the root of this tree, where header files won't include
anything (or will include
already compiled libraries), which should mean that all the needed files for this dependency subtree are in place, so we can compile a chunk of the original codebase separate from the rest of it.
That's the idea. At least in theory.
Does anyone know how it could be done? I've found this repo and this repo, but they only show the dependency graph and do not have the functionality to extract a tree from it.
There should be a tool already, I suppose. It's just hard to word it out to google. Or perhaps I'm mistaken and this approach wouldn't really work?
...ANSWER
Answered 2022-Mar-09 at 03:51Your compiler is almost surely capable of extracting this dependency information so that it can be used to help the build system figure out incremental builds. In gcc
, for instance, we have the -MMD
flag.
Suppose we have four compilation units, ball.cpp
, football.cpp
, basketball.cpp
, and hockey.cpp
. Each source file includes a header file of the same name. Also, football.hpp
and basketball.hpp
each include ball.hpp
.
If we run
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install codeviz
Arch Linux (AUR)
Fedora
FreeBSD
Mac
Ubuntu/Debian
Windows
Solaris
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page