Files
codeql/python/ql/examples/snippets/emptyblock.ql
2020-03-30 11:59:10 +02:00

15 lines
309 B
Plaintext

/**
* @id py/examples/emptyblock
* @name Empty blocks
* @description Finds the first statement in a block consisting of nothing but Pass statements
* @tags empty
* block
* statement
*/
import python
from StmtList blk
where not exists(Stmt s | not s instanceof Pass)
select blk.getItem(0)