Consider the following expression which is commonly used for conditional rendering in React:
{props.corridors.length > 0 && <br />}
When fully tested its coverage ratio will never exceed 50% as there’s no way to arrive at the scenario where the second operand (<br />
) happens to be false. Do we have any workarounds to tell sonar that this expression can only really end up in one of two states and it shouldn’t be considering all four possibilities?