mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
19 lines
468 B
Plaintext
19 lines
468 B
Plaintext
/**
|
|
* @id py/examples/print
|
|
* @name Find prints
|
|
* @description Find print statements or calls to the builtin function 'print'
|
|
* @tags print
|
|
*/
|
|
|
|
import python
|
|
private import LegacyPointsTo
|
|
|
|
from AstNode print
|
|
where
|
|
/* Python 2 without `from __future__ import print_function` */
|
|
print instanceof Print
|
|
or
|
|
/* Python 3 or with `from __future__ import print_function` */
|
|
print.(Call).getFunc().(ExprWithPointsTo).pointsTo(Value::named("print"))
|
|
select print
|