-
Notifications
You must be signed in to change notification settings - Fork 234
Open
Labels
Rule IdeaIdea for a rule that has NOT been specified.Idea for a rule that has NOT been specified.
Description
Description
Do not use is not { }.
This code is confusing, and 99% of the time can be refactored into more readable and less obfuscated code.
In the (very)rare case that this is cleaner, it can be accepted.
Noncompliant code snippet
if(SomeMethod() is not { } token) // Noncompliant
{
DoSomethingWithoutToken();
}
DoSomethingWithToken(token);Compliant code snippet
if(SomeMethod() is { } token) // Compliant
{
DoSomethingWithToken(token);
}
DoSomethingWithoutToken();Metadata
Metadata
Assignees
Labels
Rule IdeaIdea for a rule that has NOT been specified.Idea for a rule that has NOT been specified.