remove redundant inline type casts

This commit is contained in:
Erik Krogh Kristensen
2022-01-20 21:38:44 +01:00
parent b75c316c27
commit a235f8f023
4 changed files with 5 additions and 5 deletions

View File

@@ -92,7 +92,7 @@ where
) and
exists(Variable vrtmp |
vrtmp = fc.getArgument(0).(VariableAccess).getTarget() and
vrtmp = fctmp.getArgument(0).(AddressOfExpr).getAddressable().(Variable) and
vrtmp = fctmp.getArgument(0).(AddressOfExpr).getAddressable() and
not vrtmp instanceof Field
)
) and

View File

@@ -223,7 +223,7 @@ string captureParameterToParameterFlow(TargetAPI api) {
|
result =
asTaintModel(api, parameterAccess(source.asParameter()),
parameterAccess(sink.getPreUpdateNode().asExpr().(VarAccess).getVariable().(Parameter)))
parameterAccess(sink.getPreUpdateNode().asExpr().(VarAccess).getVariable()))
)
}

View File

@@ -157,7 +157,7 @@ private class AnalyzedImport extends AnalyzedPropertyRead, DataFlow::ValueNode {
exports = MkAbstractProperty(TAbstractModuleObject(imported), "exports")
|
base = exports.getALocalValue() and
propName = astNode.(ImportSpecifier).getImportedName()
propName = astNode.getImportedName()
)
or
// when importing CommonJS/AMD modules from ES2015, `module.exports` appears
@@ -168,7 +168,7 @@ private class AnalyzedImport extends AnalyzedPropertyRead, DataFlow::ValueNode {
// CommonJS/AMD module generated by TypeScript compiler
imported.getAStmt() instanceof ExportAssignDeclaration
) and
astNode.(ImportSpecifier).getImportedName() = "default" and
astNode.getImportedName() = "default" and
base = TAbstractModuleObject(imported) and
propName = "exports"
}

View File

@@ -163,7 +163,7 @@ private module FastApi {
exists(Class cls, API::Node base |
base = getModeledResponseClass(_).getASubclass*() and
cls.getABase() = base.getAUse().asExpr() and
responseClass.getAnImmediateUse().asExpr().(ClassExpr) = cls.getParent()
responseClass.getAnImmediateUse().asExpr() = cls.getParent()
|
exists(Assign assign | assign = cls.getAStmt() |
assign.getATarget().(Name).getId() = "media_type" and