зеркало из https://github.com/github/codeql.git
JavaScript: Round down percentage in `DuplicateToplevel.ql`.
All the other duplication queries already do this.
This commit is contained in:
Родитель
39191ed6f1
Коммит
254fafc6ce
|
@ -22,5 +22,5 @@ from TopLevel one, TopLevel another, float percent
|
|||
where
|
||||
duplicateContainers(one, another, percent) and
|
||||
one.getNumLines() > 5
|
||||
select one.(FirstLineOf), percent + "% of statements in this script are duplicated in $@.",
|
||||
select one.(FirstLineOf), percent.floor() + "% of statements in this script are duplicated in $@.",
|
||||
another.(FirstLineOf), "another script"
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
| a.js:1:1:1:1 | <toplevel> | 90% of statements in this script are duplicated in $@. | e.js:1:1:1:1 | <toplevel> | another script |
|
||||
| a.js:1:1:1:1 | <toplevel> | 100% of statements in this script are duplicated in $@. | b.js:1:1:1:1 | <toplevel> | another script |
|
||||
| b.js:1:1:1:1 | <toplevel> | 90% of statements in this script are duplicated in $@. | e.js:1:1:1:1 | <toplevel> | another script |
|
||||
| b.js:1:1:1:1 | <toplevel> | 100% of statements in this script are duplicated in $@. | a.js:1:1:1:1 | <toplevel> | another script |
|
||||
| e.js:1:1:1:1 | <toplevel> | 90% of statements in this script are duplicated in $@. | a.js:1:1:1:1 | <toplevel> | another script |
|
||||
| e.js:1:1:1:1 | <toplevel> | 90% of statements in this script are duplicated in $@. | b.js:1:1:1:1 | <toplevel> | another script |
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
if (arguments.length == 0)
|
||||
23;
|
||||
if (arguments.length % 2 != 0)
|
||||
42;
|
||||
console.log(arguments[0]);
|
||||
arguments[0]--;
|
||||
arguments[1] += 19;
|
||||
arguments[0] * arguments[1];
|
||||
arguments[2] / arguments[3];
|
||||
arguments[4] % arguments[5];
|
||||
/*arguments[6] % arguments[7]*/;
|
||||
}
|
Загрузка…
Ссылка в новой задаче