Request a PoCDownload
Product

Platform

All features32 capabilities, from IDE to CICompliance KitsISO 26262, DO-178C, IEC 62304...AI GovernanceControl AI-generated C/C++ codeWhat’s new in 2026Latest 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
DocsPricing
Documentation

Guides

How to Analyze an Unreal Engine Project with CppDepend

Prerequisites

Unreal Engine (UE) projects rely on custom build tools (UnrealBuildTool / UBT) and engine-generated reflection headers (*.generated.h), making them different from standard Visual Studio or CMake projects.

This guide walks you through analyzing your Unreal Engine game modules and engine source code using CppDepend.

  • Unreal Engine 4 or 5 installed.
  • Your UE project built at least once in Development Editor configuration (to generate required headers and build files).
  • CppDepend installed (Standalone or Visual Studio Plugin).

Step 1: Export the Compilation Database (JSON)

Since Unreal Engine uses UnrealBuildTool (UBT) rather than native Visual Studio project structures, generating a compile_commands.json file guarantees 100% accurate include paths, preprocessor defines, and compiler options.

  • 1.Open your terminal or Command Prompt.
  • 2.Navigate to your Unreal Engine installation directory:
cd "C:\Program Files\Epic Games\UE_5.x\Engine\Build\BatchFiles"
  • 3.Run UnrealBuildTool with the -mode=GenerateClangDatabase flag pointing to your project:
Build.bat YourProjectNameEditor Win64 Development -Project="C:\Path\To\YourProject.uproject" -mode=GenerateClangDatabase

This creates a compile_commands.json file inside your project root directory or .unittest / Saved folder.

Alternative (Visual Studio Solution): if you generated a Visual Studio solution (.sln) from your .uproject, CppDepend can also inspect the .vcxproj files directly. However, the JSON Compilation Database method is recommended for faster and more accurate parsing.

Step 2: Create a New CppDepend Project

  • 1.Launch CppDepend.
  • 2.Click Create a new CppDepend Project.
  • 3.Name your project (e.g., MyGame_Analysis) and set the output directory.

Step 3: Import Project Inputs

  • 1.Under Analysis Inputs, click Add.
  • 2.Select Import CMake / Clang JSON Compilation Database (compile_commands.json).
  • 3.Browse to and select the compile_commands.json generated in Step 1.

(Optional Filter): if you only want to analyze your custom game modules (and skip analyzing all of Unreal Engine's core codebase to save time), filter out the engine paths under Exclude Files:

Add path rule: *\Engine\Source\*

Step 4: Run the Analysis

Click Run Analysis (or F5).

CppDepend will parse the source files, resolve includes, build the internal Code Model, and calculate code metrics.

Once completed, the dashboard will open.

Step 5: Write Custom CQLinq Rules for Unreal Engine

Unreal Engine has specific architectural patterns (such as Garbage Collection, UCLASS, UPROPERTY, and memory management). You can use CQLinq to enforce engine-specific best practices:

Example 1: Find Raw Pointer UPROPERTY Fields Missing Garbage Collection Protection

// <Name>UE001: Raw UObject pointers must be marked with UPROPERTY()</Name>
from f in Application.Fields
where f.Type.IsDerivedFrom("UObject") && 
      !f.IsStatic && 
      !f.HasAttribute("UPROPERTY")
select new { 
    Field = f, 
    Severity = Severity.High,
    FixHint = "Raw UObject pointers without UPROPERTY() risk being garbage collected unexpectedly."
}

Example 2: Detect Heavy Calculations inside Tick() Functions

// <Name>UE002: Overly Complex Tick Functions</Name>
from m in Application.Methods
where m.SimpleName.Equals("Tick") && 
      m.CyclomaticComplexity > 15
select new { 
    TickMethod = m, 
    m.CyclomaticComplexity,
    FixHint = "Refactor complex tick logic into event-driven timers or worker threads."
}

Tips & Best Practices for UE Analysis

  • Disable Unity Builds for Precision: Unreal Engine uses "Unity builds" (combining multiple .cpp files into single translation units) to speed up compilation. For line-by-line static analysis precision, disable Unity builds in your YourGame.Target.cs file by adding:
bUseUnityBuild = false;
  • CI/CD Integration: you can automate this analysis in your build pipeline using CppDepend.Console.exe during nightly automated builds.
Was this page helpful?Give feedbackRequest a feature