# Quality Gates

Quality Gate Trend Metrics / Quality Gates

Counts active quality gates, whatever their status (Pass, Warn, Fail). Without a baseline, gates relying on diff are not counted, which can explain an unexpected slight decrease of this count.

CQLinq source

This quality gate is written in CQLinq, C# LINQ over the NDepend code model. It ships with every new NDepend project: you can read it, adapt it, or use it as a starting point for your own custom rules.

// <TrendMetric Name="# Quality Gates" Unit="quality gates"/>
from qualityGate in QualityGates
select new { 
   qualityGate , 
   qualityGate.ValueString,
   qualityGate.Status, 
}

//<Desc>
// Counts active quality gates, whatever their status (Pass, Warn, Fail).
// Without a baseline, gates relying on diff are not counted, which can
// explain an unexpected slight decrease of this count.
//</Desc>

Trend Metrics / Quality Gates: all 3 items