Quality Gates Evolution

Quality Gate Quality Gates

Shows quality gates evolution between baseline and now. Gates relying on diff (like New Debt since Baseline) have no evolution available. Double-click a quality gate for editing.

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.

// <Name>Quality Gates Evolution</Name>
from qg in QualityGates
let qgBaseline = qg.OlderVersion()
let relyOnDiff = qgBaseline == null
let evolution = (relyOnDiff || qgBaseline.Value == null) ? TrendIcon.None :
                // When a quality gate relies on diff between now and baseline
                // it is not executed against the baseline
                qg.ValueDiff() == 0d ?
                TrendIcon.Constant :
                (qg.ValueDiff() > 0 ? 
                  ( qg.MoreIsBad ?  TrendIcon.RedUp: TrendIcon.GreenUp) :
                  (!qg.MoreIsBad ?  TrendIcon.RedDown: TrendIcon.GreenDown))
select new { qg, 
// BaselineStatus =  relyOnDiff? (QualityGateStatus?) null : qgBaseline.Status,
   Status         =  qg.Status,
   Evolution      =  evolution,

   BaselineValue  =  relyOnDiff? " " : qgBaseline.ValueString,
   Value          =  qg.ValueString,
}
 
// <Desc>
// Shows quality gates evolution between baseline and now. Gates relying on
// diff (like *New Debt since Baseline*) have no evolution available.
// Double-click a quality gate for editing.
// </Desc>

Quality Gates: all 19 items