Inspectopedia 2025.3 Help

Common Practices and Code Improvements

Check for reference equality instead  

Check for reference equality instead.

Check for reference equality instead (VBCheckForReferenceEqualityInstead.1)  

Check for reference equality instead.

Convert property to auto-property  

Convert property to auto-property.

Convert property to auto-property when possible  

Convert property to auto-property when possible.

Convert property to auto-property with private setter  

Convert property to auto-property with private setter.

Possible mistaken argument  

Possible mistaken argument.

Possible mistaken call to GetType()  

Possible mistaken call to GetType().

Possible mistaken call to GetType() (VBPossibleMistakenCallToGetType.2)  

Possible mistaken call to GetType().

Remove ToList()  

Remove ToList().

Remove ToList() (VBRemoveToList.1)  

Remove ToList().

Replace with FirstOrDefault($args$)  

Replace with FirstOrDefault($args$).

Replace with LastOrDefault($args$)  

Replace with LastOrDefault($args$).

Replace with OfType<T>() (replace with OfType(Of ..)())  

Replace with OfType<T>() (replace with OfType(Of ..)()).

Replace with OfType<T>() (replace with OfType(Of ..)()) (VBReplaceWithOfType.1)  

Replace with OfType<T>() (replace with OfType(Of ..)()).

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any())  

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any()).

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any(..))  

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any(..)).

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count())  

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count()).

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count(..))  

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count(..)).

Replace with OfType<T>().First() (replace with OfType(Of ..)().First())  

Replace with OfType<T>().First() (replace with OfType(Of ..)().First()).

Replace with OfType<T>().First() (replace with OfType(Of ..)().First(..))  

Replace with OfType<T>().First() (replace with OfType(Of ..)().First(..)).

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault())  

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault()).

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault(..))  

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault(..)).

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last())  

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last()).

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last(..))  

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last(..)).

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault())  

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault()).

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault(..))  

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault(..)).

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single())  

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single()).

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single(..))  

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single(..)).

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault())  

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault()).

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault(..))  

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault(..)).

Replace with OfType<T>().Where() (replace with OfType(Of ..)().Where(..))  

Replace with OfType<T>().Where() (replace with OfType(Of ..)().Where(..)).

Replace with single assignment  

Replace with single assignment.

Replace with single assignment (VBReplaceWithSingleAssignment.2)  

Replace with single assignment.

Replace with single call to Any(..)  

Replace with single call to Any(..).

Replace with single call to Count(..)  

Replace with single call to Count(..).

Replace with single call to First(..)  

Replace with single call to First(..).

Replace with single call to FirstOrDefault(..)  

Replace with single call to FirstOrDefault(..).

Replace with single call to Last(..)  

Replace with single call to Last(..).

Replace with single call to LastOrDefault(..)  

Replace with single call to LastOrDefault(..).

Replace with single call to Single(..)  

Replace with single call to Single(..).

Replace with single call to SingleOrDefault(..)  

Replace with single call to SingleOrDefault(..).

Replace with SingleOrDefault($args$)  

Replace with SingleOrDefault($args$).

Simplify 'IIf'  

Simplify 'IIf'.

Simplify conditional operator  

Simplify conditional operator.

Simplify expression  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.1)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.10)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.2)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.3)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.4)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.5)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.6)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.7)  

Simplify expression.

Simplify expression (VBSimplifyLinqExpression.8)  

Simplify expression.

String.Compare is culture-specific (string.Compare(string, int, string, int) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, int, string, int) is culture-specific).

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific).

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific) (VBStringCompareIsCultureSpecific.6)  

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific).

String.Compare is culture-specific (string.Compare(string, string) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, string) is culture-specific).

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific).

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific) (VBStringCompareIsCultureSpecific.2)  

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific).

String.CompareTo is culture-specific  

String.CompareTo is culture-specific.

String.EndsWith is culture-specific (string.EndsWith(string) is culture-specific)  

String.EndsWith is culture-specific (string.EndsWith(string) is culture-specific).

String.IndexOf is culture-specific (string.IndexOf(string) is culture-specific)  

String.IndexOf is culture-specific (string.IndexOf(string) is culture-specific).

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific)  

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific).

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific) (VBStringIndexOfIsCultureSpecific.2)  

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific).

String.LastIndexOf is culture-specific (string.LastIndexOf(string) is culture-specific)  

String.LastIndexOf is culture-specific (string.LastIndexOf(string) is culture-specific).

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific)  

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific).

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific) (VBStringLastIndexOfIsCultureSpecific.3)  

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific).

String.StartsWith is culture-specific (string.StartsWith(string) is culture-specific)  

String.StartsWith is culture-specific (string.StartsWith(string) is culture-specific).

Use 'TypeOf .. Is ..' operator  

Use 'TypeOf .

Use 'TypeOf .. Is ..' operator (VBUseTypeOfIsOperator.2)  

Use 'TypeOf .

Use array creation expression  

Use array creation expression.

Use array creation expression (VBUseArrayCreationExpression.2)  

Use array creation expression.

Use First() instead  

Use First() instead.

Use method Any()  

Use method Any().

Use method Any() (VBUseMethodAny.2)  

Use method Any().

Use method Any() (VBUseMethodAny.3)  

Use method Any().

Use method Any() (VBUseMethodAny.4)  

Use method Any().

Use method Any() (VBUseMethodAny.5)  

Use method Any().

Use method IsInstanceOfType(..)  

Use method IsInstanceOfType(..).

Last modified: 02 March 2026