PricingDownload
Product

Platform

All features44 capabilities, from IDE to CICompliance KitsISO 26262, DO-178C, IEC 62304...AI GovernanceControl AI-generated C/C++ codeWhat’s new in 2027Latest version highlightsScreenshotsSee the product in action

Analyze & improve

Coding standardsMISRA, CERT, CWE, AUTOSARArchitecture & dependenciesGraphs, matrix, cyclesTechnical debtMeasured in hours and dollarsQuality gatesStop regressions in CISmart Code CityYour codebase in 3D

Integrations

IDE pluginsVisual Studio, VS Code, CLion...CI/CD pipelinesJenkins, Azure DevOps, GitHub, GitLabSonarQube pluginC/C++ results in SonarQubeExternal analyzersClang-Tidy, Cppcheck, coverageFeature on Demand
Solutions

By need

Functional safetyCompliance kits per standardCoding standardsMISRA, CERT, AUTOSAR, ISO...Legacy modernizationRefactor large C/C++ safelyCode auditExpert review of your codebaseM&A due diligenceAssess technical health fast

By role

DevelopersSoftware architectsTech leadsDevOps engineersEngineering managersProject managers

CTOsCIOs / IT leadersQA engineersSecurity leadersComplianceConsultantsRequest a guided PoC
Industries

Safety-critical

AutomotiveISO 26262, MISRA, AUTOSARAerospace & DefenseDO-178C programsMedical DevicesIEC 62304 softwareEnergy & UtilitiesIEC 61508 systemsEmbedded SystemsFirmware and devices

Enterprise

Financial ServicesTrading and paymentsGame DevelopmentEngines and large C++Software VendorsCommercial C/C++ productsGovernmentAgencies and contractorsAll industries & case studies
Resources

Learn

DocumentationGuides, rules and CI setupKnowledge baseFrequently asked questionsBlogC and C++ code quality articlesRelease notesEvery version since 2009

Customers

Case studiesSuccess storiesTestimonialsWhat users sayOur customersCompanies using CppDependGold Code QualityOpen source projects we rate

Programs & company

Feature on DemandMissing features built for freeFree for open sourceLicenses for OSS and studentsContact usSales and supportEULALicense agreement
Docs
Documentation

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.

10 min readUser GuidesCppDepend 2027

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.

Call Graph of Cppcheck at project level
The first view: projects and third-party code.

Reading a box

A node: SymbolDatabase with its metrics and four buttons
The SymbolDatabase type of Cppcheck.
PartMeaning
HeaderThe parent of the element (here the project cppcheck; for a method, its project and type separated by ›).
Name and iconThe element and its kind: project, namespace, type, method, field.
LOC / DebtLines of code and technical debt (here 3,216 lines and 64 days).
MIMaintainability index, colored green, amber or red.
RatingDebt rating from A (best) to E (worst).
Four buttonsSee The four buttons of a box.
▸ Add N usedShown under some boxes: adds to the graph the N elements this one uses. See Add used.

Opening the Call Graph

FromHow
Menu barDesign & Architecture › Call Graph.
Features panelDesign & Architecture › Call Graph.
Any element (treemap, matrix, query result...)Right-click › Show on Dependency Graph, or Append it to Graph.
Code QuestExport › Export to graph. See Draw a query result.
Dependency MatrixExport 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.

Call Graph screen with numbered callouts
The Call Graph screen, numbered.
#ControlTooltipWhat it does
1SaveSave graphAsks for a name and stores the current graph. See Save and reopen.
2OpenOpen graphLists the saved graphs and reopens one.
3Zoom inZoom InEnlarges the drawing. The mouse wheel zooms too.
4Zoom outZoom OutShrinks the drawing.
5Reset zoomReset ZoomFits the graph back to its default size.
6BackGo BackEvery change of the graph is recorded. Returns to the previous graph, as in a browser.
7ForwardGo ForwardGoes forward again after Back.
8Third partyShow/Hide Third Party ElementsOn (highlighted, default): third-party elements are drawn. Off: only your code.
9DependenciesShow/Hide Dependencies GridsOpens the Dependencies panel on the right. See Dependencies panel.
10MetricsShow/Hide MetricsOn (default): LOC, Debt, MI and Rating in each box. Off: name only, lighter graph.
11CompactCompact graph (easy to explore in case of many nodes)Groups the elements inside their parent box. See Large graphs.
12InternalsShow the internal dependencies of the current graphAdds the links between the elements already displayed. When there is none, it says "No internal dependencies found".
13Design issues (triangle + counter)Design issuesOpens the issues grid under the graph. The number is the count for the current graph. See Design issues.
14MatrixExport to Dependency MatrixOpens the same elements in the Dependency Matrix.
15CameraExport to a png imageSaves the graph as a PNG image.
16LegendColor legend explaining the meaning of each dependency color in the graph.Opens the color legend. See Colors.
17BulbTipsOpens the tips window.
18Search boxFinds a code element and puts it in the graph. See Search.
19Graph areaThe boxes and arrows. Scroll bars appear when the graph is larger than the window.
20Status lineThe 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:

