DanielHWe / sonar-fxcop

FxCop plugin for C# or VB.NET projects
13 stars 6 forks source link

sonar.cs.fxcop.project requires sonar.cs.fxcop.assembly #16

Closed DanielHWe closed 6 years ago

DanielHWe commented 6 years ago

If sonar.cs.fxcop.project is supply, then sonar.cs.fxcop.assembly should not be required.

DanielHWe commented 6 years ago

Can be checked with 1.4Beta

ghost commented 6 years ago

I'm still noticing this error with 1.4RC1. I shouldnt need to add anything to my arguments correct? As a side note, what file can i point it to to get past the error?

DanielHWe commented 6 years ago

What is the error message you get and how did you set the configuration (File or Command line Parameter)?

ghost commented 6 years ago

Sorry, I'm getting a different error now. It was the same error the day i posted the message (it must have been a caching issue). The error i'm getting now is below. I must be missing something with my command line options, and I'm running this all through a batch file. I'm using sonar-scanner-3.0.3.778 with the RC1 version of the plugin and sonarqube 6.4.

"C:\SonarScanner\SonarQube.Scanner.MSBuild.exe" begin /key:Services /name:"Services" /version:1.23.45.6 /s:C:\SonarScanner\MainConfig.xml /d:"sonar.cs.fxcop.slnFile=C:\Builds\ci2\2\s\Source\Server\Services\Services.sln" /d:"sonar.cs.fxcop.fxcopath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe" /d:"sonar.cs.fxcop.directory=bin\debug"


java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(Unknown Source)
        at org.sonar.plugins.fxcop.FxCopSensor.TrimWorkdir(FxCopSensor.java:227)
        at org.sonar.plugins.fxcop.FxCopSensor.executeFxCop(FxCopSensor.java:204)
        at org.sonar.plugins.fxcop.FxCopSensor.analyse(FxCopSensor.java:98)
        at org.sonar.plugins.fxcop.FxCopSensor.executeImpl(FxCopSensor.java:86)
        at org.sonar.plugins.fxcop.FxCopSensor.execute(FxCopSensor.java:76)
        at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
        at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
        at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
        at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
        at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
        at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
        at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
        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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
        at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
        at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)```
DanielHWe commented 6 years ago

Please check with RC2 if error is gone

ghost commented 6 years ago

Yep that worked, thanks!