Inspectopedia 2025.2 Help

Redundancies in Code

'??' condition is known to be null or not null   New in this release

'??' condition is known to be null or not null.

'??' condition is never null according to nullable reference types' annotations   New in this release

'??' condition is never null according to nullable reference types' annotations.

'ContainsKey' call is redundant before adding the item to the dictionary   New in this release

'ContainsKey' call is redundant before adding the item to the dictionary.

'true' is redundant as 'for'-statement condition   New in this release

'true' is redundant as 'for'-statement condition.

[NotNull] or [CanBeNull] attribute is applied to a type that already has the same annotation from nullable reference types   New in this release

[NotNull] or [CanBeNull] attribute is applied to a type that already has the same annotation from nullable reference types.

Anonymous method signature is not necessary   New in this release

Anonymous method signature is not necessary.

Array creation can be replaced with array initializer   New in this release

Array creation can be replaced with array initializer.

Assignment is not used   New in this release

Assignment is not used.

Assignment results are fully discarded   New in this release

Assignment results are fully discarded.

Comparison to integral constant is useless   New in this release

Comparison to integral constant is useless.

Conditional access qualifier expression is known to be null or not null   New in this release

Conditional access qualifier expression is known to be null or not null.

Conditional access qualifier expression is not null according to nullable reference types' annotations   New in this release

Conditional access qualifier expression is not null according to nullable reference types' annotations.

CQRS attribute is redundant and can be removed   New in this release

CQRS attribute is redundant and can be removed.

Double negation operator   New in this release

Double negation operator.

Duplicated statements   New in this release

Duplicated statements.

Empty 'for' loop is redundant   New in this release

Empty 'for' loop is redundant.

Empty region   New in this release

Empty region.

Explicit delegate creation expression is redundant   New in this release

Explicit delegate creation expression is redundant.

Expression is always 'null'   New in this release

Expression is always 'null'.

Expression is always 'true' or 'false' according to nullable reference types' annotations   New in this release

Expression is always 'true' or 'false' according to nullable reference types' annotations.

Expression is always 'true' or always 'false'   New in this release

Expression is always 'true' or always 'false'.

Heuristically unreachable code   New in this release

Heuristically unreachable code.

Immediate delegate invocation   New in this release

Immediate delegate invocation.

Math.Abs() argument is always non-negative   New in this release

Math.Abs() argument is always non-negative.

Math.Sign() method always gives the same result   New in this release

Math.Sign() method always gives the same result.

Parentheses are redundant if attribute has no arguments   New in this release

Parentheses are redundant if attribute has no arguments.

Pattern is always 'true' or always 'false'   New in this release

Pattern is always 'true' or always 'false'.

Private field can be converted into local variable   New in this release

Private field can be converted into local variable.

Raw string can be simplified   New in this release

Raw string can be simplified.

Redundant 'abstract' modifier   New in this release

Redundant 'abstract' modifier.

Redundant 'Attribute' suffix   New in this release

Redundant 'Attribute' suffix.

Redundant 'base.' qualifier   New in this release

Redundant 'base.' qualifier.

Redundant 'case' label   New in this release

Redundant 'case' label.

Redundant 'case' label before default section   New in this release

Redundant 'case' label before default section.

Redundant 'class' keyword in record declaration   New in this release

Redundant 'class' keyword in record declaration.

Redundant 'else' keyword  

Redundant 'else' keyword.

Redundant 'IEnumerable.Cast<T>' or 'IEnumerable.OfType<T>' call   New in this release

Redundant 'IEnumerable.Cast<T>' or 'IEnumerable.OfType<T>' call.

Redundant 'notnull' constraint on type parameter constrained by non-nullable base type   New in this release

Redundant 'notnull' constraint on type parameter constrained by non-nullable base type.

Redundant 'object.ToString()' call   New in this release

Redundant 'object.ToString()' call.

Redundant 'object.ToString()' call for value types   New in this release

Redundant 'object.ToString()' call for value types.

Redundant 'orderby' clause 'ascending' keyword   New in this release

Redundant 'orderby' clause 'ascending' keyword.

Redundant 'readonly' modifier   New in this release

Redundant 'readonly' modifier.

Redundant 'scoped' parameter modifier   New in this release

Redundant 'scoped' parameter modifier.

Redundant 'string.Format()' call   New in this release

Redundant 'string.Format()' call.

Redundant 'string.ToCharArray()' call   New in this release

Redundant 'string.ToCharArray()' call.

Redundant 'switch' expression arms   New in this release

Redundant 'switch' expression arms.

Redundant 'virtual' modifier   New in this release

Redundant 'virtual' modifier.

Redundant 'WithCancellation()' invocation   New in this release

