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

17 lines
316 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