PricingDownload
Product

Platform

All features48 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, cyclesSBOM & dependenciesIs our C++ code affected? Minutes, not weeksTechnical 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

Design and Architecture

Architecture Blueprint

A map of your code drawn from the code itself. Namespaces are grouped into a small number of components, the dependencies between them are drawn as arrows, and the problems that matter for architecture (cycles, dependencies to cut, layer violations) are colored on the map.

6 min readDesign and ArchitectureCppDepend 2027

Architecture Blueprint in CppDepend

What it shows

ComponentsNamespaces grouped into boxes, so a large code base fits on one screen.
DependenciesArrows from a component to the ones it uses.
LayersOptional rules that say which component may use which one.
FindingsCycles, dependencies worth cutting, layer violations, data stores, files that change together.

The blueprint is generated from the last analysis. It does not need a diagram file and it is not drawn by hand. When the code changes, run the analysis again and click Refresh.

Opening it

Open Architecture Blueprint from the main menu of the project. The first screen is the Overview: all components of the project, with the dependencies between them. The line under the toolbar gives the totals, for example 7 components - 2 layers - 0 cycles - 0 data stores.

Reading the diagram

app 3 namespaces - 4.2k LOC audio1 namespaces - 264 LOC crypto1 namespaces - 1.4k LOC gfx1 namespaces - 12 LOC logging1 namespaces - 2 LOC

Boxes

Each box is a component. It shows its name, the number of namespaces it holds and its size in lines of code (LOC). The box you selected is outlined. Components with no real namespace (for example code in the global namespace) appear as (global).

Arrows

An arrow from A to B means that code in A uses code in B (calls a function, uses a type, inherits from a class, includes a type from it). The arrow is drawn once however many individual dependencies it stands for. Use the toolbar to show every dependency or fewer of them.

Colors and legend

The legend under the toolbar explains every color. An arrow or box without a color is a normal dependency.

ColorMeaningWhat to do
dependency cycleComponents that depend on each other, directly or through others.Break the cycle: they cannot be built, tested or understood separately.
dependency to cutAn arrow that, if removed, would help most to remove a cycle or to respect the layers.Start here: it is usually the cheapest change.
changes togetherComponents whose files are often modified in the same commits (needs the history, see Change coupling).Hidden coupling: check if they should be one component, or share an interface.
layer violationA dependency that your layer rules forbid.Fix the code, or change the rule if the rule is wrong.
data storeA component that reads or writes a database, a file store or a similar external storage.Check which components touch the data directly.

Toolbar

ControlWhat it does
DetailThe level of the boxes. Namespaces groups namespaces into components. Choose a finer or a coarser level to see more or less of the code.
Components ≈The approximate number of components. Namespaces are merged or split to get close to this number. A smaller number gives a simpler map, a bigger one a more precise map.
All dependenciesOn: every dependency between components is drawn. Off: only the main ones, to reduce the noise on large projects.
Data storesShows or hides the data store marks and the related findings.
Hide anonymous namespacesLeaves out unnamed namespaces (the C++ namespace { ... } used for internal linkage). They are implementation details of a file and add noise to the map.
Change couplingAdds the changes together findings, computed from the source control history. Off by default because it needs the history.
HistoryThe period of the history used by change coupling (for example 12 months).
ButtonWhat it does
Configure layers...Opens the layers editor: define layers and which components belong to each, and which layer may use which. See Layers and rules.
Clear rulesRemoves the layer rules you defined. The map goes back to showing only the dependencies and the cycles.
CopyCopies the diagram so you can paste it in a document, a wiki or a pull request.
RefreshRedraws the blueprint from the latest analysis result and the current settings.

Drilling down

Click a component to look inside it. The path at the top of the side panel (Overview > (global) > (global)) shows where you are, and each part is a link to go back up.

  1. Overview: all components.
  2. Component: the namespaces inside it, with the dependencies between them.
  3. Namespace: its types in the side panel. Click a type to open its source.
TipSelecting a component also lights its direct dependencies, so you can see at a glance what it needs and who needs it.

Layers and rules

A layer is a group of components with a role (for example UI, Domain, Infrastructure). A rule says which layers a layer may use. The blueprint then marks every dependency that breaks a rule as a layer violation.

  1. Click Configure layers....
  2. Create the layers and put the components in them.
  3. Set the allowed direction, for example UI uses Domain, Domain uses Infrastructure, never the reverse.
  4. Close the editor. Violations appear in red on the map and are counted in the summary line.

The summary line shows how many layers exist (2 layers). Clear rules removes them all if you want to start again.

Good to knowLayers are a rule set about the code that exists, not a diagram you draw. If the code changes and a dependency appears that is not allowed, the next analysis reports it.

Findings

Dependency cycles

Two or more components that depend on each other. The map colors the arrows that make the cycle. The summary line counts them (0 cycles means none).

Dependencies to cut

Among the arrows of a cycle or of layer violations, the ones where a small change gives the biggest improvement. Remove the dependency (move a type, add an interface, invert the call) and run the analysis again.

Changes together

Components whose files change in the same commits, even without an arrow between them. It shows a coupling that the code does not show: a shared file format, a duplicated rule, a protocol. Turn on Change coupling and choose a History period.

Data stores

Components that access external storage. The count is in the summary line. It helps to answer: which parts of the code know the database?

Typical workflows

Understand a new code base

  1. Set Components to about 10 and look at the Overview.
  2. Find the component that everything uses (many arrows in) and the one that uses everything (many arrows out).
  3. Drill down in the largest boxes to see how they are organized.

Enforce an architecture

  1. Define the layers with Configure layers....
  2. Fix the red violations, starting with the purple dependencies to cut.
  3. Keep the rules in the project: new violations show up in the next analysis.

Prepare a refactoring

  1. Turn on Change coupling with a long history.
  2. Look at the pink links: these components are modified together and are the candidates to merge or to decouple.
  3. Use Copy to put the map in the design document.

Tips

  • For a very large project, start with fewer components and All dependencies off, then increase the detail.
  • If you see a box called (global) that is large, a lot of code lives outside any namespace. It is often C code or old C++ code, and it is the first thing to organize.
  • Keep Hide anonymous namespaces on, unless you want to study the internals of a file.
  • Use the same Components value when you compare two analyses, otherwise the grouping differs.

Questions

The map is empty or has one box.

Run the analysis first. If everything is in the global namespace there is only one component: this is common for C projects.

Turn on Change coupling. The project must be in a source control system that CppDepend can read, and the History period must contain commits.

Why do I get a different grouping than before?

The grouping depends on the code and on Components. After big changes in the code the groups can move. Fix the number of components to compare.

How is it different from the dependency graph?

The dependency graph shows every element you ask for. The blueprint summarizes the project in a few components, adds the layer rules and the findings, and is meant to be read as an architecture picture.

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