ReSharper 2024.1 Help

Code Inspection: Add parentheses to avoid non-obvious precedence

Category

Syntax Style

ID

ArrangeMissingParentheses

EditorConfig

resharper_arrange_missing_parentheses_highlighting

Default severity

Disabled

Language

C#

Requires SWA

No

In many cases, parentheses in expressions are optional. Sometimes they help you clarify precedence of operations — for example if ((a & b) | c), sometimes, however, they do not help at all and just add up to dead code — var d = a + (b + c);. ReSharper will help you define where optional parentheses are helpful to you, and then either clean up the redundant parenthesis or automatically add missing ones where necessary.

For more information about configuring and enforcing your preferences for optional parentheses, refer to Code Syntax Style: Optional Parentheses.

Last modified: 15 April 2024