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
1212import 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
201201from string clsname , string problem , string what
202202where
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 )
209209select clsname + " " + what + " has " + problem
0 commit comments