Files
codeql/python/ql/examples/snippets/new_instance.ql
2025-10-30 13:58:59 +00:00

18 lines
361 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
private import LegacyPointsTo
from Call new, ClassValue cls
where
cls.getName() = "MyClass" and
new.getFunc().(ExprWithPointsTo).pointsTo(cls)
select new