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

Compare Builds

Compare Builds puts two analysis results side by side: an older one, the baseline, and a newer one, the current build. Every metric then shows what changed, and you can list the code and the issues that were added, changed, removed or fixed. This page walks through a real comparison of Cppcheck 2.15 (baseline) with Cppcheck 2.22 (current build).

8 min readUser GuidesCppDepend 2027

When to use it

  • Review what a release changed before you ship it: new code, new issues, debt added.
  • Check that a refactoring paid off: fewer issues, less debt, better maintainability.
  • Compare two branches, two products or two versions of a third-party library.

You need one analysis of each build. Here the two Cppcheck versions were analyzed as two projects, cppcheck-2.15 and cppcheck-2.22 (see Analyze your first project).

Opening Compare Builds

FromHow
Menu barProject › Compare Builds.
Start PageThe Compare Builds card ("Compare results of two analysis").
Project menu with Compare Builds
Project › Compare Builds.

The Compare Analyses dialog

The dialog asks you to select two analyses to compare: the baseline on the left, the current build on the right. Both panels work the same way.

Compare Analyses dialog with numbered callouts
The Compare Analyses dialog, filled in for Cppcheck 2.15 against 2.22.
#ControlWhat it does
1LanguageThe language of the analyses: C/C++.
2Baseline Build panelThe older analysis, the reference the changes are measured from.
3Project NamePicks the baseline project among the projects you analyzed (here cppcheck-2.15).
4Browse (...)Opens a project file (.cdproj) that is not in the list.
5Specific project analysisUses one of the analysis results stored for that project.
6Analysis result listThe results of the project, by date (for example CppDependAnalysisResult_cppcheck_2_15_2026Nov28_12h13.cdar).
7The Particular Result FileUses any analysis result file instead, for example one received from a colleague or from CI.
8Result file pathThe path of that .cdar file.
9Browse (...)Picks the .cdar file on disk.
10Current Build panelThe newer analysis, with the same controls (here cppcheck-2.22).
11CompareLoads both results and opens the comparison.
12CancelCloses the dialog without comparing.

Step by step

  1. The dialog opens with the loaded project on both sides. In Baseline Build, keep or choose the older project.
  2. In Current Build, open the Project Name list and choose the newer project.
    Project Name list
    The projects you analyzed are listed.
  3. Check the analysis result under Specific project analysis; the most recent one is selected.
    Analysis result list
    Each analysis of the project is a .cdar file named after the project and the date.
  4. Click Compare. CppDepend loads both code models (about a minute and a half for Cppcheck) and opens the Quality Dashboard of the current build.

Reading the comparison on the dashboard

The Quality Dashboard now shows the current build, with the baseline in Baseline project info, and a small badge next to every number with its change since the baseline.

Quality Dashboard comparing 2.22 to 2.15
Cppcheck 2.22 compared with 2.15.
#AreaWhat it shows (2.15 → 2.22)
1Project Info / Baseline project infoThe current build (cppcheck-2.22) and the baseline (cppcheck-2.15), with their analysis dates and CppDepend version.
2Choose BaselineShortcuts to compare with an older analysis of the same project instead. See Making the baseline permanent.
3Code DiffOpens the list of what changed. See Code Diff.
4Size badges69,282 lines of code, +8,267; 4,858 methods, +537; 460 types, +78; 1,705 fields, +193; 46 namespaces, −11.
5Debt badgeDebt 1,209 days, +362 days, shown in red because it got worse.
6Issue badgesTwo badges per line: red ↑ issues added since the baseline, green ↓ issues fixed. All issues: +30,611 new, −12,843 fixed.
7Top barThe issue count and the failed, warned and passed quality gates of the current build, with the baseline applied.

Scroll down for the Issues and Quality Gates tiles:

Issues and Quality Gates tiles with changes
Issues by severity with new and fixed counts, and quality gates (6 fail, one more than without baseline).
SeverityIssues in 2.22NewFixed
Critical834
High24,40116,7644,087
Medium25,63511,6648,745
Low2,1942,1807

Why there are more issues with a baseline

Some rules only make sense against a baseline: they check the code that was added or changed, for example From now, all methods added should respect basic quality principles. Without a baseline they report nothing; with one, they report every new method that breaks them. That is why Cppcheck 2.22 shows 38,311 issues on its own and 52,238 once compared with 2.15, and why one more quality gate fails.

Click a badge to list the issues

Click the red ↑ 30,611 badge: Code Quest opens a generated query, All issues added since baseline, built on i.WasAdded(), with the 30,611 issues grouped by project, namespace, type and method. The green badge does the same for fixed issues.

Generated query listing the issues added since the baseline
The issues added since the baseline, in Code Quest.

Code Diff: what changed

Click Code Diff on the dashboard. The page recalls both analyses at the top (Current Analysis and Baseline) and lists the changes in a tree on the left.

Code Diff page
Code Diff, Cppcheck 2.15 → 2.22: 157 types changed.
GroupEntries (Cppcheck 2.15 → 2.22)
Code Element157 Changed Types, 113 Added Types, 35 Removed Types, 401 Changed Methods, 1,716 Added Methods, 1,193 Removed Methods.
New Issues0 Blocker, 3 Critical, 16,764 High, 11,664 Medium, 2,180 Low.
Fixed Issues0 Blocker, 4 Critical, 4,087 High, 8,745 Medium, 7 Low.

