mirror of
https://github.com/github/codeql.git
synced 2025-12-30 15:46:34 +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.
20 lines
448 B
Plaintext
20 lines
448 B
Plaintext
/**
|
|
* @name __init__ method is a generator
|
|
* @description __init__ method is a generator.
|
|
* @kind problem
|
|
* @tags reliability
|
|
* correctness
|
|
* @problem.severity error
|
|
* @sub-severity low
|
|
* @precision very-high
|
|
* @id py/init-method-is-generator
|
|
*/
|
|
|
|
import python
|
|
|
|
from Function f
|
|
where
|
|
f.isInitMethod() and
|
|
(exists(Yield y | y.getScope() = f) or exists(YieldFrom y | y.getScope() = f))
|
|
select f, "__init__ method is a generator."
|