SonarQube 4 - 如何在升级期间保持误报违规 [英] SonarQube 4 - how to keep the false-positive violations during upgrade

查看:21
本文介绍了SonarQube 4 - 如何在升级期间保持误报违规的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 SonarQube UI 设置了很多误报违规行为.您能否建议在升级期间如何保持这些误报违规?我们正在尝试将 Sonar 从 3.5.1 升级到 4.0,似乎那些误报违规已被删除.

We set a lot of false-positive violations using SonarQube UI. Can you advise how to keep those false-positive violations during upgrade? We are trying to upgrade Sonar from 3.5.1 to 4.0 and it seems that the those false-positive violations were removed.

推荐答案

您可以做的一件事是导出误报列表,以便您至少知道它们是什么以及它们附加到哪些文件/问题.我不确定如何导入列表,但在最坏的情况下,您可以在首先检查导出的列表后再次将违规标记为误报.

One thing you can do is export the list of false positives so that you will at least know what they are and which files/issues they are attached to. I'm not sure how to then import the list, but in the worst case you can just mark violations as false-positive again, after first checking against the exported list.

获取误报列表的Sonar Rest API查询如下.它适用于 Sonar 3.2,但我不确定它是否适用于您的特定版本.它不适用于 SonarQube 4.5.4 和可能的其他版本,但我不知道.

The Sonar Rest API query to obtain the list of false positives is as follows. It worked in Sonar 3.2, but I'm not sure if it works in your particular version. It does not work in SonarQube 4.5.4 and possibly other versions, but I don't know.

http://sonar.your-server.com/api/reviews?resource=com.yourpackage.yourcomponent:yourtag&review_type=FALSE-POSITIVE&format=json

这篇关于SonarQube 4 - 如何在升级期间保持误报违规的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