[Suggestion] Exclude methods based on complexity

42 views
Skip to first unread message

joao.r....@gmail.com

unread,
Sep 17, 2015, 6:59:59 AM9/17/15
to JaCoCo and EclEmma Users
Hi, I've been using Jacoco for some time now and decided to share this suggestion, hope it will be considered:
Besides the already existing excludes by name, how about having the option of excluding methods that have complexity 1?
This would solve the problem with excluding getters/setters and trivial constructors and seems to be something that Jacoco already knows how to deal with.

Sorry if this is duplicated but my searches found nothing similar.
What are your thoughts on this?

Marc R. Hoffmann

unread,
Sep 17, 2015, 3:45:32 PM9/17/15
to jac...@googlegroups.com
Nice idea. But filtering all methods with complexity 1 seems a bit broad
to me.

Filtering in JaCoCo will require a detailed analysis of the method
bodies anyways, so plain setters and getters should be identifiable,
e.g. if method setFirstName() just assignes a value to field firstname.
If the same method assigns a value to field secondname this is most
likely a bug and the method should not be excluded.

Regards,
-marc
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages