CodeQL queries 1.25
Skip to end of metadata
Go to start of metadata

Finds 'if' statements where the "then" branch consists entirely of Pass statements

import python

from If i
where
  not exists(Stmt s |
    i.getStmt(_) = s and
    not s instanceof Pass
  )
select i