Merge branch 'master' into js/invalid-entity-transcoding

This commit is contained in:
Max Schaefer
2018-11-30 16:49:20 +00:00
committed by GitHub
89 changed files with 1313 additions and 65 deletions

View File

@@ -0,0 +1,3 @@
| constant.js:2:7:2:11 | 1 > 2 | The condition '1 > 2' is always false. |
| constant.js:3:7:3:11 | 1 > 0 | The condition '1 > 0' is always true. |
| example.js:8:7:8:13 | i < end | The condition 'i < end' is always false. |

View File

@@ -0,0 +1 @@
Statements/UselessComparisonTest.ql

View File

@@ -0,0 +1,4 @@
function f() {
if (1 > 2) {} else {} // NOT OK - always false
if (1 > 0) {} else {} // NOT OK - always true
}

View File

@@ -0,0 +1,12 @@
function findValue(values, x, start, end) {
let i;
for (i = start; i < end; ++i) {
if (values[i] === x) {
return i;
}
}
if (i < end) {
return i;
}
return -1;
}

View File

@@ -0,0 +1,8 @@
function findValue(values, x, start, end) {
for (let i = start; i < end; ++i) {
if (values[i] === x) {
return i;
}
}
return -1;
}