mirror of
https://github.com/github/codeql.git
synced 2026-03-31 20:58:16 +02:00
Python: Port PropertyInOldStyleClass.ql
Only trivial test changes.
This commit is contained in:
@@ -11,10 +11,13 @@
|
||||
*/
|
||||
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
private import semmle.python.dataflow.new.internal.DataFlowDispatch
|
||||
|
||||
from PropertyObject prop, ClassObject cls
|
||||
where cls.declaredAttribute(_) = prop and not cls.failedInference() and not cls.isNewStyle()
|
||||
from Function prop, Class cls
|
||||
where
|
||||
prop.getScope() = cls and
|
||||
prop.getADecorator().(Name).getId() = "property" and
|
||||
not DuckTyping::isNewStyle(cls)
|
||||
select prop,
|
||||
"Property " + prop.getName() + " will not work properly, as class " + cls.getName() +
|
||||
" is an old-style class."
|
||||
|
||||
@@ -1 +1 @@
|
||||
| property_old_style.py:8:6:8:13 | Property piosc | Property piosc will not work properly, as class OldStyle is an old-style class. |
|
||||
| property_old_style.py:9:5:9:20 | Function piosc | Property piosc will not work properly, as class OldStyle is an old-style class. |
|
||||
|
||||
Reference in New Issue
Block a user