Files
codeql/csharp/ql/src/Bad Practices/Comments/CommentedOutCode.ql

24 lines
591 B
Plaintext

/**
* @name Commented-out code
* @description Commented-out code makes the remaining code more difficult to read.
* @kind problem
* @problem.severity recommendation
* @precision medium
* @id cs/commented-out-code
* @tags quality
* maintainability
* readability
*/
import csharp
class CommentedOutCode extends CommentBlock {
CommentedOutCode() {
not this.isXmlCommentBlock() and
2 * count(this.getAProbableCodeLine()) > count(this.getANonEmptyLine())
}
}
from CommentedOutCode comment
select comment, "This comment appears to contain commented-out code."