Query module EqualsUsesIs

name
Equals should not apply “is”
description
Implementations of ‘Equals’ should not use “is” to test the type of the argument, but rather call GetType(). This guards against the possibility that the argument type will be subclassed. Otherwise, it is likely that the Equals method will not be symmetric, violating its contract.
kind
problem
problem.severity
warning
precision
medium
id
cs/equals-uses-is
tags
reliability maintainability

Imports

System

Provides definitions related to the namespace System.

csharp

The default C# CodeQL library.