我们在项目中使用AspectJ,在测试覆盖率报告中也使用Jacoco,当前我们面临一个问题,由于AspectJ在编译阶段更改了字节代码,这使得代码覆盖率报告不正确。一个例子是由于AspectJ添加了额外的if-else语句,然后分支覆盖率显示了1/4之类的东西,但实际上在源代码中没有条件分支。有什么好办法告诉Jacoco忽略AspectJ生成的所有代码?
非常感谢。
在Sonar 4.5.6(默认设置)中,我看到Duplicated Blocks消息为
我收到消息的java代码如下: -
package com.jabong.orchestratorservice.adapter.order.endpoints;
import com.jabong.orchestratorservice.adapter.order.request.UpdateOrderStatusReadyShipRequest;
public class UpdateOrderReadyShipEndPoint extends BaseOrderEndPoint {
private final static String API_NAME = "setStatusToReadyToShip";
@Override
public String getSourceEndPoint() {
return new StringBuilder("direct:").append(API_NAME).toString();
}
@Override
public String getDestinationEndPoint() {
return new StringBuilder("bean:orderHelper?method=").append(API_NAME).toString();
}
@Override
protected String getName() {
return API_NAME;
}
@Override
protected String getApiInputClassName() {
return UpdateOrderStatusReadyShipRequest.class.getName();
}
}
Run Code Online (Sandbox Code Playgroud)
UpdateOrderStatusReadyShipRequest 也不导入 UpdateOrderReadyShipEndPoint
package com.jabong.orchestratorservice.adapter.order.request;
public class UpdateOrderStatusReadyShipRequest extends BaseOrderRequest {
Run Code Online (Sandbox Code Playgroud)
有人能告诉我这是什么意思吗?
我正在尝试运行sonarQube
通过cmd安装为Admin:InstallNTService.bat
StartSonar.bat
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2016.03.25 21:09:40 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-5.4\temp
WrapperSimpleApp: Encountered an error running main:java.lang.RuntimeException: Failed to reset file system
java.lang.RuntimeException: Failed to reset file system
at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:125)
at org.sonar.process.monitor.Monitor.startProcesses(Monitor.java:105)
at org.sonar.process.monitor.Monitor.start(Monitor.java:99)
at org.sonar.application.App.start(App.java:51)
at org.sonar.application.App.main(App.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Unknown Source)
Caused by: java.nio.file.AccessDeniedException: …Run Code Online (Sandbox Code Playgroud) 有人能够协助解决下面的错误吗?它发生在运行Java 8u71和Oracle数据库的SonarQube 5.6的启动上.这个实例刚刚从5.2更新.我有Puppet插件并将其卸载为尝试解决错误.我确认启动后Elasticsearch在端口9001上.
2016.06.13 00:16:04 ERROR web[o.s.s.es.BulkIndexer] Fail to execute bulk index request: Bulk[671 index request(s) on index rules and type activeRule]
org.elasticsearch.transport.RemoteTransportException: [sonar-1465791343547][inet[/127.0.0.1:9001]][indices:data/write/bulk]
Caused by: org.elasticsearch.index.mapper.MapperParsingException: The provided routing value [puppet] doesn't match the routing key stored in the document: [puppet:ArrowsAlignment]
at org.elasticsearch.action.index.IndexRequest.process(IndexRequest.java:577) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.action.bulk.TransportBulkAction.executeBulk(TransportBulkAction.java:236) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.action.bulk.TransportBulkAction.doExecute(TransportBulkAction.java:167) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.action.bulk.TransportBulkAction.doExecute(TransportBulkAction.java:67) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.action.support.HandledTransportAction$TransportHandler.messageReceived(HandledTransportAction.java:63) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.action.support.HandledTransportAction$TransportHandler.messageReceived(HandledTransportAction.java:51) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:222) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:114) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) ~[elasticsearch-1.7.5.jar:na]
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296) …Run Code Online (Sandbox Code Playgroud) 我最近尝试从SonarQube 5.6.1 LTS升级到6.0.
我使用了升级指南但是我遇到了数据库迁移错误.
无法执行数据库迁移:org.sonar.db.version.v60.CleanUsurperRootComponents com.microsoft.sqlserver.jdbc.SQLServerException:无法解决等于操作中"SQL_Latin1_General_CP1_CS_AS"和"Latin1_General_CS_AS"之间的排序规则冲突.
我正在使用SQL 2014和SQL_Latin1_General_CP1_CS_AS.
我用于设置以下指南:
SonarQube Setup Gruide for .Net Users v.1.3
Sonar数据库中有157列具有错误的排序规则"Latin1_General_CS_AS".
问候
丹尼尔
在我们的组织中,我们使用带有 C# 插件 5.3.1 的 SonarQube 5.6,我们标记为 Won't Fix 的每个问题都会在下次分析运行时重新打开。有时,当分析再次运行时,问题会被标记为无法修复(之前手动标记)。我们被困在一个圈子里。有任何想法吗?
Sonarqube官方docker镜像,不会持续任何配置更改,如:creating users, changing root password or even installing new plugins.
重新启动容器后,所有配置更改都将消失,安装的插件将丢失.重启后,即使项目的密钥及其先前的QA分析数据也不可用.
使用Sonarqube的官方码头图像时,我们如何保留数据?
Collections.singletonList即使列表中的值是不可变的,SonarLint 似乎也认为是可变的。这是一个错误还是规则不够智能,无法检查列表类型的可变性?
public static final List<String> STRING_LIST = Collections.singletonList("myString");
Run Code Online (Sandbox Code Playgroud)
Collections.immutableList相反,即使列表中的值是可变的,使用似乎也会消除此错误。
public static final List<Point> POINTS = Collections.unmodifiableList(Collections.singletonList(new Point(1, 2)));
Run Code Online (Sandbox Code Playgroud)
以上运行 SonarQube 6.2。
I had configured Jacoco + Sonar in Maven. I am able to generate the coverage reports for unit tests & display the coverage in Sonar as well. But, unable to generate the reports for integration tests. "jacoco-it.exec" is generated but, when I go and open the index.html, it looks empty. But, there are many integration tests got executed & passed as well. In jacoco-sessions.html, it is clearly mentioned about all the classes which are used internally. Please help me if …
尝试扩展以下链接的 Sonarqube 规则以忽略记录器方法中字符串文字的出现。
我在尝试提取方法的方法名称时遇到问题(在基本访问者树的上下文中,它可能不属于我的分析中的方法范围。但在查看 methodInvocation 类型以提取一些方法名称时有一些运气)。
所以我的问题是有没有人有基本访问者树元素的定义列表以及它如何看到不同的语句?
例如 weeLogger.Log(exception, "异常发生");
或者
例如 logger(exception1, "发生异常);
以及有没有人做过类似的事情并分享他们如何从 Base Visitor Tree 类中提取方法名称以使用 Sonarqube 进行分析?
sonarqube ×8
java ×4
jacoco ×2
aspectj ×1
c# ×1
docker ×1
maven ×1
sonarqube5.6 ×1
sql-server ×1