mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
C#: Do flag empty if statements if there is a comment in cs/useless-if-statement.
This commit is contained in:
@@ -16,7 +16,8 @@ predicate emptyStmt(Stmt s) {
|
||||
or
|
||||
s =
|
||||
any(BlockStmt bs |
|
||||
bs.getNumberOfStmts() = 0
|
||||
bs.getNumberOfStmts() = 0 and
|
||||
not any(CommentBlock cb).getParent() = bs
|
||||
or
|
||||
bs.getNumberOfStmts() = 1 and
|
||||
emptyStmt(bs.getStmt(0))
|
||||
|
||||
Reference in New Issue
Block a user