Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e607953

Browse files
author
Benjamin Muskalla
committed
Simplify query
1 parent 9a85933 commit e607953

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class ParameterToFieldConfig extends TaintTracking::Configuration {
5353
ParameterToFieldConfig() { this = "ParameterToFieldConfig" }
5454

5555
override predicate isSource(DataFlow::Node source) {
56-
not source.asParameter().getType() instanceof PrimitiveType
56+
source instanceof DataFlow::ParameterNode and
57+
not source.getType() instanceof PrimitiveType
5758
}
5859

5960
override predicate isSink(DataFlow::Node sink) {
@@ -77,17 +78,13 @@ class ParameterToReturnValueTaintConfig extends TaintTracking::Configuration {
7778
ParameterToReturnValueTaintConfig() { this = "ParameterToReturnValueTaintConfig" }
7879

7980
override predicate isSource(DataFlow::Node source) {
80-
exists(Parameter p, Callable api |
81-
p = source.asParameter() and
82-
api = p.getCallable() and
83-
(
84-
not api.getReturnType() instanceof PrimitiveType and
85-
not p.getType() instanceof PrimitiveType
86-
) and
87-
(
88-
not api.getReturnType() instanceof TypeClass and
89-
not p.getType() instanceof TypeClass
90-
)
81+
exists(Callable api |
82+
source instanceof DataFlow::ParameterNode and
83+
api = source.asParameter().getCallable() and
84+
not api.getReturnType() instanceof PrimitiveType and
85+
not api.getReturnType() instanceof TypeClass and
86+
not source.asParameter().getType() instanceof PrimitiveType and
87+
not source.asParameter().getType() instanceof TypeClass
9188
)
9289
}
9390

0 commit comments

Comments
 (0)