Python: Ignore functions with @property decorator for now

This commit is contained in:
Rasmus Wriedt Larsen
2022-10-14 11:38:45 +02:00
parent cba93ded77
commit 1e96ced3ab
2 changed files with 13 additions and 2 deletions

View File

@@ -205,6 +205,13 @@ predicate isClassmethod(Function func) {
)
}
/** Holds if the function `func` has a `property` decorator. */
predicate hasPropertyDecorator(Function func) {
exists(NameNode id | id.getId() = "property" and id.isGlobal() |
func.getADecorator() = id.getNode()
)
}
// =============================================================================
// Callables
// =============================================================================
@@ -251,7 +258,11 @@ abstract class DataFlowCallable extends TDataFlowCallable {
abstract class DataFlowFunction extends DataFlowCallable, TFunction {
Function func;
DataFlowFunction() { this = TFunction(func) }
DataFlowFunction() {
this = TFunction(func) and
// TODO: Handle @property decorators
not hasPropertyDecorator(func)
}
override string toString() { result = func.toString() }

View File

@@ -51,4 +51,4 @@ prop.arg2 = 43
del prop.arg2
f = prop.func_prop
f() # $ SPURIOUS: tt=Prop.func_prop MISSING: tt=func
f() # $ MISSING: tt=func