mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +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.
19 lines
400 B
Plaintext
19 lines
400 B
Plaintext
import python
|
|
import Util
|
|
|
|
from Scope s, string name, Object val
|
|
where
|
|
name != "__name__" and
|
|
(
|
|
exists(ModuleObject m |
|
|
m.getModule() = s and
|
|
m.attributeRefersTo(name, val, _)
|
|
)
|
|
or
|
|
exists(ClassObject cls |
|
|
cls.getPyClass() = s and
|
|
cls.declaredAttribute(name) = val
|
|
)
|
|
)
|
|
select locate(s.getLocation(), "abcdghijklopqrs"), s.toString(), name, repr(val)
|