Improve useFactory inter file function detection

This commit is contained in:
Vasco-jofra
2025-06-15 00:32:26 +02:00
parent 477f32c7ff
commit 9019879d99

View File

@@ -523,10 +523,10 @@ module NestJS {
result = tuple.getAPropertyWrite("useClass").getRhs()
or
exists(DataFlow::FunctionNode f |
f = tuple.getAPropertyWrite("useFactory").getRhs().getALocalSource() and
f = tuple.getAPropertyWrite("useFactory").getRhs().getAFunctionValue() and
result.getAstNode() = f.getFunction().getAReturnedExpr().getType().(ClassType).getClass()
)
or
or
result.getAstNode() =
tuple.getAPropertyWrite("useValue").getRhs().asExpr().getType().(ClassType).getClass()
}