我與基本設置安裝SonarQube並啓用所有的規則在C# Plugin(目前版本5.5.0.479),並在此過程中,對於一些項目,我的分析符(一些運行正常)。我無法找到一種方法來找出哪些規則正在破壞,所以我非常費力地通過,以二元砍風格啓用規則以找到違規規則。我發現2:SonarQube規則似乎打破分析
和:
當我啓用其中的任意這些規則和運行分析,我得到的錯誤:
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
運行沒有提供更多信息。
這是與插件或聲納掃描儀BUG或者有我錯過了什麼?
你能告訴我什麼是您使用來構建你的項目的MSBuild的版本? – Tamas