CQLinq (Code Query LINQ) is a powerful domain-specific query language built into CppDepend. It allows teams to inspect, enforce, and continuously monitor architectural rules, maintainability metrics, and coding standards across C/C++ codebases.
- ✅ Create and enforce custom architectural constraints
- ✅ Detect risky, complex, or unmaintainable code
- ✅ Track technical debt over time
- ✅ Monitor rule violations (MISRA, CERT, CWE)
- ✅ Customize dashboards and reports with your own logic
from m in Methods where m.CyclomaticComplexity > 20 select mIdentify methods that may need refactoring for clarity and testability.
warnif count > 0
from t in Types
where t.IsUsing("UI") && t.IsDeclaredIn("Core")
select tEnsure code layering is respected—e.g., Core should not depend on UI.
from i in Issues
where i.Severity == Severity.High && i.OccurredInThisVersion
select iCatch critical issues introduced since the last version.
from r in Rules
where r.Name.Contains("MISRA") && r.HasBeenViolated
select rUseful for certification reports and compliance preparation.
- Open the VisualCppDepend dashboard
- Navigate to Queries and Rules
- Create or edit a CQLinq query
- Run the query and inspect results
- Optionally enforce via quality gates or CI
- Add queries to dashboards and reports
- Visualize rule violations in treemaps or charts
- Export results in HTML or JSON format
- Filter by module, layer, scope, or severity
CppDepend ships with 200+ default queries covering metrics, maintainability, standards, and design. You can edit these or create new ones.