Redundant 'WithCancellation()' invocation.

Redundant [AttributeUsage] attribute property assignment   New in this release

Redundant [AttributeUsage] attribute property assignment.

Redundant anonymous type property explicit name   New in this release

Redundant anonymous type property explicit name.

Redundant argument passed to caller argument expression parameter   New in this release

Redundant argument passed to caller argument expression parameter.

Redundant argument with default value   New in this release

Redundant argument with default value.

Redundant arithmetic overflow checking context   New in this release

Redundant arithmetic overflow checking context.

Redundant boolean comparison   New in this release

Redundant boolean comparison.

Redundant braces in collection initializer   New in this release

Redundant braces in collection initializer.

Redundant cast   New in this release

Redundant cast.

Redundant catch clause   New in this release

Redundant catch clause.

Redundant collection copy   New in this release

Redundant collection copy.

Redundant condition check before assignments   New in this release

Redundant condition check before assignments.

Redundant conditional ternary expression usage   New in this release

Redundant conditional ternary expression usage.

Redundant context capturing with 'ConfigureAwait'   New in this release

Redundant context capturing with 'ConfigureAwait'.

Redundant control flow jump statement  

Redundant control flow jump statement.

Redundant discard designation   New in this release

Redundant discard designation.

Redundant empty argument list on object creation expression   New in this release

Redundant empty argument list on object creation expression.

Redundant empty finally block   New in this release

Redundant empty finally block.

Redundant empty object or collection initializer   New in this release

Redundant empty object or collection initializer.

Redundant empty switch section   New in this release

Redundant empty switch section.

Redundant explicit collection creation in argument of 'params' parameter   New in this release

Redundant explicit collection creation in argument of 'params' parameter.

Redundant explicit nullable type creation   New in this release

Redundant explicit nullable type creation.

Redundant explicit positional property declaration   New in this release

Redundant explicit positional property declaration.

Redundant explicit size specification in array creation   New in this release

Redundant explicit size specification in array creation.

Redundant explicit tuple component name   New in this release

Redundant explicit tuple component name.

Redundant explicit type in array creation   New in this release

Redundant explicit type in array creation.

Redundant fixed pointer declaration   New in this release

Redundant fixed pointer declaration.

Redundant global using directive   New in this release

Redundant global using directive.

Redundant lambda expression parameter type specification   New in this release

Redundant lambda expression parameter type specification.

Redundant lambda signature parentheses   New in this release

Redundant lambda signature parentheses.

Redundant name qualifier  

Redundant name qualifier.

Redundant nullable annotation on 'class?' constraint of type parameter constrained by non-nullable base type   New in this release

Redundant nullable annotation on 'class?' constraint of type parameter constrained by non-nullable base type.

Redundant nullable annotation on base type constraint of type parameter constrained by another non-nullable base type   New in this release

Redundant nullable annotation on base type constraint of type parameter constrained by another non-nullable base type.

Redundant nullable annotation on base type constraint of type parameter having non-nullable type kind   New in this release

Redundant nullable annotation on base type constraint of type parameter having non-nullable type kind.

Redundant nullable attribute   New in this release

Redundant nullable attribute.

Redundant nullable directive   New in this release

Redundant nullable directive.

Redundant nullable warning suppression expression   New in this release

Redundant nullable warning suppression expression.

Redundant operand in logical conditional expression   New in this release

Redundant operand in logical conditional expression.

Redundant property pattern clause   New in this release

Redundant property pattern clause.

Redundant range bound   New in this release

Redundant range bound.

Redundant semicolon after type or namespace declaration   New in this release

Redundant semicolon after type or namespace declaration.

Redundant string interpolation   New in this release

Redundant string interpolation.

Redundant type arguments inside 'nameof'   New in this release

Redundant type arguments inside 'nameof'.

Redundant type arguments of method   New in this release

Redundant type arguments of method.

Redundant type check in a pattern   New in this release

Redundant type check in a pattern.

Redundant type declaration body   New in this release

Redundant type declaration body.

Redundant using directive   New in this release

Redundant using directive.

Redundant verbatim prefix   New in this release

Redundant verbatim prefix.

Redundant verbatim string prefix   New in this release

Redundant verbatim string prefix.

Remove redundant pattern-matching parentheses   New in this release

Remove redundant pattern-matching parentheses.

Subpattern that always matches is redundant   New in this release

Subpattern that always matches is redundant.

Type check for nullable type is equal to underlying type check   New in this release

Type check for nullable type is equal to underlying type check.

Unsafe context declaration is redundant   New in this release

Unsafe context declaration is redundant.

Unused nullable directive   New in this release

Unused nullable directive.

Last modified: 29 July 2025