SonarQube规则似乎打破了分析

时间:2016-12-07 14:44:35

标签: c# sonarqube

我已经使用基本设置安装了SonarQube并启用了C# Plugin(目前版本5.5.0.479)中的所有规则,并且这样做,我的分析中断了一些项目(一些运行正常)。我找不到一种方法来找出哪些规则正在破坏,所以我非常费力地通过,以二进制印章样式启用规则以便找到违规规则。我找到了2:

enter image description here

和:

enter image description here

当我启用这些规则中的任何一个并运行分析时,我收到错误:

14:38:58.008 ERROR: Error during SonarQube Scanner execution
14:38:58.008 java.lang.IllegalArgumentException: Start pointer [line=65, lineOffset=0] should be before end pointer [line=65, lineOffset=0]
14:38:58.008    at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
14:38:58.008    at org.sonar.api.batch.fs.internal.DefaultInputFile.newRangeValidPointers(DefaultInputFile.java:254)
14:38:58.008    at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:238)
14:38:58.008    at org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange(SensorContextUtils.java:41)
14:38:58.008    at org.sonarsource.dotnet.shared.plugins.protobuf.IssuesImporter.importMessage(IssuesImporter.java:54)
14:38:58.008    at org.sonarsource.dotnet.shared.plugins.protobuf.IssuesImporter.importMessage(IssuesImporter.java:31)
14:38:58.008    at org.sonarsource.dotnet.shared.plugins.protobuf.AbstractProtobufImporter.accept(AbstractProtobufImporter.java:49)
14:38:58.008    at org.sonarsource.dotnet.shared.plugins.AbstractSensor.parseProtobuf(AbstractSensor.java:80)
14:38:58.009    at org.sonarsource.dotnet.shared.plugins.AbstractSensor.importResults(AbstractSensor.java:70)
14:38:58.009    at org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:114)
14:38:58.009    at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:85)
14:38:58.009    at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
14:38:58.009    at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
14:38:58.009    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
14:38:58.009    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
14:38:58.009    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
14:38:58.009    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
14:38:58.009    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
14:38:58.009    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247)
14:38:58.009    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242)
14:38:58.009    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:240)
14:38:58.009    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232)
14:38:58.009    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
14:38:58.009    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
14:38:58.010    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
14:38:58.010    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
14:38:58.010    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
14:38:58.010    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
14:38:58.010    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
14:38:58.010    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118)
14:38:58.010    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
14:38:58.010    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:38:58.010    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
14:38:58.010    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
14:38:58.010    at java.lang.reflect.Method.invoke(Unknown Source)
14:38:58.010    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
14:38:58.010    at com.sun.proxy.$Proxy0.execute(Unknown Source)
14:38:58.010    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
14:38:58.010    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
14:38:58.010    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
14:38:58.011    at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
14:38:58.011    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
14:38:58.011 ERROR: 
14:38:58.011 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

使用-X运行时未提供任何其他信息。

这是插件或声纳扫描仪的错误还是我错过了什么?

我正在使用sonar-scanner 2.8

1 个答案:

答案 0 :(得分:5)

这是C#插件5.4中的一个错误。 5.5应该通过此票证来修复它:https://jira.sonarsource.com/browse/SONARCS-629,但它只发生在某些版本的MsBuilds上(参见https://jira.sonarsource.com/browse/DOTNETLIB-10)。

正在进行新的修复。