我的Codacy仪表板中有很多问题,但这些问题没有出现在我的github存储库中.我想将它们从Codacy导入GitHub以用于存储库管理.
可能吗?如果是这样,我该怎么办?
下面是我的代码。我不认为有任何问题。
我怎么能骗过codacy?如果我不能使用obj[key],那这到底是什么东西?我没有办法避免[]。
handleClick = (e, titleProps) => {
const { index } = titleProps
const newVal = this.state.activeIndexObj[index]? false: true
let activeIndexObj = {...this.state.activeIndexObj}
activeIndexObj[index] = newVal
// Generic Object Injection Sink (security/detect-object-injection)
Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用Codacy,并且收到一条警告,说我不应该使用稍后声明的变量,这是非常合乎逻辑的。然而,这对于构造函数来说应该可以正常工作。
这是我的主要文件结构:
/* Export */
module.exports = myObject; // this line
/* Import */
var otherObject = require('./otherObject');
function myObject(input) {
}
myObject.prototype = {
}
Run Code Online (Sandbox Code Playgroud)
在对象构造函数声明之前导出会出现任何问题吗?我应该将导出线移到构造函数下方吗?
我想从我的测试文件中排除重复检查,但其他所有内容保持不变。
这是我的.codacy.yml文件:
duplication:
enabled: true
exclude_paths:
- 'test/**'
- '**.test.js'
Run Code Online (Sandbox Code Playgroud)
但是我仍然在测试文件中报告了所有重复项。
有谁知道如何做到这一点?
编辑基于我尝试过的以下建议:
engines:
duplication:
enabled: true
exclude_paths:
- 'test/**'
- '**.test.js'
Run Code Online (Sandbox Code Playgroud)
我也试过不加引号:
engines:
duplication:
enabled: true
exclude_paths:
- test/**
- '**.test.js'
Run Code Online (Sandbox Code Playgroud)
仍然没有骰子:(