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

查看:106
本文介绍了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天全站免登陆