ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Confusing body-like statement

Last modified: 08 November 2024

This inspection reports statements that look like a body of the previous statement and can cause confusion when reading the code.

In the example below, wr.WriteLine("hello"); looks like a nested statement of using. ReSharper suggests removing the indent and separating the statements with a new line to improve readability and avoid ambiguity.