Git Product home page Git Product logo

codegraph's Introduction

CodeGraph - static code analyzator, that create a diagram with your code structure.

badge1 badge2 badge3workflow

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.

Install codegraph

  
    pip install codegraph

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:

codegraph /Users/myuser/codegraph/codegraph

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.

Colors meanings

In default view - red line show dependencies between entities in different modules. Green - links between objects/functions inside same module.

Graph visualisation

 Code with not used module

Code there all modules linked together

TODO

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

Changelog

v0.1.0

Improvements

  1. Command line tool name changed from 'cg' to 'codegraph'.
  2. Updated versions of dependencies
  3. Minimal supported python version up to 3.8
  4. Added some unit & functional tests

codegraph's People

Contributors

xnuinside avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.