Code Graph is a code visualization tool for Visual Studio 2012-2017 and allows one to explore the code conveniently.
NOTE: For Visual Studio 2010, please visit https://marketplace.visualstudio.com/items?itemName=YaobinOuyang.CodeGraph2010
NOTE: For Visual Studio 2019, please visit https://marketplace.visualstudio.com/items?itemName=YaobinOuyang.CodeGraph
It uses doxygen to parse code.
- Visualize call graph
- Visualize class hierarchy
- Visualize class membership
- Visualize variable usage
- Visualize folder structure
- Visualize file include graph
- Visualize project dependencies
- Quick navigation
- Save/Load graph bookmarks
- Write comments on functions/classes/variables
- Python (Not tested yet)
- PHP (PHP extension required)
- Other languages that doxygen supports
Here is a screenshot of the plugin.
A diamond is a class.
A disk is a function.
A triangle is a variable.
Colors for these shapes represent different classes, whose name can be seen at the top-left corner.
A "book mark label" is a code position. In the image, it's line 50 in the file "PatternDetector.h".
A white square is a file.
Colors for edges represent different graphs, whose name and key short-cut can be seen at the bottom-left corner.
Here are main features for Code Graph.
mouse wheel to zoom in and out.
right mouse button to move the view.
Move cursor onto function/class/variable name in Visual Studio Text Editor, then press
Alt+F to show it on Code Graph.
Alt+J/K/L/I in Visual Studio Text Editor to jump to neighbour items.
Find Callers/Callees/Variable Usage/Include Files
Alt+C to find callers / included files / functions using the variable.
Alt+V to find callees / files including this file / used variables.
Some callees may not be found by pressing
Alt+V. In these cases, place the cursor on those callees and press
Alt+H, then they will be added to Code Graph.
Find Overloaded Functions
Alt+O to find overloaded functions.
Find Class Member
Alt+M to find one class variable and the largest member function. Press
Alt+M several times to see more members.
Alt+U to find references. Then move to code position and press
Alt+U again to show the actual function.
Save / Load Relationship Graph
Ctrl+Num to add selected edge to a relationship graph.
Alt+Num to show relationship graph listed at the bottom left corner.
Input your comment for functions/classes/variables in Symbol panel.
Add Custom Edge
Some function call relationship can't be detected because of limited capability of doxygen. In this situation, you can create custom edge to represent missing relationship.
You can connect any item using custom edge.
To create custom edge, use
middle mouse button to drag one item to another.
- Download the vsix package or compile one yourself.
- Open and install the package.
- The package is installed.
- Open Visual Studio, you can see a new menu. Press "Open Code Graph Window" to show the window.
- Open a solution, then press "Analyse solution" to generate the code database for Code Graph.
- A command-line window appears, and you can see "Wait..." on the viewport. You can continue coding during analysis process.
- When analysis is completed, the code database will be opened automatically. Place the cursor on a variable/function/class and press
Alt+F , then the symbol will appear in the viewport.
- Next time when you open Visual Studio, you don't have to analyse the solution again, just click "Open Analysis Result" and choose a ".graph" file. The file with a "solution" postfix is the analysis result (code database) for the whole solution.
- Analyse opened files
- Improve filelist
- Add "sync with editor" mode
- Improve code navigation
- Save layout options
- Fix a bug
- Show all bookmarks
- Improve custom edge creation
- Add custom database folder
- Refine UI
- Show project dependencies
- Add toolbar
- Refine find reference
- Support typedef
- Fix some bugs
- Add custom macro
- Change bookmark color
- Add advanced mode
- Add anchor
- Fix some bugs
- Add buttons for bookmark display
- Fix some bugs
- Layout code position in order
- Save layout results
- Layout in order
- Fix crash bug
- Add force layout
- Adjust UI
- Refine "find reference"
- Add manual layout mode
- Support VS2017
- Add "find reference" and move "find usages" to "find callers" and "find callees"
- Add "contact me" tab
- Add symbol search in viewport
- Adjust appearance
- Improve searching function.
- Some UI improvements.
- Add multiple selection.
- Add file and directory search.
- Add interactive custom edge mode.
- Add custom file extension support.
- Add horizontal/vertical UI layout.
- Fix some bugs.