Percentage Coverage on Refactored Code (JustMyCode)
Same as Percentage Coverage on Refactored Code, on JustMyCode only: changed code generated by the compiler or by tools (the Entity Framework model snapshot, rewritten by each migration...) is not counted. Like the rule Methods refactored should be tested, it ignores code that is not JustMyCode.
Like Percentage Coverage, it counts the lines coverable by tests: code excluded from coverage is not counted.
Deactivated by default. Activate it, and deactivate Percentage Coverage on Refactored Code, to gate on the code your team writes.
Like Percentage Coverage, it counts the lines coverable by tests: code excluded from coverage is not counted.
Deactivated by default. Activate it, and deactivate Percentage Coverage on Refactored Code, to gate on the code your team writes.
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.
// <QualityGate Name="Percentage Coverage on Refactored Code (JustMyCode)" Unit="%" />
failif value < 70%
warnif value < 80%
let refactoredMethods = JustMyCode.Methods.Where(m => m.CodeWasChanged() && m.NbLinesOfCode > 0)
let covered = (double)refactoredMethods.Sum(m => m.NbLinesOfCodeCovered ?? 0)
let notCovered = (double)refactoredMethods.Sum(m => m.NbLinesOfCodeNotCovered ?? 0)
select (covered + notCovered) == 0d ? (double?)null : 100d * covered / (covered + notCovered)
//<Desc>
// Same as *Percentage Coverage on Refactored Code*, on **JustMyCode** only:
// changed code generated by the compiler or by tools (the Entity Framework
// model snapshot, rewritten by each migration...) is not counted. Like the
// rule *Methods refactored should be tested*, it ignores code that is not
// JustMyCode.
//
// Like *Percentage Coverage*, it counts the lines coverable by tests: code
// excluded from coverage is not counted.
//
// Deactivated by default. Activate it, and deactivate *Percentage Coverage
// on Refactored Code*, to gate on the code your team writes.
//</Desc>
Open in the interactive Rules Explorer · All default rules
Quality Gates: all 19 items
- Quality Gates Evolution
- Percentage Coverage
- Percentage Coverage on New Code
- Percentage Coverage on Refactored Code
- Percentage Coverage (JustMyCode)
- Percentage Coverage on New Code (JustMyCode)
- Percentage Coverage on Refactored Code (JustMyCode)
- Blocker Issues
- Critical Issues
- New Blocker / Critical / High Issues
- Critical Rules Violated
- Treat Compiler Warnings as Error
- Percentage Debt
- Debt
- New Debt since Baseline
- Debt Rating per Namespace
- Annual Interest
- New Annual Interest since Baseline
- Unnecessary NDepend SuppressMessageAttribute Usage