CodeGraph – static code analyzator, that create a diagram with your code structure.
Tool that create a digram with your code structure to show dependencies between code entities (methods, modules, classes and etc).
Main advantage of CodeGraph, that is does not execute the code itself. You not need to activate any environments or install dependencies to analyse the target code.
It is based only on lex and syntax parse, so it not need to install all your code dependencies.
Analyze your code
codegraph – name of command line tool for CodeGrapg
codegraph /path/to/your_python_code # path must be absolute # or for one file codegraph /path/to/your_python_code
your_python_code – module with your python code
For example, if I put codegraph in my user home directory path will be:
Pass ‘-o’ flag if you want only print dependencies in console and don’t want graph visualisation
codegraph /path/to/your_python_code -o
If you want to change view and play with graph output – you can check ‘vizualyzer.py’
and play with matplotlib and networkX settings.
In default view – red line show dependencies between entities in different modules.
Green – links between objects/functions inside same module.
1. Create normal readme
2. Add tests
3. Work on visual part of Graph (now it is not very user friendly)
4. Add support to variables (names) as entities
5. Split usage & inheritance as a different cases
- Command line tool name changed from ‘cg’ to ‘codegraph’.
- Updated versions of dependencies
- Minimal supported python version up to 3.8
- Added some unit & functional tests