2

我是声纳新手。我在使用宪兵规则时遇到问题,但没有这些规则,它可以正常工作。

这是调试模式下的错误(sonar-runner -X):

14:19:22.637 DEBUG - No assembly specified: will look into 'csproj' files to 
find which should be analyzed. 
14:19:22.638 DEBUG - Fallback to directory 
C:\Users\soaint002\Documents\Visual Studio 
2010\Projects\WindowsFormAlan\.\WindowsFormAlan\bin\Debug for project 
WindowsFormAlan 
14:19:22.638 DEBUG - - Gendarme program    : C:\Program Files 
(x86)\gendarme-2.10-bin\gendarme.exe 
14:19:22.639 DEBUG - - Config file         : 
C:\Users\soaint002\Documents\Visual Studio 
2010\Projects\WindowsFormAlan\WindowsFormAlan\.sonar\sonar.Gendarme 
14:19:22.639 DEBUG - - Report file         : 
C:\Users\soaint002\Documents\Visual Studio 
2010\Projects\WindowsFormAlan\WindowsFormAlan\.sonar\gendarme-report.xml 
14:19:22.639 DEBUG - - Quiet output 
14:19:22.639 DEBUG - - Confidence          : normal+ 
14:19:22.639 DEBUG - - Severity            : all 
14:19:22.640 DEBUG - - Scanned assemblies  : 
14:19:22.640 DEBUG -    o C:\Users\soaint002\Documents\Visual Studio 
2010\Projects\WindowsFormAlan\.\WindowsFormAlan\bin\Debug\WindowsFormAlan.exe 
14:19:22.640 INFO  - Executing command: C:\Program Files 
(x86)\gendarme-2.10-bin\gendarme.exe --config 
C:\Users\soaint002\Documents\Visual Studio 
2010\Projects\WindowsFormAlan\WindowsFormAlan\.sonar\sonar.Gendarme - 
-xml C:\Users\soaint002\Documents\Visual Studio 
2010\Projects\WindowsFormAlan\WindowsFormAlan\.sonar\gendarme-report.xml 
--quiet --confidence normal+ --severity all 
C:\Users\soaint002\Documents\Visual Studio 2010\Pr 
ojects\WindowsFormAlan\.\WindowsFormAlan\bin\Debug\WindowsFormAlan.exe 
14:19:22.770 INFO  - 
14:19:22.771 INFO  - An uncaught exception occured. Please fill a bug report 
at https://bugzilla.novell.com/
14:19:22.772 INFO  - Stack trace: System.Xml.XmlException: The value 'null' 
could not be converted into the property MaximumDepth type for rule 
AvoidDeepInheritanceTreeRule.  Review your configuration file. 
14:19:22.772 INFO  -    at Gendarme.Settings.SetCustomParameters(XmlNode 
nodes) 
14:19:22.772 INFO  -    at Gendarme.Settings.Load() 
14:19:22.772 INFO  -    at Gendarme.ConsoleRunner.Execute(String[] args) 
14:19:22.779 DEBUG - Release semaphore on project : 
org.sonar.api.resources.Project@3da72e31[id=1092,key=SAS:WindowsFormSAlan,qualifier=TRK], 
with key batch-SAS:WindowsFormSAlan 
14:19:22.838 DEBUG - To prevent a memory leak, the JDBC Driver 
[com.mysql.jdbc.Driver] has been forcibly deregistered 
INFO: 
------------------------------------------------------------------------ 
INFO: EXECUTION FAILURE 
INFO: 
------------------------------------------------------------------------ 
Total time: 6.848s 
Final Memory: 15M/341M 
INFO: 
------------------------------------------------------------------------ 
ERROR: Error during Sonar runner execution 
org.sonar.runner.impl.RunnerException: Unable to execute Sonar 
        at 
org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91) 
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) 
        at java.security.AccessController.doPrivileged(Native Method) 
        at 
org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) 
        at 
org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) 
        at 
org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) 
        at org.sonar.runner.api.Runner.execute(Runner.java:100) 
        at org.sonar.runner.Main.executeTask(Main.java:70) 
        at org.sonar.runner.Main.execute(Main.java:59) 
        at org.sonar.runner.Main.main(Main.java:53) 
Caused by: org.sonar.api.utils.SonarException: Gendarme execution failed. 
        at 
org.sonar.plugins.csharp.gendarme.GendarmeSensor.analyse(GendarmeSensor.java:175) 
        at 
org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79) 
        at 
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70) 
        at 
org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:131) 
        at 
org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:178) 
        at 
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) 
        at 
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) 
        at 
org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:199) 
        at 
org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:194) 
        at 
org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:192) 
        at 
org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:187) 
        at 
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) 
        at 
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) 
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:56) 
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:44) 
        at 
org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82) 
        at 
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) 
        at 
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) 
        at 
org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:175) 
        at 
org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:163) 
        at 
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) 
        at 
org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) 
        at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92) 
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74) 
        at 
org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) 
        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.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) 
        ... 9 more 
Caused by: org.sonar.dotnet.tools.gendarme.GendarmeException: Gendarme 
analysis failed: execution was interrupted by a non-handled exception. This 
is likely a bug inside Gendarme and should be reported on Novell's b 
ugzilla (http://bugzilla.novell.com) or on the mailing-list. 
        at 
org.sonar.dotnet.tools.gendarme.GendarmeRunner.execute(GendarmeRunner.java:124) 
        at 
org.sonar.plugins.csharp.gendarme.GendarmeSensor.launchGendarme(GendarmeSensor.java:221) 
        at 
org.sonar.plugins.csharp.gendarme.GendarmeSensor.analyse(GendarmeSensor.java:173) 


声纳-project.properties:

# Required metadata 
sonar.projectKey=SAS:WindowsFormSAlan 
sonar.projectName=WindowsFormSAlan 
sonar.projectVersion=1.2 

# Comma-separated paths to directories with sources (required) 
sonar.sources=. 
# Language 
sonar.language=cs 
sonar.gallio.mode=skip 

# Encoding of the source files 
sonar.sourceEncoding=UTF-8 


我安装了以下插件列表。我还需要安装其他插件吗?

  • 声纳-csharp-plugin-3.1
  • 声纳-dotnet-gendarme-plugin-2.0
  • 声纳-dotnet-ndeps-plugin-2.0
  • 声纳-dotnet-plugin-2.0
4

1 回答 1

1

所有 dotnet 插件版本必须具有相同的版本。
如果不是,将不兼容。

于 2015-04-11T21:44:11.963 回答