Code Monkey home page Code Monkey logo

codemapextractor's Introduction

CodeMapExtractor

About

CodeMapExtractor is a simple tool to extract graph from dgml file. dgml is the file extension of CodeMap generated by Visual Studio which is a special kind of XML. CodeMapExtractor is capable of extracting function call graph beyond classes and namespace provided that a correct dgml file is given.

For Further Development

CodeMapExtractor stores the call graph of whole project as a adjacency matrix and a networkx object. You can do any experiment on the adjacency matrix. networkx is rich in graph algorithm, most of the famous graph algorithm like BFS, DFS, Floyd-Warshall, Dijkstra etc algorithm can be invoked with a single line change.

How to Generate dgml file

Step 1: Open a Visual Studio project

Step 2: Right Click on the Project Name on the Solution Explorer

Step 3: Click on '''Show on CodeMap'''

Step 4: After any graphical object with project name is visible, expand all the nodes recursively by clicking on the expand icon of each graphical unit

Step 5: When all the graphical nodes are expanded, Press Ctrl+S or Save using file menu. It will take you to file save dialog where you will see the file to be saved is a dgml file. Save it and feed it to the python script

For Further Experiment

The ADJ_MATRIX variable of CodeMapExtractor class hold the adjacency matrix of the given dgml file

The G variable of CodeMapExtractor class is a graph of all function calls available in the dgml file. G is a networkx.DiGraph object. Most common graph algorithm can be directly called upon it. For example, to get the callee graph I have run depth first search with limit on G.

To extend the work with networkx

Visit networkx documentation :octocat:

Some Graphs generated by CodeMapExtractor on Aletheia Project

Caller Graph

Callee Graph

Call Graph

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.