'NDepend - Baseline Coverage by Assembly Query
is it possible to have a comparison by assembly to the baseline build? At the moment I have a report that shows the coverage by assembly, but I would like to add the coverage compared to the baseline build for each assembly as well side by side. How would a query look like?
Thanks a lot.
Solution 1:[1]
This can be achieved with such CQLinq code query:
from a in Application.Assemblies
select new { a, a.PercentageCoverage,
olderCov = a.OlderVersion() == null ? -1 :
a.OlderVersion().PercentageCoverage,
diffCov = a.OlderVersion() == null ? -1 :
a.PercentageCoverage - a.OlderVersion().PercentageCoverage
}
Here is a screenshot of the result:

Several points:
- The query can be easily rewritten to show diff of other coverage metrics like
a.NbLinesOfCodeCoveredfor example - This query can be easily transformed into a rule for example if any coverage ratio is decreasing (related doc)
- Or if you prefer it not to be a rule but still gets this query result in the report, just use this feature (List code queries of this group in the report)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Patrick from NDepend team |
