Files
codeql/javascript/ql/src/external/DuplicateToplevel.ql
2021-03-25 15:20:59 +00:00

25 lines
723 B
Plaintext

/**
* @deprecated
* @name Duplicate script
* @description There is another script that shares a lot of code with this script. Consider combining the
* two scripts to improve maintainability.
* @kind problem
* @problem.severity recommendation
* @id js/duplicate-script
* @tags testability
* maintainability
* useless-code
* statistical
* non-attributable
* duplicate-code
* @precision medium
*/
import javascript
import semmle.javascript.RestrictedLocations
from TopLevel one, TopLevel another, float percent
where none()
select one.(FirstLineOf), percent.floor() + "% of statements in this script are duplicated in $@.",
another.(FirstLineOf), "another script"