我一直在寻找答案好几个小时,但我没有找到任何解决方案。
我正在为 C# 项目运行声纳,我使用 Sonar 3.4 和 sonar-runner 2.0 以及 C# 插件:
- 声纳-csharp-core-plugin-1.4
- 声纳-csharp-fxcop-plugin-1.4
- 声纳-csharp-gallio-plugin-1.4
- 声纳-csharp-gendarme-plugin-1.4
- 声纳-csharp-ndeps-plugin-1.4
- 声纳-csharp-squid-plugin-1.4
- 声纳-csharp-stylecop-plugin-1.4
在通过 sonar-runner 运行分析后,我得到了那个异常
线程“主”org.sonar.runner.RunnerException 中的异常:org.sonar.api.utils.SonarException:无法装饰 'org.sonar.api.resources.File@243e2c21[key=ApplicationName.cs,dir=,filename =ApplicationName.cs,语言=C#]'
在 org.sonar.runner.Runner.delegateExecution(Runner.java:288)
在 org.sonar.runner.Runner.execute(Runner.java:151)
在 org.sonar.runner.Main.execute(Main.java:84)
在 org.sonar.runner.Main.main(Main.java:56)
引起:org.sonar.api.utils.SonarException: 装饰失败'org.sonar.api.resources.File@243e2c21[key=ApplicationName.cs,dir=,filename=ApplicationName.cs,language=C#]'
在 org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:84)
在 org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:70)
在 org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:63)
在 org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:63)
在 org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:55)
在 org.sonar.batch.phases.Phases.execute(Phases.java:92)
在 org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:129)
在 org.sonar.batch.bootstrap.Module.start(Module.java:68)
在 org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:147)
在 org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:141)
在 org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:136)
在 org.sonar.batch.bootstrap.Module.start(Module.java:68)
在 org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:83)
在 org.sonar.batch.bootstrap.Module.start(Module.java:68)
在 org.sonar.batch.Batch.execute(Batch.java:106)
在 org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:6
在 org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:61)
在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在 java.lang.reflect.Method.invoke(Method.java:601)
在 org.sonar.runner.Runner.delegateExecution(Runner.java:285)
... 3 更多
引起:org.sonar.api.utils.SonarException:未知指标:temp-method-lines
在 org.sonar.batch.index.DefaultIndex.addMeasure(DefaultIndex.java:184)
在 org.sonar.batch.DefaultDecoratorContext.saveMeasure(DefaultDecoratorContext.java:111)
在 org.sonar.plugins.uselesscodetracker.decorator.TempMethodLinesDecorator.computeDistributionFromChildren(TempMethodLinesDecorator.java:58)
在 org.sonar.plugins.uselesscodetracker.decorator.TempMethodLinesDecorator.decorate(TempMethodLinesDecorator.java:49)
在 org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:79)
... 24 更多