Skip to content

Commit c05e8a6

Browse files
committed
Remove duplicate logic introduced by exists(VarRef ... )
1 parent a3efdd7 commit c05e8a6

File tree

1 file changed

+10
-12
lines changed
  • javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap

1 file changed

+10
-12
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CQL.qll

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ import advanced_security.javascript.frameworks.cap.CDS
88
*/
99
class CqlQueryBase extends VarRef {
1010
CqlQueryBase() {
11-
exists(VarRef varRef | this = varRef |
12-
exists(string name |
13-
varRef.getName() = name and
14-
name in ["SELECT", "INSERT", "DELETE", "UPDATE", "UPSERT"] and
15-
(
16-
/* Made available as a global variable */
17-
exists(GlobalVariable queryBase | this = queryBase.getAReference())
18-
or
19-
/* Imported from `cds.ql` */
20-
exists(CdsFacade cds |
21-
cds.getMember("ql").getMember(name).getAValueReachableFromSource().asExpr() = this
22-
)
11+
exists(string name |
12+
this.getName() = name and
13+
name in ["SELECT", "INSERT", "DELETE", "UPDATE", "UPSERT"] and
14+
(
15+
/* Made available as a global variable */
16+
exists(GlobalVariable queryBase | this = queryBase.getAReference())
17+
or
18+
/* Imported from `cds.ql` */
19+
exists(CdsFacade cds |
20+
cds.getMember("ql").getMember(name).getAValueReachableFromSource().asExpr() = this
2321
)
2422
)
2523
)

0 commit comments

Comments
 (0)