Query module DefaultToString

name
Use of default ToString()
description
Calling the default implementation of ‘ToString’ returns a value that is unlikely to be what you expect.
kind
problem
problem.severity
warning
precision
very-high
id
cs/call-to-object-tostring
tags
reliability maintainability

Imports

Strings

Provides definitions related to strings.

System

Provides definitions related to the namespace System.

csharp

The default C# QL library.

Predicates

alwaysDefaultToString

Holds if t, or any sub type of t, inherits the default ToString() method from System.Object or System.ValueType.

invokesToString

Holds if expression e, of type t, invokes ToString() either explicitly or implicitly.