C#

C#

Made by DeepSource

Empty if statements should be avoided CS-W1077

Bug risk
Critical
Autofix

If statements allow you to execute code depending on whether the specified condition evaluates to true or false. An empty if statement has no statements in both of its branches and effectively accomplishes nothing. Such statements should be avoided.

Bad Practice

if (numbers.Any(x => x % 2 == 0)) ;

Recommended

if (numbers.Any(x => x % 2 == 0))
{
    // ...
}
else
{
    // ...
}