Commented-out code (ARCH716)
Ce contenu n’est pas encore disponible dans votre langue.
Key dotnet.codequality.commented-out-code · Severity info · Category codequality
Flags a comment that is code - statements or members that parse as C# - rather than prose. It is never compiled, so it drifts from the code around it, and version control already keeps the old version. TODO, FIXME, licence headers and examples are not counted.
Incorrect
Section titled “Incorrect”public decimal Total(){ // var discount = Customer.Discount; // total -= total * discount; return Lines.Sum(l => l.Amount);}Correct
Section titled “Correct”public decimal Total(){ return Lines.Sum(l => l.Amount);}