Consider the following code:
public void isTeen(int age) {
return age > 10 && age < 20;
}
The return line has two conditionals, and thus has four possible states:
age = 5 : age > 10 = false : age < 20 = true
age = 15 : age > 10 = true : age < 20 = true
age = 25 : age > 10 = true : age < 20 = false
AND...
age = ?? : age > 10 = false : age < 20 = false
The problem is, there is no age where both conditions would evaluate to false. The best conditional coverage possible here therefore is 75% as there are only 3 possible paths that can be taken.
I'm however not sure if this is a problem or possibly a bug in Cobertura. It seems more that this is a special case that could be handled better when conditionals are interdependent. Perhaps this can be solved, perhaps not, but I'm reporting here as I did not see this specific problem before (there was another report that phrased the problem differently using 2 bools, but there was no relationship between them which I think why the report was marked invalid).
Cobertura is (and probably will not be able) to interpret logical conditions. We could try to define special patterns of conditions that can be interpreted. But I don't think we are able to cover the area.
Invalid for me.