1 Star 0 Fork 0

Z.X.PING/codeql

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SimilarFunction.ql 748 Bytes
一键复制 编辑 原始数据 按行查看 历史
Asger Feldthaus 提交于 2021-03-25 23:20 +08:00 . JS: Remove code duplication library
/**
* @deprecated
* @name Similar function
* @description There is another function that shares a lot of code with this function.
* Extract the common parts to a shared utility function to improve maintainability.
* @kind problem
* @problem.severity recommendation
* @id js/similar-function
* @tags testability
* maintainability
* useless-code
* statistical
* non-attributable
* duplicate-code
* @precision medium
*/
import javascript
import semmle.javascript.RestrictedLocations
from Function f, Function g, float percent
where none()
select f.(FirstLineOf),
percent.floor() + "% of statements in " + f.describe() + " are similar to statements in $@.",
g.(FirstLineOf), g.describe()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Xiphin/codeql.git
git@gitee.com:Xiphin/codeql.git
Xiphin
codeql
codeql
main

搜索帮助