mirror of
https://github.com/github/codeql.git
synced 2026-02-13 05:31:22 +01:00
21 lines
469 B
Plaintext
21 lines
469 B
Plaintext
/**
|
|
* @name `__init__` method is a generator
|
|
* @description `__init__` method is a generator.
|
|
* @kind problem
|
|
* @tags quality
|
|
* 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."
|