Query module UselessUpcast

name
Useless upcast
description
Casting an expression is normally not needed when there exists an implicit conversion.
kind
problem
problem.severity
warning
precision
medium
id
cs/useless-upcast
tags
maintainability language-features external/cwe/cwe-561

Imports

csharp

The default C# QL library.

Predicates

getMaximumArguments

Gets the maximum number of arguments allowed to call c, if any.

getMinimumArguments

Gets the minimum number of arguments required to call c.

hasExtensionMethod

Holds if extension method m is a method on t with name name.

hasInstanceCallable

Holds t has instance callable c as a member, with name name.

hasStaticCallable

Holds t has static callable c as a member, with name name.

Classes

ExplicitUpcast

An explicit upcast.

InstanceCallable

An instance callable, that is, a non-static callable.

StaticCall

A call to a static callable.

StaticCallable

A static callable.