Files
codeql/csharp/ql/examples/empty_then.ql
2019-07-26 17:47:11 +02:00

17 lines
318 B
Plaintext

/**
* @name If statements with empty then branch
* @description Finds 'if' statements where the 'then' branch is
* an empty block statement.
* @tags if
* then
* empty
* conditional
* branch
*/
import csharp
from IfStmt i
where i.getThen().(BlockStmt).isEmpty()
select i