SonarQube向我展示了这种重复:
1 package pl.com.bernas.ioz.user.domain;
2
3 import java.io.Serializable;
Run Code Online (Sandbox Code Playgroud)
这不是期望的行为.
我可以禁用这种复制吗?但是我根本不想禁用复制规则,或者添加要忽略的类.我可以忽略这个特例吗?
我班上有私人方法.
public class MyClass {
public void method(){
....
List<String> filteredPaths = Arrays.asList(paths).stream().filter(this::validate).collect(Collectors.toList());
....
}
private boolean validate(String path){
...
}
}
Run Code Online (Sandbox Code Playgroud)
我看到主要问题:
Private method 'validate' is never used.
Run Code Online (Sandbox Code Playgroud)
这个问题已知吗?
怎么解决?解决方法?
例如,我希望能够从我的声纳实例中提取所有项目的技术债务编号,并将其显示在页面上.
Sonar是否提供了我可以利用并实现这一目标的api?
我在Eclipse中安装了SonarLint,并且有一个远程设置的sonarQube服务器,但是两者的规则不同。如何在Eclipse的SonarLint上配置与SonarQube相同的规则?
我想仅在未设置时在 javascript 对象中设置值。我的(测试)函数如下所示:
var test = function(){
this.value = {};
this.setValue = function(seperator, newValue){
console.log((this.value[seperator] === "undefined")); //Why both times false?
if(typeof(this.value[seperator] === "undefined")){
this.value[seperator] = newValue;
}else{
//noop
}
console.log(this.value[seperator]);
}
}
var blubb = new test();
blubb .setValue("foo","bar");
blubb .setValue("foo","notme");
Run Code Online (Sandbox Code Playgroud)
在 js 控制台中它返回
false
bar
false
notme
Run Code Online (Sandbox Code Playgroud)
有人能告诉我为什么我的“未定义”测试两次都告诉我没有定义吗?
提前致谢
我正在比较两个值并得到声纳棉绒投掷"Only the sign of the result should be examined" this issue。
代码 :
if (recBalanceAmt.compareTo(recRolloverEligibility) == 1) {
recExpAmt = recBalanceAmt.subtract(recRolloverEligibility);
}
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?
是否有可能手动将插件从一个版本复制到另一个版本?基本上我想将Netbeans 7.3 beta 2中的插件复制到Netbeans 7.3(最终版本).
有问题的插件是JIRA.
Alos如果有人知道如何安装它(我可以手动下载以前版本的插件)
我尝试过很少的东西但是没有用过.
运行SonarQube时,会发现一个名为"异常处理程序应该保留原始异常"的异常.全面例外描述在这里.
我们的意思很清楚.问题是编译器似乎允许我们以下语句(参见Compliant Solution):
try { /* ... */ } catch (Exception e) { LOGGER.info("context", e); }
Run Code Online (Sandbox Code Playgroud)
我们没有使用LOGGER,但是:
trc.traceRaw(DcWxTaTrc.INFO, "Exception <" + e.getMessage() + ">
ignored");
Run Code Online (Sandbox Code Playgroud)
有没有办法允许这种日志记录呢?如果是的话:怎么样?
我试图理解为什么这段代码不能编译.
我有一个实现接口的类.由于某种原因,最后一个方法无法编译.
它不会简单地允许我将集合转换为集合,但允许它返回单个对象.
有人可以向我解释为什么会这样吗?谢谢.
public class Testing2 {
public SortedSet<ITesting> iTests = new TreeSet<ITesting>();
public SortedSet<Testing> tests = new TreeSet<Testing>();
public ITesting iTest = null;
public ITesting test = new Testing();
// Returns the implementing class as expected
public ITesting getITesting(){
return this.test;
}
// This method will not compile
// Type mismatch: cannot convert from SortedSet<Testing> to SortedSet<ITesting>
public SortedSet<ITesting> getITests(){
return this.tests;
}
}
Run Code Online (Sandbox Code Playgroud)