Skip to content

Commit 0678393

Browse files
author
Dave Bartolomeo
committed
JavaScript: Rename sanity -> consistency
1 parent b39d4bc commit 0678393

File tree

12 files changed

+34
-34
lines changed

12 files changed

+34
-34
lines changed

javascript/ql/src/Declarations/UnreachableMethodOverloads.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ predicate signaturesMatch(MethodSignature method, MethodSignature other) {
108108
method.getBody().getThisTypeAnnotation().getType() =
109109
other.getBody().getThisTypeAnnotation().getType()
110110
) and
111-
// The types are compared in matchingCallSignature. This is sanity-check that the textual representation of the type-annotations are somewhat similar.
111+
// The types are compared in matchingCallSignature. This is a consistency check that the textual representation of the type-annotations are somewhat similar.
112112
forall(int i | i in [0 .. -1 + method.getBody().getNumParameter()] |
113113
getParameterTypeAnnotation(method, i) = getParameterTypeAnnotation(other, i)
114114
) and

javascript/ql/src/meta/Sanity.ql renamed to javascript/ql/src/meta/Consistency.ql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* results.
66
* @kind table
77
* @problem.severity error
8-
* @id js/sanity/api-contracts
9-
* @tags sanity
8+
* @id js/consistency/api-contracts
9+
* @tags consistency
1010
*/
1111

