C#: Do flag empty if statements if there is a comment in cs/useless-if-statement.

This commit is contained in:
Michael Nebel
2025-03-05 15:26:39 +01:00
parent 361bdfac12
commit 35fbaf4ac3

View File

@@ -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))