SonarQube 在代码分析中忽略 getter/setter [英] SonarQube ignore getter/setters in code analysis

查看:20
本文介绍了SonarQube 在代码分析中忽略 getter/setter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SonarQube 仪表板中是否有允许忽略 getter 和 setter 的设置?这听起来比在代码库中的每个方法上编码//nopmd 更好.

Is there a setting in SonarQube dashboard that allows for ignoring getter and setters? This sounds like a better option then coding //nopmd on every method in your codebase.

我的代码库有很多,它们大大降低了我在 Sonarqube 仪表板中报告的单元测试覆盖率%

My codebase has a lot of them and they are dramatically lowering my unit test coverage % being reported in the Sonarqube dashboard

推荐答案

没有选项可以忽略 getter 和 setter.但是,如果您希望从覆盖率计算中完全省略类,则可以使用 排除.

There is no option to ignore getters and setters. However, if you have classes you'd like omitted entirely from coverage calculations, you can easily do so with exclusions.

这篇关于SonarQube 在代码分析中忽略 getter/setter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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