1212
import javascript
@@ -66,7 +66,7 @@ predicate uniqueness_error(int number, string what, string problem) {
6666
* is the QL class name of the entity violating the contract, `problem` describes
6767
* the violation, and `what` gives location information where possible.
6868
*/
69-
predicate ast_sanity(string clsname, string problem, string what) {
69+
predicate ast_consistency(string clsname, string problem, string what) {
7070
exists(Locatable l | clsname = l.getAQlClass() |
7171
uniqueness_error(count(l.toString()), "toString", problem) and what = "at " + l.getLocation()
7272
or
@@ -120,7 +120,7 @@ predicate ast_sanity(string clsname, string problem, string what) {
120120
* Holds if a location entity of QL class `clsname` does not have a unique `toString`,
121121
* where `problem` describes the problem and `what` gives location information where possible.
122122
*/
123-
predicate location_sanity(string clsname, string problem, string what) {
123+
predicate location_consistency(string clsname, string problem, string what) {
124124
exists(Location l | clsname = l.getAQlClass() |
125125
uniqueness_error(count(l.toString()), "toString", problem) and what = "at " + l
126126
or
@@ -138,7 +138,7 @@ predicate hasCFG(StmtContainer sc) { not exists(Error err | err.getFile() = sc.g
138138
* is the QL class name of the entity violating the contract, `problem` describes
139139
* the violation, and `what` gives location information.
140140
*/
141-
predicate cfg_sanity(string clsname, string problem, string what) {
141+
predicate cfg_consistency(string clsname, string problem, string what) {
142142
exists(StmtContainer cont | clsname = cont.getAQlClass() and hasCFG(cont) |
143143
uniqueness_error(count(cont.getEntry()), "getEntry", problem) and
144144
what = "at " + cont.getLocation()
@@ -158,7 +158,7 @@ predicate cfg_sanity(string clsname, string problem, string what) {
158158
* is the QL class name of the entity violating the contract, `problem` describes
159159
* the violation, and `what` gives location information.
160160
*/
161-
predicate scope_sanity(string clsname, string problem, string what) {
161+
predicate scope_consistency(string clsname, string problem, string what) {
162162
exists(Scope s | clsname = s.getAQlClass() |
163163
uniqueness_error(count(s.toString()), "toString", problem) and what = "a scope"
164164
or
@@ -180,7 +180,7 @@ predicate scope_sanity(string clsname, string problem, string what) {
180180
* Holds if a JSDoc type expression of QL class `clsname` does not have a unique `toString`,
181181
* where `problem` describes the problem and `what` is the empty string.
182182
*/
183-
predicate jsdoc_sanity(string clsname, string problem, string what) {
183+
predicate jsdoc_consistency(string clsname, string problem, string what) {
184184
exists(JSDocTypeExprParent jsdtep | clsname = jsdtep.getAQlClass() |
185185
uniqueness_error(count(jsdtep.toString()), "toString", problem) and what = ""
186186
)
@@ -190,7 +190,7 @@ predicate jsdoc_sanity(string clsname, string problem, string what) {
190190
* Holds if a variable reference does not refer to a unique variable,
191191
* where `problem` describes the problem and `what` is the name of the variable.
192192
*/
193-
predicate varref_sanity(string clsname, string problem, string what) {
193+
predicate varref_consistency(string clsname, string problem, string what) {
194194
exists(VarRef vr, int n | n = count(vr.getVariable()) and n != 1 |
195195
clsname = vr.getAQlClass() and
196196
what = vr.getName() and
@@ -200,10 +200,10 @@ predicate varref_sanity(string clsname, string problem, string what) {
200200

201201
from string clsname, string problem, string what
202202
where
203-
ast_sanity(clsname, problem, what) or
204-
location_sanity(clsname, problem, what) or
205-
scope_sanity(clsname, problem, what) or
206-
cfg_sanity(clsname, problem, what) or
207-
jsdoc_sanity(clsname, problem, what) or
208-
varref_sanity(clsname, problem, what)
203+
ast_consistency(clsname, problem, what) or
204+
location_consistency(clsname, problem, what) or
205+
scope_consistency(clsname, problem, what) or
206+
cfg_consistency(clsname, problem, what) or
207+
jsdoc_consistency(clsname, problem, what) or
208+
varref_consistency(clsname, problem, what)
209209
select clsname + " " + what + " has " + problem

javascript/ql/src/meta/SSA/DeadDef.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @description Each SSA definition should have at least one use.
44
* @kind problem
55
* @problem.severity error
6-
* @id js/sanity/dead-ssa-definition
7-
* @tags sanity
6+
* @id js/consistency/dead-ssa-definition
7+
* @tags consistency
88
*/
99

1010
import javascript

javascript/ql/src/meta/SSA/Dominance.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* definition.
55
* @kind problem
66
* @problem.severity error
7-
* @id js/sanity/non-dominating-ssa-definition
8-
* @tags sanity
7+
* @id js/consistency/non-dominating-ssa-definition
8+
* @tags consistency
99
*/
1010

1111
import javascript

javascript/ql/src/meta/SSA/MultipleDefs.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* exactly one SSA variable.
55
* @kind problem
66
* @problem.severity error
7-
* @id js/sanity/ambiguous-ssa-definition
8-
* @tags sanity
7+
* @id js/consistency/ambiguous-ssa-definition
8+
* @tags consistency
99
*/
1010

1111
import javascript

javascript/ql/src/meta/SSA/MultipleRefinementInputs.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @description Every SSA refinement node should have exactly one input.
44
* @kind problem
55
* @problem.severity error
6-
* @id js/sanity/ambiguous-refinement-node
7-
* @tags sanity
6+
* @id js/consistency/ambiguous-refinement-node
7+
* @tags consistency
88
*/
99

1010
import javascript

javascript/ql/src/meta/SSA/NoDefs.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* exactly one SSA variable.
55
* @kind problem
66
* @problem.severity error
7-
* @id js/sanity/dead-ssa-use
8-
* @tags sanity
7+
* @id js/consistency/dead-ssa-use
8+
* @tags consistency
99
*/
1010

1111
import javascript

javascript/ql/src/meta/SSA/NoPhiInputs.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @description Every SSA phi node should have two or more inputs.
44
* @kind problem
55
* @problem.severity error
6-
* @id js/sanity/dead-phi-node
7-
* @tags sanity
6+
* @id js/consistency/dead-phi-node
7+
* @tags consistency
88
*/
99

1010
import javascript

javascript/ql/src/meta/SSA/NoRefinementInputs.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @description Every SSA refinement node should have exactly one input.
44
* @kind problem
55
* @problem.severity error
6-
* @id js/sanity/dead-refinement-node
7-
* @tags sanity
6+
* @id js/consistency/dead-refinement-node
7+
* @tags consistency
88
*/
99

1010
import javascript

javascript/ql/src/meta/SSA/SinglePhiInput.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @description Every SSA phi node should have two or more inputs.
44
* @kind problem
55
* @problem.severity error
6-
* @id js/sanity/trivial-phi-node
7-
* @tags sanity
6+
* @id js/consistency/trivial-phi-node
7+
* @tags consistency
88
*/
99

1010
import javascript

0 commit comments

Comments
 (0)