JS: Remove code duplication library

This commit is contained in:
Asger Feldthaus
2021-03-25 15:20:59 +00:00
parent c812bd948a
commit 446ad5ec9e
11 changed files with 8 additions and 437 deletions

View File

@@ -16,16 +16,10 @@
*/
import javascript
import CodeDuplication
import semmle.javascript.RestrictedLocations
from Function f, Function g, float percent
where
similarContainers(f, g, percent) and
f.getNumBodyStmt() > 5 and
not duplicateContainers(f, g, _) and
not duplicateContainers(f.getEnclosingStmt().getContainer(), g.getEnclosingStmt().getContainer(),
_)
where none()
select f.(FirstLineOf),
percent.floor() + "% of statements in " + f.describe() + " are similar to statements in $@.",
g.(FirstLineOf), g.describe()