mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
remove redundant inline type casts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user