Click an entry to fill the grid on the right. The grid has the same tools as everywhere in CppDepend: Group By project, namespace or type, Export (graph, matrix, treemap, HTML, Excel, XML, text), Scope, sortable columns and paging.

Added methods
1,716 Added Methods, grouped by type, with their lines of code.

Start with the new critical issues

3 New Critical Issues is the shortest list and the most important one. In Cppcheck 2.22 they are two CWE-476 NULL Pointer Dereference issues, in tinyxml2::XMLUtil::GetCharacterRef and in simplecpp::preprocess, and one CWE-134 Use of Externally-Controlled Format String in printCallstack of the cli project. Each line gives the debt, the annual interest and the breaking point.

New critical issues
The 3 critical issues introduced between 2.15 and 2.22.

Acting on a changed element

Right-click any element of the grid for the usual actions (Prompt Builder, Show on Code Insight, Show on Dependency Graph, Select...). Review Diff since Baseline opens the old and the new version of the source file side by side, in the file comparison tool of your choice.

Set up the side-by-side diff

Until a comparison tool is set, Review Diff since Baseline only shows this message:

Message when no compare tool is set
"Cannot diff source! ... Empty executable path."
  1. Open Settings › Editor Tools and scroll to Source Files Compare Tool.
  2. In Executable file name, enter the full path of the tool, or pick it with the folder button. Environment variables such as %LOCALAPPDATA% are not expanded: a path that uses them is silently ignored.
  3. In Command Line Args, pass the two files with the aliases $OldSrcFilePath$ (baseline version) and $NewSrcFilePath$ (current version). $OldSrcFileLine$ and $NewSrcFileLine$ give the line of the element when the tool can jump to a line.
  4. Click Save Changes.
Source Files Compare Tool set to Visual Studio Code
Settings › Editor Tools › Source Files Compare Tool, set to Visual Studio Code.
ToolExecutable file nameCommand Line Args
Visual Studio CodeC:\Users\<user>\AppData\Local\Programs\Microsoft VS Code\Code.exe--diff "$OldSrcFilePath$" "$NewSrcFilePath$"
WinMergeC:\Program Files\WinMerge\WinMergeU.exe"$OldSrcFilePath$" "$NewSrcFilePath$"
Beyond CompareC:\Program Files\Beyond Compare 4\BCompare.exe"$OldSrcFilePath$" "$NewSrcFilePath$"

Now right-click a changed method, for example Library::load() in 401 Changed Methods, and choose Review Diff since Baseline. The source file of each version opens side by side: on the left cppcheck-2.15.0\lib\library.cpp, on the right cppcheck-2.22.0\lib\library.cpp. Removed lines are red, added lines are green: here the copyright year, <sstream> removed and <utility> added.

Side-by-side diff of library.cpp between Cppcheck 2.15 and 2.22 in Visual Studio Code
Review Diff since Baseline: library.cpp, 2.15 on the left, 2.22 on the right.

The diff covers the whole file that contains the element. Use the navigation arrows of your tool to jump from change to change.

Making the baseline permanent

Compare Builds is the quickest way to compare two given results. To compare every new analysis with a reference automatically, set the baseline of the project instead.

Choose Baseline shortcuts

On the dashboard, Choose Baseline offers 8h, 1d, 2d, 3d, 4d, 5d, 7d, 14d, 30d, 60d, 90d: compare with the analysis of the same project made that long ago. Shortcuts that match an existing analysis are highlighted (here the analyses of 1 hour and 3 hours ago). define opens the baseline settings.

Baseline Settings

Baseline Settings in General Settings
Settings › General Settings › Baseline Settings.
SettingMeaning
Baseline in UIThe baseline used by the screens of CppDepend when you open a result. Default: Compare with same project (Analysis done 30 days ago).
Baseline During AnalysisThe baseline used when the analysis runs, for the rules on new code, the quality gates and the reports, in the GUI and in CI.
Copy to UI baseline / Copy to analysis baselineCopies one setting to the other, so both use the same reference.
SettingsOpens the Baseline Window below to change the setting.
Baseline Window
The Baseline Window.
OptionMeaning
Projects to Compare With
Don't do comparisonNo baseline: no change badges, no rules on new code.
Current CppDepend ProjectCompare with an older analysis of the same project (default).
Another CppDepend ProjectCompare with another project, chosen in the list or with ..., for example the previous release.
Analysis Result to Compare With
Most Recent Analysis Result AvailableThe latest result of that project.
Analysis Result Obtained On N days agoThe result closest to N days ago (30 by default).
The Particular Analysis ResultOne result picked in the list.
The Particular Result FileAny .cdar file on disk.

Click Ok to apply, then Save Changes in the settings page.

Recipes

GoalHow
Review a release before shippingProject › Compare Builds, previous release as baseline, then Code Diff › New Issues, starting with Critical.
List the debt addedCompare, then click the red badge of the Issues tile, sort by Debt.
See what was rewrittenCode Diff › Changed Methods, then Export › Export to treemap to see where they are.
Prove that a cleanup workedCompare before and after, read the green ↓ badges and Code Diff › Fixed Issues.
Always compare with the last releaseSettings › Baseline Settings › Another CppDepend Project, then Copy to analysis baseline.

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