Base Types - prodot/ReCommended-Extension GitHub Wiki

Base Types

Suggests replacing expressions with equivalent expressions that are more readable or improving performance. The analyzer doesn't make any suggestions if the current language version doesn't support the replacement or the target framework doesn't contain the target method (or method overload).

  • Suggests removing a redundant argument when an equivalent overloaded method exists that doesn't require such an argument value (usually null or 0).
  • Suggests replacing an expression with a known result.
  • Suggests removing redundant method invocations when specified arguments would not cause any change.
  • Suggests using an equivalent operator.
  • Suggests passing a single character when an equivalent overloaded method is available that accepts a char parameter.
  • Suggests using a pattern instead of a method invocation.
  • Suggests replacing an expression with another method invocation.

Supported Types:

  • string
  • StringBuilder
  • numeric types
  • bool
  • char
  • enums
  • Guid
  • Nullable<T>
  • Random
  • TimeSpan
  • DateTime
  • DateTimeOffset
  • DateOnly
  • TimeOnly
  • Enumerable (LINQ)

Tip

Quick fixes are available.

Important

Known Limitations

  • list patterns might introduce variables with conflicting names

Note

The analyzers can be configured or deactivated in the ReSharper Options or Rider Settings dialog.

⚠️ **GitHub.com Fallback** ⚠️