Skip to content

Commit 18ab066

Browse files
committed
JS: Remove OK comments that don't provide further explanation
1 parent c2b65b1 commit 18ab066

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

javascript/ql/test/query-tests/Security/CWE-020/IncompleteUrlSubstringSanitization/tst-IncompleteUrlSubstringSanitization.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,55 +13,55 @@
1313

1414
x.startsWith("https://secure.com"); // $ Alert
1515
x.endsWith("secure.com"); // $ Alert
16-
x.endsWith(".secure.com"); // OK
17-
x.startsWith("secure.com/"); // OK
18-
x.indexOf("secure.com/") === 0; // OK
16+
x.endsWith(".secure.com");
17+
x.startsWith("secure.com/");
18+
x.indexOf("secure.com/") === 0;
1919

2020
x.includes("secure.com"); // $ Alert
2121

22-
x.indexOf("#") !== -1; // OK
23-
x.indexOf(":") !== -1; // OK
24-
x.indexOf(":/") !== -1; // OK
25-
x.indexOf("://") !== -1; // OK
26-
x.indexOf("//") !== -1; // OK
27-
x.indexOf(":443") !== -1; // OK
28-
x.indexOf("/some/path/") !== -1; // OK
29-
x.indexOf("some/path") !== -1; // OK
30-
x.indexOf("/index.html") !== -1; // OK
31-
x.indexOf(":template:") !== -1; // OK
22+
x.indexOf("#") !== -1;
23+
x.indexOf(":") !== -1;
24+
x.indexOf(":/") !== -1;
25+
x.indexOf("://") !== -1;
26+
x.indexOf("//") !== -1;
27+
x.indexOf(":443") !== -1;
28+
x.indexOf("/some/path/") !== -1;
29+
x.indexOf("some/path") !== -1;
30+
x.indexOf("/index.html") !== -1;
31+
x.indexOf(":template:") !== -1;
3232
x.indexOf("https://secure.com") !== -1; // $ Alert
3333
x.indexOf("https://secure.com:443") !== -1; // $ Alert
3434
x.indexOf("https://secure.com/") !== -1; // $ Alert
3535

3636
x.indexOf(".cn") !== -1; // $ MISSING: Alert
37-
x.indexOf(".jpg") !== -1; // OK
38-
x.indexOf("index.html") !== -1; // OK
39-
x.indexOf("index.js") !== -1; // OK
40-
x.indexOf("index.php") !== -1; // OK
41-
x.indexOf("index.css") !== -1; // OK
37+
x.indexOf(".jpg") !== -1;
38+
x.indexOf("index.html") !== -1;
39+
x.indexOf("index.js") !== -1;
40+
x.indexOf("index.php") !== -1;
41+
x.indexOf("index.css") !== -1;
4242

4343
x.indexOf("secure=true") !== -1; // OK (query param)
4444
x.indexOf("&auth=") !== -1; // OK (query param)
4545

4646
x.indexOf(getCurrentDomain()) !== -1; // $ MISSING: Alert
4747
x.indexOf(location.origin) !== -1; // $ MISSING: Alert
4848

49-
x.indexOf("tar.gz") + offset; // OK
50-
x.indexOf("tar.gz") - offset; // OK
49+
x.indexOf("tar.gz") + offset;
50+
x.indexOf("tar.gz") - offset;
5151

5252
x.indexOf("https://example.internal") !== -1; // $ Alert
53-
x.indexOf("https://") !== -1; // OK
53+
x.indexOf("https://") !== -1;
5454

5555
x.startsWith("https://example.internal"); // $ Alert
5656
x.indexOf('https://example.internal.org') !== 0; // $ Alert
5757
x.indexOf('https://example.internal.org') === 0; // $ Alert
5858
x.endsWith("internal.com"); // $ Alert
59-
x.startsWith("https://example.internal:80"); // OK
59+
x.startsWith("https://example.internal:80");
6060

6161
x.indexOf("secure.com") !== -1; // $ Alert
62-
x.indexOf("secure.com") === -1; // OK
63-
!(x.indexOf("secure.com") !== -1); // OK
64-
!x.includes("secure.com"); // OK
62+
x.indexOf("secure.com") === -1;
63+
!(x.indexOf("secure.com") !== -1);
64+
!x.includes("secure.com");
6565

6666
if(!x.includes("secure.com")) { // $ Alert
6767

0 commit comments

Comments
 (0)