Property | Value |
---|---|
Id | RCS1077 |
Category | Simplification |
Default Severity | Info |
Enabled by Default | ✓ |
Supports Fade-Out | - |
Supports Fade-Out Analyzer | - |
bool x = items.Where(f => string.IsNullOrEmpty(f)).Any(); // RCS1077
bool x = items.Any(f => string.IsNullOrEmpty(f));
IEnumerable<Foo> x = items.Where(f => f is Foo).Cast<Foo>(); // RCS1077
IEnumerable<Foo> x = items.OfType<Foo>();
bool x = items.Where((f) => !string.IsNullOrEmpty(f)).Any(f => f.StartsWith("a")); // RCS1077
bool x = items.Any((f) => !string.IsNullOrEmpty(f) && f.StartsWith("a"));
[assembly: SuppressMessage("Simplification", "RCS1077:Simplify LINQ method chain.", Justification = "<Pending>")]
#pragma warning disable RCS1077 // Simplify LINQ method chain.
#pragma warning restore RCS1077 // Simplify LINQ method chain.
(Generated with DotMarkdown)