mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
6
javascript/ql/test/query-tests/external/DuplicateFunction/DuplicateFunction.expected
vendored
Normal file
6
javascript/ql/test/query-tests/external/DuplicateFunction/DuplicateFunction.expected
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
| d/tst.js:1:1:1:14 | functio ... s[1];\\n} | 100% of statements in function f are duplicated in $@. | d/tst.js:12:1:12:14 | functio ... s[1];\\n} | function g |
|
||||
| d/tst.js:1:1:1:14 | functio ... s[1];\\n} | 100% of statements in function f are duplicated in $@. | d/tst.js:23:10:23:21 | functio ... s[1];\\n} | function g2 |
|
||||
| d/tst.js:12:1:12:14 | functio ... s[1];\\n} | 100% of statements in function g are duplicated in $@. | d/tst.js:1:1:1:14 | functio ... s[1];\\n} | function f |
|
||||
| d/tst.js:12:1:12:14 | functio ... s[1];\\n} | 100% of statements in function g are duplicated in $@. | d/tst.js:23:10:23:21 | functio ... s[1];\\n} | function g2 |
|
||||
| d/tst.js:23:10:23:21 | functio ... s[1];\\n} | 100% of statements in function g2 are duplicated in $@. | d/tst.js:1:1:1:14 | functio ... s[1];\\n} | function f |
|
||||
| d/tst.js:23:10:23:21 | functio ... s[1];\\n} | 100% of statements in function g2 are duplicated in $@. | d/tst.js:12:1:12:14 | functio ... s[1];\\n} | function g |
|
||||
1
javascript/ql/test/query-tests/external/DuplicateFunction/DuplicateFunction.qlref
vendored
Normal file
1
javascript/ql/test/query-tests/external/DuplicateFunction/DuplicateFunction.qlref
vendored
Normal file
@@ -0,0 +1 @@
|
||||
external/DuplicateFunction.ql
|
||||
53
javascript/ql/test/query-tests/external/DuplicateFunction/d/tst.js
vendored
Normal file
53
javascript/ql/test/query-tests/external/DuplicateFunction/d/tst.js
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
function f() {
|
||||
if (arguments.length == 0)
|
||||
return 23;
|
||||
if (arguments.length % 2 != 0)
|
||||
return 42;
|
||||
console.log(arguments[0]);
|
||||
arguments[0]--;
|
||||
arguments[1] += 19;
|
||||
return arguments[0] * arguments[1];
|
||||
}
|
||||
|
||||
function g() {
|
||||
if (arguments.length == 0)
|
||||
return 23;
|
||||
if (arguments.length % 2 != 0)
|
||||
return 42;
|
||||
console.log(arguments[0]);
|
||||
arguments[0]--;
|
||||
arguments[1] += 19;
|
||||
return arguments[0] * arguments[1];
|
||||
}
|
||||
|
||||
var g2 = function() {
|
||||
if (arguments.length == 0)
|
||||
return 23;
|
||||
if (arguments.length % 2 != 0)
|
||||
return 42;
|
||||
console.log(arguments[0]);
|
||||
arguments[0]--;
|
||||
arguments[1] += 19;
|
||||
return arguments[0] * arguments[1];
|
||||
}
|
||||
|
||||
// OK: only five statements
|
||||
function h() {
|
||||
if (arguments.length == 0)
|
||||
return 23;
|
||||
if (arguments.length % 2 != 0)
|
||||
return 42;
|
||||
console.log(arguments[0]);
|
||||
arguments[0]--;
|
||||
arguments[1] += 19;
|
||||
}
|
||||
|
||||
function k() {
|
||||
if (arguments.length == 0)
|
||||
return 23;
|
||||
if (arguments.length % 2 != 0)
|
||||
return 42;
|
||||
console.log(arguments[0]);
|
||||
arguments[0]--;
|
||||
arguments[1] += 19;
|
||||
}
|
||||
Reference in New Issue
Block a user