CppDepend AI
Review
Get a CppDepend review of every change and every pull request, on your machine or automatically.
What you get
| Level | What you get | Cost |
|---|---|---|
| 1. CppDepend review | a report: the quality gate result and the new issues in the files you changed. On a pull request: one comment, updated on each push, and a failing check when the gate fails | free, takes seconds |
| 2. AI review (optional) | your AI assistant reads the same results and adds judgment: which issues really matter, why, and how to fix them. On GitHub it comments on the exact lines | uses your AI subscription or API key |
Level 1 is always enough to get started. Add level 2 when you want explanations and fixes.
Before you start, you did the Quick start: a baseline in your CppDepend project, and cppdepend-ai init in your repository.
On your machine
- Build your code, then analyze it:
cppdepend-ai analyze --run --project MyApp.cdproj - Get the review (level 1, no AI):
cppdepend-ai review --base mainIt writesreview.mdin thecppdependaifolder (the exact path is printed): the quality gate verdict and the new issues in the files changed sincemain. The command ends with an error when the gate fails, so you can use it in scripts. - Or ask your AI assistant (level 2):
Review my change using CppDepend.
In Claude Code you can also type /cppdepend-review, or ask for the architecture-reviewer agent. Other assistants follow the review procedure written in AGENTS.md by init.
On every pull request (GitHub)
- In your repository, run:
cppdepend-ai init --ci github --project MyApp.cdproj - Open
.github/workflows/cppdepend-review.ymland adapt it: the runner (a machine where CppDepend is installed), your build command and the path of CppDepend. - Commit and push.
From now on, every pull request gets one CppDepend comment (updated on each push) and a failing check when the quality gate fails.
Add an AI review (optional)
In your GitHub repository settings, add:
| To get | Add the secret | Add the variable (value true) |
|---|---|---|
| a Claude review with comments on the lines | ANTHROPIC_API_KEY |
CPPDEPEND_AGENT_REVIEW |
| an OpenAI Codex review (one comment) | OPENAI_API_KEY |
CPPDEPEND_CODEX_REVIEW |
For Claude, also install the Claude GitHub App on the repository. You can enable both, or neither. Pull requests from forks do not get comments or AI reviews: GitHub does not give secrets to them.
Other CI systems
Azure DevOps, GitLab and others: run cppdepend-ai analyze --run, then cppdepend-ai review --base origin/main. Post review.md as a pull request comment with the tool of your platform, and let the pipeline fail when review fails. See also Continuous integration.
Reading the review
- Quality gate: PASSED or FAILED. The gate is your rule for "acceptable" (see Quality gate). A failed gate is a failed check.
- New issues. Only the issues introduced since the baseline, in the files changed since your target branch. Old problems are not shown: you are not asked to fix years of history.
- Severity. Fix Blocker and Critical first. They are the ones that fail the default gate.
- Location.
file:lineof each issue and the code element concerned. Ask your assistant to explain a rule and how to fix it: "Explain the first issue of the review and fix it." - "No baseline". The report says so when your project has none. Set one (Quick start, step 2).
Getting good reviews
- Keep the baseline meaningful. For pull requests, use the analysis of the target branch.
- Tune the quality gate. Start permissive, for example "no new Critical issue", and tighten later.
- Analyze the built code. Build, then
analyze --run, thenreview. - Ask the AI for evidence. A good AI review gives file, line, rule and severity for each finding, and nothing it cannot tie to a CppDepend result.
