Critical Rules and Build Failure
NDepend comes with the notion of Critical CQLinq Rule. Critical rules represent a mean to define high priority rules that must never be violated.
A critical rule is just a CQLinq rule with the flag Critical Rule checked:
With critical rules, it is possible to break the Build Process when a critical rule violation occurs. To do so, just make sure that this default Quality Gate is enabled (it is enabled by default).
// <QualityGate Name="Critical Rules Violated" Unit="rules" />
At Development time, the NDepend interactive UI (integrated in VisualStudio, or VisualNDepend.exe standalone) comes with several visual indicators when a critical rule is violated: