Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ private static bool ShouldAnalyze(
return false;
}

// Do not analyze operator methods. Regular operators are already required to be static in C#.
// C# 14 compound assignment operators (e.g. operator +=) are required to be instance methods
// and cannot be made static, so flagging them is a false positive.
if (methodSymbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion)
{
return false;
}

// Don't report methods which have a single throw statement
// with NotImplementedException or NotSupportedException
if (context.IsMethodNotImplementedOrSupported())
Expand Down
Loading