User Guides
Call Graph
The Call Graph draws the dependencies of your code as boxes and arrows: each box is a code element, each arrow means "uses". You start from the projects, open what interests you, keep only what an element uses or what uses it, follow paths and review design issues. This page explains every control of the screen with screenshots of a real analysis of Cppcheck 2.22.
What the graph shows
When it opens, the graph shows the projects of the solution and the third-party code they use. For Cppcheck: the front end cli uses the library cppcheck, and both use Windows SDK and Externals (the standard library and other headers). Each box gives the quality of the element at a glance.

Reading a box

SymbolDatabase type of Cppcheck.| Part | Meaning |
|---|---|
| Header | The parent of the element (here the project cppcheck; for a method, its project and type separated by ›). |
| Name and icon | The element and its kind: project, namespace, type, method, field. |
| LOC / Debt | Lines of code and technical debt (here 3,216 lines and 64 days). |
| MI | Maintainability index, colored green, amber or red. |
| Rating | Debt rating from A (best) to E (worst). |
| Four buttons | See The four buttons of a box. |
| ▸ Add N used | Shown under some boxes: adds to the graph the N elements this one uses. See Add used. |
Opening the Call Graph
| From | How |
|---|---|
| Menu bar | Design & Architecture › Call Graph. |
| Features panel | Design & Architecture › Call Graph. |
| Any element (treemap, matrix, query result...) | Right-click › Show on Dependency Graph, or Append it to Graph. |
| Code Quest | Export › Export to graph. See Draw a query result. |
| Dependency Matrix | Export to Graph menu. |
The screen at a glance
Controls 1 to 17 form the toolbar, 18 to 20 are the other parts of the screen. The tooltip column quotes the text shown when you hover the control.

| # | Control | Tooltip | What it does |
|---|---|---|---|
| 1 | Save | Save graph | Asks for a name and stores the current graph. See Save and reopen. |
| 2 | Open | Open graph | Lists the saved graphs and reopens one. |
| 3 | Zoom in | Zoom In | Enlarges the drawing. The mouse wheel zooms too. |
| 4 | Zoom out | Zoom Out | Shrinks the drawing. |
| 5 | Reset zoom | Reset Zoom | Fits the graph back to its default size. |
| 6 | Back | Go Back | Every change of the graph is recorded. Returns to the previous graph, as in a browser. |
| 7 | Forward | Go Forward | Goes forward again after Back. |
| 8 | Third party | Show/Hide Third Party Elements | On (highlighted, default): third-party elements are drawn. Off: only your code. |
| 9 | Dependencies | Show/Hide Dependencies Grids | Opens the Dependencies panel on the right. See Dependencies panel. |
| 10 | Metrics | Show/Hide Metrics | On (default): LOC, Debt, MI and Rating in each box. Off: name only, lighter graph. |
| 11 | Compact | Compact graph (easy to explore in case of many nodes) | Groups the elements inside their parent box. See Large graphs. |
| 12 | Internals | Show the internal dependencies of the current graph | Adds the links between the elements already displayed. When there is none, it says "No internal dependencies found". |
| 13 | Design issues (triangle + counter) | Design issues | Opens the issues grid under the graph. The number is the count for the current graph. See Design issues. |
| 14 | Matrix | Export to Dependency Matrix | Opens the same elements in the Dependency Matrix. |
| 15 | Camera | Export to a png image | Saves the graph as a PNG image. |
| 16 | Legend | Color legend explaining the meaning of each dependency color in the graph. | Opens the color legend. See Colors. |
| 17 | Bulb | Tips | Opens the tips window. |
| 18 | Search box | Finds a code element and puts it in the graph. See Search. | |
| 19 | Graph area | The boxes and arrows. Scroll bars appear when the graph is larger than the window. | |
| 20 | Status line | The full path of the selected element: project, namespace, type, method. |
Colors: how boxes relate to the selection
Click a box to select it, or just hover it: the other boxes take a color that tells how they relate to it. The legend button (16) opens this window:

