roslyn-analyzers icon indicating copy to clipboard operation
roslyn-analyzers copied to clipboard

Avoid multiple conditions in same line for readability

Open bcollamore opened this issue 2 years ago • 1 comments

Investigate 3rd party analyzer or create.

Consider putting each condition on its own line for readability

Originally posted by @ynsehoornenborg in https://github.com/philips-software/roslyn-analyzers/pull/159#discussion_r1045453437

bcollamore avatar Dec 12 '22 13:12 bcollamore

Expected StyleCop to have such a rule, but didn't found it.

To implement this we should check that in an if or ? condition, each && or || operand is immediately followed by an EndOfLineTrivia.

ynsehoornenborg avatar Dec 13 '22 12:12 ynsehoornenborg