mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
17 lines
457 B
Plaintext
17 lines
457 B
Plaintext
import python
|
|
|
|
/** Whether `mox` or `.StubOutWithMock()` is used in thin module `m`. */
|
|
predicate useOfMoxInModule(Module m) {
|
|
exists(ModuleObject mox | mox.getName() = "mox" or mox.getName() = "mox3.mox" |
|
|
exists(ControlFlowNode use |
|
|
use.refersTo(mox) and
|
|
use.getScope().getEnclosingModule() = m
|
|
)
|
|
)
|
|
or
|
|
exists(Call call |
|
|
call.getFunc().(Attribute).getName() = "StubOutWithMock" and
|
|
call.getEnclosingModule() = m
|
|
)
|
|
}
|