| Color | Meaning |
|---|---|
| Orange | Selected node. |
| Light orange | Hovered node (under the mouse). |
| Green / light green | Used by the selected node, directly / indirectly. |
| Teal / light blue | Using the selected node, directly / indirectly. |
| Red / light red | Part of a direct / indirect dependency cycle with the selected node. |
Example: hovering Tokenizer while SymbolDatabase is selected colors both in red, because each uses the other: a direct cycle.

The four buttons of a box
| Button | Tooltip | Result |
|---|---|---|
| Two arrows | Use/Used By | Replaces the graph with this element, what it uses and what uses it. |
| Right arrow | Use | Keeps this element and what it uses. |
| Left arrow | Used By | Keeps this element and what uses it. |
| Eye | Insight | Opens the element in Code Insight. |
Example: Used By on SymbolDatabase draws every type of Cppcheck that depends on it: the checkers (CppCheck, CheckAutoVariables, CheckVaarg...), ValueFlowPassRunner, InvalidContainerAnalyzer and more.

Exploring with the mouse and keyboard
| Gesture | Effect |
|---|---|
| Click a box | Selects it: colors the related boxes and fills the Dependencies panel. |
| Hover a box | Colors its direct and indirect relations, without selecting it. |
| Double-click a box | Drills down: shows the inside of the element (the namespaces of a project, the types of a namespace...). Back returns. |
| Ctrl + click several boxes | Shows only those elements with their dependencies. |
| Alt + click several boxes | Shows only those elements, without their dependencies: just the links among them. |
| Mouse wheel | Zoom. |
| Right-click a box | Context menu (next section). |
Double-clicking the cppcheck project shows its namespaces: the global namespace in the middle, and the many anonymous namespaces of its source files around it.

The bulb button (17) recalls these gestures:

Right-click menu

| Item | What it does |
|---|---|
| Show on Code Insight | Opens the element in Code Insight. |
| Review Diff since Baseline | Opens the old and new source side by side (needs a baseline and a compare tool; see Compare Builds). |
| Open source in CppDepend / Open Source in IDE | Opens the source code. |
| Keep only what used and using me | Same as the Use/Used By button. |
| Keep only what I use | Same as the Use button. |
| Keep only what using me | Same as the Used By button. |
| Show on Dependency Matrix | Opens the element in the matrix. |
| Select Issues / Projects / Modules / Namespaces / Types / Methods / Fields › | Lists related elements or issues in Code Quest (direct or indirect users and used elements, issues added or fixed since the baseline...). |
Search
Type a name in the search box (18) at the top right. A panel lists the matching elements. Double-click an element to see it in the call graph.

| Option | Effect |
|---|---|
| Element Type | All, or only projects, namespaces, types, methods, fields. |
| Search By | Name, or another criterion. |
| Match case | Case-sensitive search. |
| Third party | Also search third-party code. |
| Exact name | Only the exact name (60 results become 2 here). |
| Simple Name / Name / Full Name | Which form of the name is compared (for a method: with or without parameters, with or without the parent path). |
The result grid has the usual Group By, Export and Scope tools.
Dependencies panel
Turn on the Dependencies button (9) and click a box: the panel on the right shows what the element uses and what uses it.

| Part | Use |
|---|---|
| Quick Actions | Use/Used By, Use, Used By and Insight, as on the box. |
| Indirection Level | How far to follow: level 1 is direct, level 2 goes through one intermediate element, up to level 20. |
| What I use | Elements the selection depends on, grouped by project and namespace, with their level (here 81 elements up to level 3). |
| What is using me | Elements that depend on the selection (61 here). |
| Shortest Path | Select an element in one of the two lists, then click: the graph shows the shortest chain between the two. |
Example: Tokenizer selected in "What I use", then Shortest Path: the graph is reduced to SymbolDatabase and Tokenizer, which use each other directly.

Add used
The ▸ Add N used link under a box adds the N elements it uses, without removing the rest. On CppCheck it adds 97 elements; the graph then goes over 100 nodes and switches to the compact view.

