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

CI/CD Integration

SonarQube Integration

3 min readCI/CD IntegrationCppDepend 2027

Enhance Your C/C++ Code Analysis with the CppDepend SonarQube Plugin

Welcome to our comprehensive guide on integrating the CppDepend SonarQube plugin to enhance your C++ code analysis process. The CppDepend SonarQube plugin offers a seamless integration with SonarQube, a widely used platform for continuous inspection of code quality. By incorporating the powerful features of CppDepend into your SonarQube workflow, you'll benefit from improved code maintainability, reduced technical debt, and valuable insights into your codebase. Read on to learn more about the benefits of using the CppDepend SonarQube plugin and how to easily integrate it into your development process.

CppDepend offers a unique code query language called PRQL, which allows developers, designers, and architects to treat the codebase like a database and create custom rules.

PRQL enables users to merge data from code metrics, dependencies, API usage, and other model information to establish highly sophisticated rules.

Through PRQL, CppDepend introduces the ability to effortlessly tailor code quality rules for SonarQube, and it facilitates two methods of collaboration with SonarQube:

  • CppDepend alongside the C++ SonarQube Community Plugin: This recommended integration allows you to take advantage of both CppDepend and the SonarQube Community Plugin's features. For guidance on this integration, refer to the SonarQube Community Integration documentation.
  • CppDepend Plugin in Standalone Mode: With this option, there's no need to install an additional C++ SonarQube plugin. For instructions on implementing this integration, consult the Standalone SonarQube Integration documentation.

CppDepend and SonarQube rule-sets are complimentary

Both CppDepend and SonarQube are static analyzers that offer a rule-based system to detect problems in C/C++ code. However the CppDepend default Rules-Set has very few overlap with the SonarQube rules

Basically the SonarQube rules are good at analyzing what is happening inside a method, the code flow while the CppDepend code model, on which the CppDepend rules are based, is optimized for a 360 view of particular higher-scale areas including OOP, dependencies, metrics, breaking changes, mutability, naming...

Concretely SonarQube rules can warn about problems like a reference that doesn't need to be tested for nullity because in the actual scope it cannot be null, while CppDepend can warn you about too complex classes or components, and offer advices about how to refactor to make the code cleaner and more maintainable.

Another point that makes the CppDepend ruling system unique is how easy it makes to write custom rules. With CppDepend a rule is a LINQ query, that queries a code model dedicated to code quality, edited live in Visual Studio, compiled and executed live at edition time.

Concretely, this piece of code below is a fully functional rule, could it be simpler?

// <Name>Classes must start with an I</Name>

warnif count > 0

  Application.Types.Where(t => t.IsClass && !t.SimpleName.StartsWith("C"))

When defining a custom rule with CppDepend, the user doesn't need to create a Visual Studio project, create a source file, step into the edit/compile/debug cycle, maintain a binary dll that requires effort to be shared, versioned and integrated.

With CppDepend custom rules are raw texts, embedded as XML CDATA into the CppDepend project or rule files. Also, the documentation and how-to-fix guidelines can be embedded in the rule source code as comments.

SonarQube rule documentation

Also each CppDepend rule can present its issues with extra data that will help understanding the problem and fix it.

Moreover each rule can embed two C# formulas that attempt to estimate both the cost to fix the issue and the annual cost to let the issue unfixed, also called the technical-debt and the annual interest of the issue. Since these formulas rely on what really matter at fix time, this makes the debt estimations smart.

SonarQube technical debt estimation

Finally, with CppDepend each rule is run in a few milli-seconds even on a large code base. As a consequence all rules can be passed in a few seconds (typically 2 or 3 seconds on a real-world code base), both in Visual Studio and in the Continuous-Integration system.

As a benefit, after each compilation and also at check-in time, the developer instantly knows about the new and fixed issues since the baseline, and the impact in terms of technical debt fixed or created.

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