Exclude Setters and Getters in JaCoCo Code Coverage

前端 未结 3 1329
南笙
南笙 2021-02-13 13:46

With the cobertura-maven-plugin setters and getters can be excluded from code coverage using the ignoreTrivial option. Is there also such a possibility

3条回答
  •  温柔的废话
    2021-02-13 14:25

    Not supported officialy, see comments in :

    https://github.com/jacoco/jacoco/issues/15

    mentioned solution:

    It's a long time since this issue is opened. It a really interesting feature. For instance it's implemented in clover and corbetura. There are fork that implement filtering : github.com/huangxiwei/jacoco , https://github.com/mchr3k/jacoco since the begining of the year. Why don't you merge those fork into master branch ? Even if all filtering is not implemented at start, main filters needed are listed in the wiki page you have written (Try with resources, sync block, enum static methods). Coverage is a very useful tool, more it's accruate more it's will be usefull. It helps alot when coverage reach a high value, it helps to focus on the right classes.

提交回复
热议问题