【问题标题】:To exclude the generated code from sonar analysis on Quality violation从质量违规的声纳分析中排除生成的代码
【发布时间】:2013-09-06 07:00:00
【问题描述】:

生成的代码存在于单独的目标文件夹路径中,例如:target/generated-sources/fod1/fod2/*.java

我已经尝试了几个选项,但徒劳无功,请帮助。

<properties>
    <sonar.exclusions>**/generatedsources/fod1/fod2/**/*.java</sonar.exclusions>
</properties>

我也尝试过其中一篇帖子中的选项**/*generated*

【问题讨论】:

    标签: sonarqube


    【解决方案1】:

    请参阅“常规设置”>“排除”页面中的文档。如果您使用的不是太旧的 SonarQube 版本,file:**/generated-sources/** 模式就可以完成这项工作。

    【讨论】:

    • 这是正确的方法吗?? file:/generated-sources/
    • 是的。请注意,在提供的示例中,模式 '/generated-sources/' 前后有两颗星。
    • 我现在有点困惑......我想给“file:**/generated-sources/**”或“file:/generated-sources/”作为模式sonar.exclusions 标签
    • 嗨,我试过 file:/generated-sources/ 。它无法排除:(
    • "file:**/generated-sources/**" 是要使用的模式,这记录在设置 > 排除页面的末尾。此功能自 SonarQube 3.5 起可用,请参阅 jira.codehaus.org/browse/SONAR-2760
    【解决方案2】:

    在 SonarQube 5.4 上,重复项的排除项位于“常规设置”>“分析范围”的“重复项”选项卡上

    【讨论】:

      猜你喜欢
      • 2012-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-12
      • 2019-10-19
      • 2022-07-01
      • 1970-01-01
      相关资源
      最近更新 更多