-
Notifications
You must be signed in to change notification settings - Fork 4
Support OData v4 remote models, add a fallback case on UI5BindingPath.getNode/0, fix UI5 AMD module inheritance
#248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
19e9deb
1ca3c1c
4931118
e163801
cd18e29
8e059c4
445b573
1a52a1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import javascript | ||
| import DataFlow | ||
|
|
||
| module TypeTrackers { | ||
| private SourceNode hasDependency(TypeTracker t, string dependencyPath) { | ||
| t.start() and | ||
| exists(UserModule d | | ||
| d.getADependency() = dependencyPath and | ||
| result = d.getRequiredObject(dependencyPath).asSourceNode() | ||
| ) | ||
| or | ||
| exists(TypeTracker t2 | result = hasDependency(t2, dependencyPath).track(t2, t)) | ||
| } | ||
|
|
||
| SourceNode hasDependency(string dependencyPath) { | ||
| result = hasDependency(TypeTracker::end(), dependencyPath) | ||
| } | ||
|
|
||
| private MethodCallNode getOwnerComponentRef(TypeTracker t, CustomController customController) { | ||
| customController.getAThisNode() = result.getReceiver() and | ||
| result.getMethodName() = "getOwnerComponent" | ||
| or | ||
| exists(TypeTracker t2 | result = getOwnerComponentRef(t2, customController).track(t2, t)) | ||
|
Comment on lines
+20
to
+23
Check warningCode scanning / CodeQL-Community Var only used in one side of disjunct.
The [variable t](1) is only used in one side of disjunct.
|
||
| } | ||
|
|
||
| /* owner component ref */ | ||
Check warningCode scanning / CodeQL-Community Block comment that is not QLDoc
Block comment could be QLDoc for [the below code](1).
|
||
| MethodCallNode getOwnerComponentRef(CustomController customController) { | ||
| result = getOwnerComponentRef(TypeTracker::end(), customController) | ||
| } | ||
| } | ||
|
|
||
| module Test { | ||
| private import semmle.javascript.dataflow.TypeTracking | ||
|
|
||
| private class ObjFieldStep extends SharedTypeTrackingStep { | ||
Check warningCode scanning / CodeQL-Community Dead code
This code is never used, and it's not publicly exported.
|
||
| override predicate step(DataFlow::Node node1, DataFlow::Node node2) { | ||
| exists(DataFlow::SourceNode object, string name | | ||
| methodStepPred(object, name, node1) and | ||
| methodStepSucc(object, name, node2) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| private DataFlow::SourceNode objectWithMethods() { | ||
Check warningCode scanning / CodeQL-Community Dead code
This code is never used, and it's not publicly exported.
|
||
| result.flowsTo(any(DataFlow::CallNode call | call.getCalleeName() = "extend").getAnArgument()) | ||
| } | ||
|
|
||
| private DataFlow::SourceNode getAnAlias(DataFlow::SourceNode object) { | ||
Check warningCode scanning / CodeQL-Community Dead code
This code is never used, and it's not publicly exported.
|
||
| object = objectWithMethods() and | ||
| ( | ||
| result = object | ||
| or | ||
| result = getAnAlias(object).getAPropertySource().(DataFlow::FunctionNode).getReceiver() | ||
| ) | ||
| } | ||
|
|
||
| private predicate methodStepPred(DataFlow::SourceNode object, string name, DataFlow::Node rhs) { | ||
Check warningCode scanning / CodeQL-Community Dead code
This code is never used, and it's not publicly exported.
|
||
| rhs = getAnAlias(object).getAPropertyWrite(name).getRhs() | ||
| } | ||
|
|
||
| private predicate methodStepSucc(DataFlow::SourceNode object, string name, DataFlow::Node read) { | ||
Check warningCode scanning / CodeQL-Community Dead code
This code is never used, and it's not publicly exported.
|
||
| read = getAnAlias(object).getAPropertyRead(name) | ||
| } | ||
| } | ||
Check notice
Code scanning / CodeQL-Community
Field only used in CharPred