SonarException:未知度量:临时方法行

本文关键字:方法 度量 未知 SonarException | 更新日期: 2023-09-27 17:58:05

我花了很多小时寻找答案,但没有找到任何解决方案。

我正在为C#项目运行sonar,我使用sonar 3.4和sonar runner 2.0以及C#插件:

  • sonar-csharp-core-plugin-1.4
  • sonar-csharp-xcop-plugin-1.4
  • sonar-csharp-galio-plugin-1.4
  • sonar-csharp-generalme-plugin-1.4
  • sonar-csharp-deps-plugin-1.4
  • sonar-csharp-quid-plugin-1.4
  • sonar-csharp-stylecop-plugin-1.4

在声纳运行人员进行分析后,我得到了异常

线程"main"org.sonarrunner.runner异常:org.sonar.api.utils.SonarException:装饰失败'org.sonar.api.resources.File@243e2c21[key=ApplicationName.cs,dir=,filename=ApplicationName.C,language=C#]'网址:org.sonar.runner.runner.deleteExecution(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.sona.api.utils.SonarException:装饰失败'org.sonar.api.resources.File@243e2c21[key=ApplicationName.cs,dir=,filename=ApplicationName.C,language=C#]'网址:org.sonar.batch.phases.DecoratorsExecutor.executeRecorder(DecoratorsExecutor.java:84)网址:org.sonar.batch.phases.DecoratorsExecutior.decorateResource(DecoratorsExecutor.java:70)网址:org.sonar.batch.phases.DecoratorsExecutior.decorateResource(DecoratorsExecutor.java:63)网址:org.sonar.batch.phases.DecoratorsExecutior.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(BootstrapModules.java:83)网址:org.sonar.batch.bootstrap.Module.start(Module.java:68)网址:org.sonar.batch.batch.execute(batch.java:106)网址:org.sonar.runner.internal.batche.Launcher.executeBatch(Launcher.java:6网址:org.sonar.runner.internal.batche.Launcher.execute(Launcher.java:61)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)位于java.lang.reflect.Method.ioke(Method.java:601)网址:org.sonar.runner.runner.deleteExecution(runner.java:285)…还有3个由:org.sona.api.utils.SonarException引起:未知度量:临时方法行网址:org.sonar.batch.index.DefaultIndex.addMeasure(DefaultIndex.java:184)网址:org.sonar.batch.DefaultDecoratorContext.saveMeasure(DefaultDecoratorContext.java:111)网址:org.sonar.plugins.useless-codetracker.decorator.TempMethodLinesDecorator.comuteDistributionFromChildren(TempMethodLinesDecorator.java:58)网址:org.sonar.plugins.useless-codetracker.decorator.TempMethodLinesDecorator.delecture(TempMethodLinesDecorator.java:49)网址:org.sonar.batch.phases.DecoratorsExecutor.executeRecorder(DecoratorsExecutor.java:79)…还有24个

SonarException:未知度量:临时方法行

我不知道这个"临时方法线"度量是什么,从来没有听说过…

请安装最新版本的.NET&C#插件生态系统:2.0版。此外,请确保卸载任何其他可能带来此未知度量的插件(可能是您编写的自定义插件??)。

由于3.4版本存在严重错误,请升级到Sonar 3.4.1