You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
My project contains a class with a private constructor, five getter methods, and an override of toString(). I have configured a Method filter to exclude toString methods. In Metrics in the Cloverage tool window, the value of the Methods metric is 7. In the editor window, the toString method is shown in a grey colour.
Why isn't the value of this metric 6?
Another thing I've noticed is that, after I run all the unit tests in the module that contains my class using a JUnit run configuration, the value of the Methods metric changes to 6. If I then click on the Refresh Coverage button in the Cloverage tool window, the value changes to 7.
Environment: Windows 7 Professional SP1, IntelliJ IDEA 2016.2, Clover plugin version: idea-4.1.1.v20151207000000
Thank you very much for providing code sample. I reproduced the problem. After configuring the method context filter in IDEA, I can see that toString method is excluded in the source view, but not excluded in metrics. It also does not use method filters when exporting it to HTML report. I reported an issue here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The project is a Maven project and we also use the Maven Clover plugin to check test coverage and generate a test coverage report. In the Maven report, the value of the Methods metric is 6 and not 7, which is why I started looking into this.
The class is ...
public enum EditedOperandEnum implements ValuedEnum<String>
{
// Elements
LT( "LT", "<" ),
LE( "LE", "<=" ),
EQ( "EQ", "=" ),
GE( "GE", ">=" ),
GT( "GT", ">" );
/** Default Valued Enumeration */
private static final EditedOperandEnum mDefault = GE;
/** Valued Enumeration Value */
private final String mValue;
/** Valued Enumeration Label */
private final String mLabel;
private EditedOperandEnum( final String value, final String label )
{
mValue = value;
mLabel = label;
}
public String getLabel()
{
return mLabel;
}
public String getName()
{
return name();
}
public int getOrdinal()
{
return ordinal();
}
public String getValue()
{
return mValue;
}
public boolean isDefault()
{
return equals(mDefault);
}
public String toString()
{
return ValuedEnumUtil.toString(this);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone, I am a product manager in the Jira Cloud team focused on making sure our customers have a delightful experience using our products. Towards that goal, one of the areas which is extr...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.