Skip to content

Commit a235f8f

Browse files
committed
remove redundant inline type casts
1 parent b75c316 commit a235f8f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-377/InsecureTemporaryFile.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ where
9292
) and
9393
exists(Variable vrtmp |
9494
vrtmp = fc.getArgument(0).(VariableAccess).getTarget() and
95-
vrtmp = fctmp.getArgument(0).(AddressOfExpr).getAddressable().(Variable) and
95+
vrtmp = fctmp.getArgument(0).(AddressOfExpr).getAddressable() and
9696
not vrtmp instanceof Field
9797
)
9898
) and

java/ql/src/utils/model-generator/CaptureSummaryModels.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ string captureParameterToParameterFlow(TargetAPI api) {
223223
|
224224
result =
225225
asTaintModel(api, parameterAccess(source.asParameter()),
226-
parameterAccess(sink.getPreUpdateNode().asExpr().(VarAccess).getVariable().(Parameter)))
226+
parameterAccess(sink.getPreUpdateNode().asExpr().(VarAccess).getVariable()))
227227
)
228228
}
229229

javascript/ql/lib/semmle/javascript/dataflow/internal/InterModuleTypeInference.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private class AnalyzedImport extends AnalyzedPropertyRead, DataFlow::ValueNode {
157157
exports = MkAbstractProperty(TAbstractModuleObject(imported), "exports")
158158
|
159159
base = exports.getALocalValue() and
160-
propName = astNode.(ImportSpecifier).getImportedName()
160+
propName = astNode.getImportedName()
161161
)
162162
or
163163
// when importing CommonJS/AMD modules from ES2015, `module.exports` appears
@@ -168,7 +168,7 @@ private class AnalyzedImport extends AnalyzedPropertyRead, DataFlow::ValueNode {
168168
// CommonJS/AMD module generated by TypeScript compiler
169169
imported.getAStmt() instanceof ExportAssignDeclaration
170170
) and
171-
astNode.(ImportSpecifier).getImportedName() = "default" and
171+
astNode.getImportedName() = "default" and
172172
base = TAbstractModuleObject(imported) and
173173
propName = "exports"
174174
}

python/ql/lib/semmle/python/frameworks/FastApi.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private module FastApi {
163163
exists(Class cls, API::Node base |
164164
base = getModeledResponseClass(_).getASubclass*() and
165165
cls.getABase() = base.getAUse().asExpr() and
166-
responseClass.getAnImmediateUse().asExpr().(ClassExpr) = cls.getParent()
166+
responseClass.getAnImmediateUse().asExpr() = cls.getParent()
167167
|
168168
exists(Assign assign | assign = cls.getAStmt() |
169169
assign.getATarget().(Name).getId() = "media_type" and

0 commit comments

Comments
 (0)