Python: remove unneeded consistency exclusion

This commit is contained in:
Rasmus Lerchedahl Petersen
2023-12-15 11:09:37 +01:00
parent bfdcae4538
commit 5b6ea15028

View File

@@ -46,24 +46,6 @@ private module Input implements InputSig<PythonDataFlow> {
)
}
predicate uniqueEnclosingCallableExclude(Node n) {
// `CaptureNode`s miss enclosing calables in some cases.
exists(Function func |
func = n.(SynthCaptureNode).getSynthesizedCaptureNode().getEnclosingCallable()
|
// This can happen if `func` is a comprehension.
// In that case, there is no associated DataFlowCallable.
not exists(func.getDefinition())
or
func.getADecorator().(Name).getId() = "property"
)
or
// We only have a selection of valid callables.
// For instance, we do not have classes as `DataFlowCallable`s.
not n.(SynthCaptureNode).getSynthesizedCaptureNode().getEnclosingCallable() instanceof Function and
not n.(SynthCaptureNode).getSynthesizedCaptureNode().getEnclosingCallable() instanceof Module
}
predicate uniqueCallEnclosingCallableExclude(DataFlowCall call) {
not exists(call.getLocation().getFile().getRelativePath())
}