[英]SonarQube MSBuild runner fails on deactivated rule
SonarQube MSBuild runner fails if I deactivate FxCop rule in quality profile: 如果我停用质量配置文件中的FxCop规则,SonarQube MSBuild运行器将失败:
Unable to find the rule key corresponding to the rule config key 'CA1305' in in repository "fxcop". 在存储库“ fxcop”中找不到与规则配置密钥“ CA1305”相对应的规则密钥。
I've bulk-added all the fxcop rules. 我已经批量添加了所有fxcop规则。 Added a project.
添加了一个项目。 Then then deactivated some rules in quality profile and tried to analyze new project.
然后停用质量配置文件中的一些规则,并尝试分析新项目。 Even there was NOT any violations of this rule in code - runner still fails with this weird error.
即使代码中没有任何违反此规则的情况-运行程序仍然会因此奇怪的错误而失败。
I suspect that you are somehow importing an FxCop report that contains CA1305
issues after you disabled the rule in your repository. 我怀疑您在禁用存储库中的规则后以某种方式导入了包含
CA1305
问题的FxCop报告。
The error message you see is being generated here, and this method is only called during the parsing of the FxCop report: https://github.com/SonarCommunity/sonar-fxcop-library/blob/1.3/src/main/java/org/sonar/plugins/fxcop/FxCopSensor.java#L179 您在此处生成的错误消息正在生成,并且仅在FxCop报告解析期间调用此方法: https : //github.com/SonarCommunity/sonar-fxcop-library/blob/1.3/src/main/java/ org / sonar / plugins / fxcop / FxCopSensor.java#L179
Could you try: 您可以尝试:
CA1305
rule in your quality profile CA1305
规则 MSBuild.SonarQube.Runner begin /k:... /n:... /v:...
MSBuild.SonarQube.Runner begin /k:... /n:... /v:...
msbuild /t:rebuild
MSBuild.SonarQube.Runner end
Then, could you verify that: 然后,您可以验证一下:
.sonarqube\\conf\\SonarQubeFxCop-cs.ruleset
, you don't see an entry for CA1305
.sonarqube\\conf\\SonarQubeFxCop-cs.ruleset
,您看不到CA1305
的条目。 .sonarqube\\out\\*\\ProjectInfo.xml
- look for the <AnalysisResult Id="FxCop" Location="..."
.sonarqube\\out\\*\\ProjectInfo.xml
找到FxCop报告的位置-查找<AnalysisResult Id="FxCop" Location="..."
CA1305
CA1305
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.