Skip to content

Commit f11cce5

Browse files
author
Max Schaefer
committed
JavaScript: Remove a few other deprecated predicates and classes.
1 parent 0867f01 commit f11cce5

File tree

12 files changed

+0
-220
lines changed

12 files changed

+0
-220
lines changed

javascript/ql/src/semmle/javascript/AMD.qll

-8
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ class AMDModuleDefinition extends CallExpr {
5151
result = getARequireCall().getAnArgument()
5252
}
5353

54-
/**
55-
* DEPRECATED: Use `getFactoryNode` instead.
56-
*
57-
* Gets the factory expression of this module definition,
58-
* which may be a function or a literal.
59-
*/
60-
deprecated Expr getFactoryExpr() { result = getFactoryNode().asExpr() }
61-
6254
/**
6355
* Gets a data flow node containing the factory value of this module definition.
6456
*/

javascript/ql/src/semmle/javascript/CanonicalNames.qll

-14
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,6 @@ class TypeName extends CanonicalName {
221221
*/
222222
TypeReference getATypeReference() { result.getTypeName() = this }
223223

224-
/**
225-
* DEPRECATED. Use `getRelativeName()` or `hasQualifiedName()` instead.
226-
*
227-
* Gets the qualified name without the root.
228-
*/
229-
deprecated string getQualifiedName() { result = getRelativeName() }
230-
231224
/**
232225
* Gets a type named in the `extends` or `implements` clause of this type.
233226
*/
@@ -265,13 +258,6 @@ class Namespace extends CanonicalName {
265258
*/
266259
NamespaceAccess getAnAccess() { result.getNamespace() = this }
267260

268-
/**
269-
* DEPRECATED. Use `getRelativeName()` or `hasQualifiedName()` instead.
270-
*
271-
* Gets the qualified name without the root.
272-
*/
273-
deprecated string getQualifiedName() { result = getRelativeName() }
274-
275261
/** Gets a namespace nested in this one. */
276262
Namespace getNamespaceMember(string name) {
277263
result.getParent() = this and

javascript/ql/src/semmle/javascript/StandardLibrary.qll

-9
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ class DirectEval extends CallExpr {
3333
predicate mayAffect(LocalVariable lv) { getParent+() = lv.getScope().getScopeElement() }
3434
}
3535

36-
/**
37-
* DEPRECATED. Use `JsonParserCall` and the data flow API instead.
38-
*
39-
* A call to `JSON.parse`.
40-
*/
41-
deprecated class JsonParseCall extends MethodCallExpr {
42-
JsonParseCall() { this = DataFlow::globalVarRef("JSON").getAMemberCall("parse").asExpr() }
43-
}
44-
4536
/**
4637
* Flow analysis for `this` expressions inside a function that is called with
4738
* `Array.prototype.map` or a similar Array function that binds `this`.

javascript/ql/src/semmle/javascript/dataflow/Nodes.qll

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ class InvokeNode extends DataFlow::DefaultSourceNode {
2828
/** Gets the name of the function or method being invoked, if it can be determined. */
2929
string getCalleeName() { result = impl.getCalleeName() }
3030

31-
/** DEPRECATED: Use `getCalleeNode()` instead. */
32-
deprecated DataFlow::Node getCallee() { result = getCalleeNode() }
33-
3431
/** Gets the data flow node specifying the function to be called. */
3532
DataFlow::Node getCalleeNode() { result = impl.getCalleeNode() }
3633

javascript/ql/src/semmle/javascript/dataflow/Sources.qll

-12
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,6 @@ abstract class SourceNode extends DataFlow::Node {
5454
result = getAPropertyReference(propName)
5555
}
5656

57-
/**
58-
* DEPRECATED: Use `getAPropertyReference` instead.
59-
*
60-
* Gets an access to property `propName` on this node, either through
61-
* a dot expression (as in `x.propName`) or through an index expression
62-
* (as in `x["propName"]`).
63-
*/
64-
deprecated DataFlow::PropRead getAPropertyAccess(string propName) {
65-
result = getAPropertyReference(propName) and
66-
result.asExpr() instanceof PropAccess
67-
}
68-
6957
/**
7058
* Holds if there is an assignment to property `propName` on this node,
7159
* and the right hand side of the assignment is `rhs`.

javascript/ql/src/semmle/javascript/dataflow/TaintTracking.qll

-39
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ module TaintTracking {
100100

101101
final override predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) {
102102
isAdditionalTaintStep(pred, succ) or
103-
pred = succ.(FlowTarget).getATaintSource() or
104103
any(AdditionalTaintStep dts).step(pred, succ)
105104
}
106105

@@ -145,15 +144,6 @@ module TaintTracking {
145144
abstract class LabeledSanitizerGuardNode extends SanitizerGuardNode,
146145
DataFlow::LabeledBarrierGuardNode { }
147146

148-
/**
149-
* DEPRECATED: Override `Configuration::isAdditionalTaintStep` or use
150-
* `AdditionalTaintStep` instead.
151-
*/
152-
abstract class FlowTarget extends DataFlow::Node {
153-
/** Gets another data flow node from which taint is propagated to this node. */
154-
abstract DataFlow::Node getATaintSource();
155-
}
156-
157147
/**
158148
* A taint-propagating data flow edge that should be added to all taint tracking
159149
* configurations in addition to standard data flow edges.
@@ -172,9 +162,6 @@ module TaintTracking {
172162
abstract predicate step(DataFlow::Node pred, DataFlow::Node succ);
173163
}
174164

175-
/** DEPRECATED: Use `AdditionalTaintStep` instead. */
176-
deprecated class DefaultTaintStep = AdditionalTaintStep;
177-
178165
/**
179166
* A taint propagating data flow edge through object or array elements and
180167
* promises.
@@ -881,30 +868,4 @@ module TaintTracking {
881868

882869
override predicate appliesTo(Configuration cfg) { any() }
883870
}
884-
885-
/**
886-
* An expression that can act as a sanitizer for a variable when appearing
887-
* in a condition.
888-
*
889-
* DEPRECATED: use `AdditionalSanitizerGuardNode` instead.
890-
*/
891-
abstract deprecated class SanitizingGuard extends Expr {
892-
/**
893-
* Holds if this expression sanitizes expression `e` for the purposes of taint-tracking
894-
* configuration `cfg`, provided it evaluates to `outcome`.
895-
*/
896-
abstract predicate sanitizes(Configuration cfg, boolean outcome, Expr e);
897-
}
898-
899-
/**
900-
* Support registration of sanitizers with the deprecated type `SanitizingGuard`.
901-
*/
902-
deprecated private class AdditionalSanitizingGuard extends AdditionalSanitizerGuardNode,
903-
DataFlow::ValueNode {
904-
override SanitizingGuard astNode;
905-
906-
override predicate sanitizes(boolean outcome, Expr e) { astNode.sanitizes(_, outcome, e) }
907-
908-
override predicate appliesTo(Configuration cfg) { astNode.sanitizes(cfg, _, _) }
909-
}
910871
}

javascript/ql/src/semmle/javascript/frameworks/Express.qll

-19
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,6 @@ module Express {
3434
result = DataFlow::moduleMember("express", "Router").getAnInvocation()
3535
}
3636

37-
/**
38-
* DEPRECATED: Use `appCreation()` instead.
39-
*
40-
* Holds if `e` is an expression that creates a new Express application.
41-
*/
42-
deprecated predicate isAppCreation(InvokeExpr e) { e = appCreation().asExpr() }
43-
44-
/**
45-
* DEPRECATED: Use `appCreation()` instead.
46-
*
47-
* Holds if `e` is an Express application object
48-
*/
49-
deprecated predicate isApp(Expr e) { any(Application app).flowsTo(e) }
50-
51-
/**
52-
* Holds if `e` creates an Express router (possibly an application).
53-
*/
54-
deprecated predicate isRouterCreation(InvokeExpr e) { e = routerCreation().asExpr() }
55-
5637
/**
5738
* Holds if `e` may refer to the given `router` object.
5839
*/

javascript/ql/src/semmle/javascript/frameworks/React.qll

-21
Original file line numberDiff line numberDiff line change
@@ -54,32 +54,11 @@ abstract class ReactComponent extends ASTNode {
5454
result.(DataFlow::ThisNode).getBinder().getFunction() = getInstanceMethod(_)
5555
}
5656

57-
/**
58-
* Gets the `this` node in an instance method of this component.
59-
*
60-
* DEPRECATED: Use `getAThisNode` instead.
61-
*/
62-
deprecated DataFlow::SourceNode getAThisAccess() { result = getAThisNode() }
63-
64-
/**
65-
* Gets an access to the `props` object of this component.
66-
*
67-
* DEPRECATED: Use `getADirectPropsAccess` instead.
68-
*/
69-
deprecated DataFlow::SourceNode getAPropsSource() { result = getADirectPropsAccess() }
70-
7157
/**
7258
* Gets an access to the `props` object of this component.
7359
*/
7460
abstract DataFlow::SourceNode getADirectPropsAccess();
7561

76-
/**
77-
* Gets an access to the `state` object of this component.
78-
*
79-
* DEPRECATED: Use `getADirectStateAccess` instead.
80-
*/
81-
deprecated DataFlow::SourceNode getAStateSource() { result = getADirectStateAccess() }
82-
8362
/**
8463
* Gets an access to the `state` object of this component.
8564
*/

javascript/ql/src/semmle/javascript/frameworks/UriLibraries.qll

-34
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ module urijs {
8383
* Provides classes for working with [uri-js](https://github.com/garycourt/uri-js) code.
8484
*/
8585
module uridashjs {
86-
/**
87-
* Gets a data flow source node for the uridashjs library.
88-
*/
89-
deprecated DataFlow::SourceNode uridashjs() { result = DataFlow::moduleImport("uri-js") }
90-
9186
/**
9287
* Gets a data flow source node for member `name` of the uridashjs library.
9388
*/
@@ -121,11 +116,6 @@ module uridashjs {
121116
* Provides classes for working with [punycode](https://github.com/bestiejs/punycode.js) code.
122117
*/
123118
module punycode {
124-
/**
125-
* Gets a data flow source node for the punycode library.
126-
*/
127-
deprecated DataFlow::SourceNode punycode() { result = DataFlow::moduleImport("punycode") }
128-
129119
/**
130120
* Gets a data flow source node for member `name` of the punycode library.
131121
*/
@@ -197,13 +187,6 @@ module urlParse {
197187
* Provides classes for working with [querystringify](https://github.com/unshiftio/querystringify) code.
198188
*/
199189
module querystringify {
200-
/**
201-
* Gets a data flow source node for the querystringify library.
202-
*/
203-
deprecated DataFlow::SourceNode querystringify() {
204-
result = DataFlow::moduleImport("querystringify")
205-
}
206-
207190
/**
208191
* Gets a data flow source node for member `name` of the querystringify library.
209192
*/
@@ -235,13 +218,6 @@ module querystringify {
235218
* Provides classes for working with [query-string](https://github.com/sindresorhus/query-string) code.
236219
*/
237220
module querydashstring {
238-
/**
239-
* Gets a data flow source node for the query-string library.
240-
*/
241-
deprecated DataFlow::SourceNode querydashstring() {
242-
result = DataFlow::moduleImport("query-string")
243-
}
244-
245221
/**
246222
* Gets a data flow source node for member `name` of the query-string library.
247223
*/
@@ -275,11 +251,6 @@ module querydashstring {
275251
* Provides classes for working with [url](https://nodejs.org/api/url.html) code.
276252
*/
277253
module url {
278-
/**
279-
* Gets a data flow source node for the url library.
280-
*/
281-
deprecated DataFlow::SourceNode url() { result = DataFlow::moduleImport("url") }
282-
283254
/**
284255
* Gets a data flow source node for member `name` of the url library.
285256
*/
@@ -310,11 +281,6 @@ module url {
310281
* Provides classes for working with [querystring](https://nodejs.org/api/querystring.html) code.
311282
*/
312283
module querystring {
313-
/**
314-
* Gets a data flow source node for the querystring library.
315-
*/
316-
deprecated DataFlow::SourceNode querystring() { result = DataFlow::moduleImport("querystring") }
317-
318284
/**
319285
* Gets a data flow source node for member `name` of the querystring library.
320286
*/

javascript/ql/src/semmle/javascript/frameworks/jQuery.qll

-24
Original file line numberDiff line numberDiff line change
@@ -57,30 +57,6 @@ class JQueryMethodCall extends CallExpr {
5757
*/
5858
string getMethodName() { result = name }
5959

60-
/**
61-
* DEPRECATED: Use `interpretsArgumentAsHtml` instead.
62-
*
63-
* Holds if this call interprets its arguments as HTML.
64-
*/
65-
deprecated predicate interpretsArgumentsAsHtml() {
66-
name = "addClass" or
67-
name = "after" or
68-
name = "append" or
69-
name = "appendTo" or
70-
name = "before" or
71-
name = "html" or
72-
name = "insertAfter" or
73-
name = "insertBefore" or
74-
name = "parseHTML" or
75-
name = "prepend" or
76-
name = "prependTo" or
77-
name = "prop" or
78-
name = "replaceWith" or
79-
name = "wrap" or
80-
name = "wrapAll" or
81-
name = "wrapInner"
82-
}
83-
8460
/**
8561
* Holds if `e` is an argument that this method may interpret as HTML.
8662
*

javascript/ql/test/query-tests/Security/CWE-079/ReflectedXssWithCustomSanitizer_old.expected

-14
This file was deleted.

javascript/ql/test/query-tests/Security/CWE-079/ReflectedXssWithCustomSanitizer_old.ql

-23
This file was deleted.

0 commit comments

Comments
 (0)