Dependency Graph Color Legend window
The color legend.
ColorMeaning
OrangeSelected node.
Light orangeHovered node (under the mouse).
Green / light greenUsed by the selected node, directly / indirectly.
Teal / light blueUsing the selected node, directly / indirectly.
Red / light redPart 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.

Tokenizer and SymbolDatabase in a cycle
Tokenizer and SymbolDatabase use each other.

The four buttons of a box

ButtonTooltipResult
Two arrowsUse/Used ByReplaces the graph with this element, what it uses and what uses it.
Right arrowUseKeeps this element and what it uses.
Left arrowUsed ByKeeps this element and what uses it.
EyeInsightOpens 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.

Types that use SymbolDatabase
Used By on SymbolDatabase.
GestureEffect
Click a boxSelects it: colors the related boxes and fills the Dependencies panel.
Hover a boxColors its direct and indirect relations, without selecting it.
Double-click a boxDrills down: shows the inside of the element (the namespaces of a project, the types of a namespace...). Back returns.
Ctrl + click several boxesShows only those elements with their dependencies.
Alt + click several boxesShows only those elements, without their dependencies: just the links among them.
Mouse wheelZoom.
Right-click a boxContext 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.

Namespaces of the cppcheck project after a double-click
Drill-down into the cppcheck project.

The bulb button (17) recalls these gestures:

Dependency Graph Tips window
The tips window.
Right-click menu of a box
The right-click menu of a box.
ItemWhat it does
Show on Code InsightOpens the element in Code Insight.
Review Diff since BaselineOpens 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 IDEOpens the source code.
Keep only what used and using meSame as the Use/Used By button.
Keep only what I useSame as the Use button.
Keep only what using meSame as the Used By button.
Show on Dependency MatrixOpens 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...).

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.

Search panel with SymbolDatabase
Searching SymbolDatabase with Exact name on.
OptionEffect
Element TypeAll, or only projects, namespaces, types, methods, fields.
Search ByName, or another criterion.
Match caseCase-sensitive search.
Third partyAlso search third-party code.
Exact nameOnly the exact name (60 results become 2 here).
Simple Name / Name / Full NameWhich 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.

Dependencies panel of SymbolDatabase
The Dependencies panel of SymbolDatabase.
PartUse
Quick ActionsUse/Used By, Use, Used By and Insight, as on the box.
Indirection LevelHow far to follow: level 1 is direct, level 2 goes through one intermediate element, up to level 20.
What I useElements the selection depends on, grouped by project and namespace, with their level (here 81 elements up to level 3).
What is using meElements that depend on the selection (61 here).
Shortest PathSelect 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.

Shortest path between SymbolDatabase and Tokenizer
Shortest Path from SymbolDatabase to Tokenizer.

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.

Graph after Add 97 used, in compact view
After Add 97 used on CppCheck.

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.

Design issues grid
27 design issues among the namespaces of cppcheck.

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.

IssueConditionRecommendation
Over-coupled componentCe above the limit and high betweennessSplit responsibilities and reduce outgoing dependencies.
Low cohesionLCOM above 0.80Separate unrelated responsibilities.
Highly unstableInstability above 0.8 and Ce above the limitReduce outgoing dependencies, introduce abstractions.
Highly rigidHigh Ca and instability below 0.2Introduce interfaces or abstraction layers.
Hub componentCe above the limit, high Ca and high PageRankRefactor into smaller, cohesive components.
Critical nodeHigh betweenness or high PageRankConsider redundancy or decoupling.
Bottleneck nodeHigh betweenness, PageRank not highReduce dependency concentration.
High change ripple riskHigh Ca and Ca above 5Stabilize its API and minimize outward impact.
Part of a cyclic dependencyIn a group of more than one element that use each otherBreak 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.

Compact mode warning band
The band shown above 100 nodes.

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.

Compact view: methods grouped by type
Compact view.

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.

Graph with metrics hidden
Metrics hidden: only the names remain.

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.

  1. 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.
  2. Click Export › Export to graph.
Export to graph menu
Export › Export to graph.
The 23 most complex methods as a graph
The 23 methods in the Call 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.

No internal dependencies found message
Show internals when the elements are not linked.

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.

Save graph dialog
Save graph: enter a name and click Ok.

To share a view instead, use the camera button (15) for a PNG image.

Recipes

QuestionHow
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 codeTurn 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 bigCompact mode, hide metrics, or switch to the Dependency Matrix (14).
Keep a view for laterSave graph, then Open graph.

Related pages

Was this page helpful?
Evaluating CppDepend on a production codebase?Get a guided proof of concept with our static analysis architects.
Request a PoC