False positive on rule csharpsquid:S1854

Hello @julhenau,

Thank you for opening this issue. Your feedback helps us improve our products.

This is not a false positive because you still have an unused assignment in the last statement.

int id = 1; 
c.f(new c2(id++)); // this could be translated as c.f(new c2(id = id + 1)); there is an assignment here that is not used.

In this case, to not raise an issue, it would be better to replace the last statement with c.f(new c5(id + 1)); - so you use the new desired value, but you don’t produce a variable that is unused.

Best Regards,
Mary