Design issues
Click the triangle (13). The grid under the graph lists architectural problems among the elements displayed, with a description and a recommendation. Double-click a row to select the element. In the namespaces of Cppcheck it finds 27 issues, for example a global namespace with a high change ripple risk (Ca=32) and many anonymous namespaces caught in a dependency cycle of size 26.

The issues are computed on the current graph with graph metrics: Ca (who uses me), Ce (whom I use), Instability = Ce / (Ca + Ce), Betweenness and PageRank. "High" means in the top 10% of the elements of the graph. Third-party elements are ignored.
| Issue | Condition | Recommendation |
|---|---|---|
| Over-coupled component | Ce above the limit and high betweenness | Split responsibilities and reduce outgoing dependencies. |
| Low cohesion | LCOM above 0.80 | Separate unrelated responsibilities. |
| Highly unstable | Instability above 0.8 and Ce above the limit | Reduce outgoing dependencies, introduce abstractions. |
| Highly rigid | High Ca and instability below 0.2 | Introduce interfaces or abstraction layers. |
| Hub component | Ce above the limit, high Ca and high PageRank | Refactor into smaller, cohesive components. |
| Critical node | High betweenness or high PageRank | Consider redundancy or decoupling. |
| Bottleneck node | High betweenness, PageRank not high | Reduce dependency concentration. |
| High change ripple risk | High Ca and Ca above 5 | Stabilize its API and minimize outward impact. |
| Part of a cyclic dependency | In a group of more than one element that use each other | Break circular dependencies to improve modularity. |
The Ce limit depends on the kind of element: project 10, namespace 20, type 15, method 10. Because the metrics depend on what is displayed, review a graph that matches the level you care about.
Large graphs
When the graph has more than 100 nodes, a band appears: "The graph node count exceeds the compact mode limit (100 nodes). Automatically switching to compact view." The Settings link in the band changes this limit and the node limit above which the graph is not drawn.

In compact view, the elements are listed inside the box of their parent, with two numbers per line: how many elements it uses and how many use it. You can also turn on the Compact button (11) yourself. Example: the 23 most complex methods of Cppcheck, grouped by type.

Other ways to keep the graph readable: hide third-party elements (8), hide metrics (10), and use Used By, Use, double-click or Ctrl/Alt selection.

Draw a query result
Any CQLinq result can be drawn as a graph. Example: the methods of your code with a cyclomatic complexity above 150.
- In Code Quest, run
from m in JustMyCode.Methods where m.CyclomaticComplexity > 150 orderby m.CyclomaticComplexity descending select new { m, m.CyclomaticComplexity, m.NbLinesOfCode }. Cppcheck has 23. - Click Export › Export to graph.


Then use Internals (12) to see if they call each other. Here they do not: CppDepend answers "No internal dependencies found". Only checkFunctionVariableUsage calls checkFunctionVariableUsage_iterateScopes, which is visible above because both are in the result.

Save and reopen a graph
Save graph (1) asks for a name and stores the graph in your settings: its elements and how it was built. Open graph (2) lists the saved graphs under Available Graphs; pick one to draw it again, even after a new analysis.

To share a view instead, use the camera button (15) for a PNG image.
Recipes
| Question | How |
|---|---|
| Who depends on this type? | Search it, double-click it in the results, then Used By. |
| Why does A reach B? | Select A, open the Dependencies panel, pick B in What I use, click Shortest Path. |
| Where are the cycles? | Hover or select elements and look for red boxes; open Design issues for "Part of a cyclic dependency". |
| Focus on my own code | Turn off third-party elements (8). |
| Do these methods call each other? | Export the query result to graph, then Internals, or Alt-click them. |
| The graph is too big | Compact mode, hide metrics, or switch to the Dependency Matrix (14). |
| Keep a view for later | Save graph, then Open graph. |
Related pages
- Dependency Matrix (DSM): the same dependencies as a table, for large code bases.
- Code Map (Treemap): size and quality of the elements.
- Compare Builds.
Thanks for your feedback. Tell us more or request a feature.
