mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
18 lines
348 B
Plaintext
18 lines
348 B
Plaintext
/**
|
|
* @id cs/examples/empty-then
|
|
* @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
|