【问题标题】:Can anyone help me in exporting Sonarqube rules which are Inactive using Web API?谁能帮我导出使用 Web API 不活动的 Sonarqube 规则?
【发布时间】:2017-02-06 22:56:53
【问题描述】:

我目前正在使用 SonarQube v5.6,并且正在尝试导出不活动的规则列表。
我们可以通过 UI 获取“BackUp”活动规则,但我正在尝试使用 Sonarqube 在命令行上支持的 Web API 来执行此操作

例如: 我正在尝试导出在 sonarqube 中不活动的规则: http://$sonarqubeServer/coding_rules#qprofile=$key|activation=false

谁能帮我解决这个问题?

【问题讨论】:

    标签: shell command-line sonarqube sonarqube5.1 sonarqube-web


    【解决方案1】:

    SonarQube Web API 有很好的文档记录(可从服务器的页脚访问)。 api/rules 提供 api/rules/search ,它接受一堆参数,包括:

    • 激活 - 过滤在所选质量配置文件上激活或停用的规则。如果参数 'qprofile' 不是,则忽略 设置。
    • qprofile - 要过滤的质量配置文件的关键。仅在设置了参数“激活”时使用。

    底线,UI 中的这个请求: https://sonarqube.com/coding_rules#activation=false|qprofile=js-sonar-way-56838

    相当于这个Web API请求:

    https://sonarqube.com/api/rules/search?activation=no&qprofile=js-sonar-way-56838
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-26
      • 1970-01-01
      • 1970-01-01
      • 2011-01-15
      • 2014-08-23
      • 2015-01-10
      • 2019-01-21
      相关资源
      最近更新 更多