Q: For some statements in my code Clover reports "No Coverage information gathered for this expression". What does that mean?
Clover will not measure coverage of a conditional expression if it contains an assignment operator. In practice we have found this only a minor limitation. To understand why Clover has this limitation, consider the following (very contrived) code fragment:
During compilation, most compilers can inspect the logic of the conditional at
(3) to determine that
"j" will be initialized by the time it is referenced
(4), since evaluating the expression
(3) will always result in
"j" being given a value. So the code will compile. But Clover has to rewrite the conditional at
(3) so that it can measure coverage, and the rewritten version makes it harder for compilers to infer the state of
"j" when it is referenced at
(4). This means that the instrumented version may not compile. For this reason, Clover scans conditionals for assignment. If one is detected, the conditional is not instrumented.