Files
codeql/python/ql/examples/snippets/new_instance.ql
2019-08-08 10:55:45 +01:00

17 lines
317 B
Plaintext

/**
* @id py/examples/new-instance
* @name Create new object
* @description Finds places where we create a new instanceof `MyClass`
* @tags call
* constructor
* new
*/
import python
from Call new, ClassValue cls
where
cls.getName() = "MyClass" and
new.getFunc().pointsTo(cls)
select new