C#

C#

Made by DeepSource

Conditional branch has the same expression in both the branches CS-W1073

Bug risk
Critical

A conditional expression is an expression which contains the code that is to be executed depending on whether a condition is true or false. Having identical expressions for both the true and false branches is likely a mistake and can affect your program's execution path and is therefore recommended that you fix it.

Bad Practice

var name = person != null ? person.Name : person.Name;

Recommended

var name = person != null ? person.Name : null;