Potential Code Quality Issues
- The parameter expects a constant for optimal performance
The parameter expects a constant for optimal performance.
- '?:' expression has identical true and false branches
'?:' expression has identical true and false branches.
- 'Enumerable.Sum' invocation in explicit unchecked context
'Enumerable.Sum' invocation in explicit unchecked context.
- 'GC.SuppressFinalize' is invoked for type without destructor
'GC.SuppressFinalize' is invoked for type without destructor.
- 'Object.ReferenceEquals' is always false because it is called with value type
'Object.ReferenceEquals' is always false because it is called with value type.
- 'ref' or 'out' parameter with [Optional] attribute
'ref' or 'out' parameter with [Optional] attribute.
- 'value' parameter is not used
'value' parameter is not used.
- 'void' method is annotated with the [MustDisposeResource] attribute
'void' method is annotated with the [MustDisposeResource] attribute.
- 'void' method is annotated with the [MustUseReturnValue] attribute
'void' method is annotated with the [MustUseReturnValue] attribute.
- 'void' method is annotated with the [Pure] attribute
'void' method is annotated with the [Pure] attribute.
- 'with' expression is used instead of object initializer
'with' expression is used instead of object initializer.
- 'with' expression modifies all accessible instance members
'with' expression modifies all accessible instance members.
- [MustDisposeResource] annotation is not inherited from the base constructor and should be placed explicitly
[MustDisposeResource] annotation is not inherited from the base constructor and should be placed explicitly.
- [ThreadStatic] does not work with instance fields
[ThreadStatic] does not work with instance fields.
- A suppressed nullable warning might hide an underlying problem
A suppressed nullable warning might hide an underlying problem.
- Abstract or virtual (overridable) event is never invoked
Abstract or virtual (overridable) event is never invoked.
- Access to disposed captured variable
Access to disposed captured variable.
- Access to foreach variable in closure
Access to foreach variable in closure.
- Access to modified captured variable
Access to modified captured variable.
- According to values of the bit masks, expression result will always be the same
According to values of the bit masks, expression result will always be the same.
- Actual shift count equals zero
Actual shift count equals zero.
- Ambiguous symbols in text argument
Ambiguous symbols in text argument.
- Annotation conflict in hierarchy
Annotation conflict in hierarchy.
- Assignment in conditional expression
Assignment in conditional expression.
- Async iterator invocation without 'await foreach'
Async iterator invocation without 'await foreach'.
- Auto-property accessor is never used (non-private accessibility)
Auto-property accessor is never used (non-private accessibility).
- Auto-property accessor is never used (private accessibility)
Auto-property accessor is never used (private accessibility).
- Avoid mixing of variable-length escape sequences and text
Avoid mixing of variable-length escape sequences and text.
- Avoid using 'async' for methods and functions with the 'void' return type and a parameter of type 'System.EventArgs'
Avoid using 'async' for methods and functions with the 'void' return type and a parameter of type 'System.EventArgs'.
- Avoid using 'async' for methods and functions with the 'void' return type but without a parameter of type 'System.EventArgs'
Avoid using 'async' for methods and functions with the 'void' return type but without a parameter of type 'System.EventArgs'.
- Avoid using 'async' lambda when delegate type returns 'void'
Avoid using 'async' lambda when delegate type returns 'void'.
- Backing field is assigned but never used
Backing field is assigned but never used.
- Backing field is used but never assigned
Backing field is used but never assigned.
- Bitwise operation on enum that is not marked by the [Flags] attribute
Bitwise operation on enum that is not marked by the [Flags] attribute.
- Call to 'base.Equals(...)' is reference equality
Call to 'base.Equals(...)' is reference equality.
- Call to base member with implicit default parameters
Call to base member with implicit default parameters.
- Cannot access static symbol in text argument
Cannot access static symbol in text argument.
- Cannot access symbol in text argument
Cannot access symbol in text argument.
- Cannot resolve property
Cannot resolve property.
- Cannot resolve resource
Cannot resolve resource.
- Cannot resolve resource item
Cannot resolve resource item.
- Cannot resolve symbol in text argument
Cannot resolve symbol in text argument.
- Captured field reference of a marshal-by-reference class may cause a runtime exception
Captured field reference of a marshal-by-reference class may cause a runtime exception.
- Captured primary constructor parameter is mutable
Captured primary constructor parameter is mutable.
- Captured reference to 'volatile' field will not be treated as 'volatile'
Captured reference to 'volatile' field will not be treated as 'volatile'.
- Char is possibly unintentionally used as integer
Char is possibly unintentionally used as integer.
- Class is never instantiated (non-private accessibility)
Class is never instantiated (non-private accessibility).
- Class is never instantiated (private accessibility)
Class is never instantiated (private accessibility).
- Co-variant array conversion
Co-variant array conversion.
- Collection content is never queried (non-private accessibility)
Collection content is never queried (non-private accessibility).
- Collection content is never queried (private accessibility)
Collection content is never queried (private accessibility).
- Collection is never updated (non-private accessibility)
Collection is never updated (non-private accessibility).
- Collection is never updated (private accessibility)
Collection is never updated (private accessibility).
- Conflicting CQRS attribute
Conflicting CQRS attribute.
- Constant shift expression with non-zero operands results in a zero value
Constant shift expression with non-zero operands results in a zero value.
- CQRS context intersection. Command is called from the Query context. (show on declarations)
CQRS context intersection.
- CQRS context intersection. Command is called from the Query context. (show on usages)
CQRS context intersection.
- CQRS context intersection. Query is called from the Command context. (show on declarations)
CQRS context intersection.
- CQRS context intersection. Query is called from the Command context. (show on usages)
CQRS context intersection.
- Disposal of a variable already captured by the 'using' statement
Disposal of a variable already captured by the 'using' statement.
- Division by zero in at least one execution path
Division by zero in at least one execution path.
- Do not rethrow exception in 'async void' methods and functions
Do not rethrow exception in 'async void' methods and functions.
- Do not store SpinLock in readonly field
Do not store SpinLock in readonly field.
- Do not use object initializer for 'using' variable
Do not use object initializer for 'using' variable.
- Do not use object initializer for 'using' variable (object initializer expression may throw exception while initializing 'using' variable)
Do not use object initializer for 'using' variable (object initializer expression may throw exception while initializing 'using' variable).
- Do not use right brace after a format specifier in format strings
Do not use right brace after a format specifier in format strings.
- Duplicate keys in dictionary/set initialization
Duplicate keys in dictionary/set initialization.
- Duplicated 'switch' arms
Duplicated 'switch' arms.
- Duplicated 'switch' branches
Duplicated 'switch' branches.
- Duplicated chained 'if' branches
Duplicated chained 'if' branches.
- Duplicated sequential 'if' branches
Duplicated sequential 'if' branches.
- Empty 'with' expression is redundant
Empty 'with' expression is redundant.
- Empty general catch clause
Empty general catch clause.
- Equality comparison of floating point numbers
Equality comparison of floating point numbers.
- Escape sequence can be simplified
Escape sequence can be simplified.
- Event is never subscribed to (non-private accessibility)
Event is never subscribed to (non-private accessibility).
- Event is never subscribed to (private accessibility)
Event is never subscribed to (private accessibility).
- Event never invoked
Event never invoked.
- Event unsubscription via anonymous delegate
Event unsubscription via anonymous delegate.
- Exception rethrow possibly intended
Exception rethrow possibly intended.
- Explicit argument passed to parameter with caller info attribute
Explicit argument passed to parameter with caller info attribute.
- Extract common code
Extract common code.
- Field hides property with default implementation in interface
Field hides property with default implementation in interface.
- Formatting is specified, but interpolated string expression is not IFormattable
Formatting is specified, but interpolated string expression is not IFormattable.
- Function body is too complex to analyze
Function body is too complex to analyze.
- Function is recursive on all execution paths
Function is recursive on all execution paths.
- Function never returns
Function never returns.
- Heuristically unreachable case according to integer analysis
Heuristically unreachable case according to integer analysis.
- Heuristically unreachable switch arm according to integer analysis
Heuristically unreachable switch arm according to integer analysis.
- Inconsistent arguments passed to 'Math.Clamp()' method
Inconsistent arguments passed to 'Math.Clamp()' method.
- Inconsistent order of taken locks
Inconsistent order of taken locks.
- Inconsistent synchronization on field
Inconsistent synchronization on field.
- Incorrect usage of ConstantExpected attribute
Incorrect usage of ConstantExpected attribute.
- Index from end must be greater than zero; use '^1' to refer to the last element
Index from end must be greater than zero; use '^1' to refer to the last element.
- Interfaces marked as ServiceContract should declare at least one OperationContract
Interfaces marked as ServiceContract should declare at least one OperationContract.
- Invalid XML documentation comment
Invalid XML documentation comment.
- Invocation of polymorphic field-like event
Invocation of polymorphic field-like event.
- IQueryable is possibly unintentionally used as IEnumerable
IQueryable is possibly unintentionally used as IEnumerable.
- Iterator never returns
Iterator never returns.
- Local function hides method
Local function hides method.
- Local variable hides member
Local variable hides member.
- Local variable hides primary constructor parameter
Local variable hides primary constructor parameter.
- Loop control variable is never changed inside loop
Loop control variable is never changed inside loop.
- Meaningless [HandlesResourceDisposal] annotation for an output parameter
Meaningless [HandlesResourceDisposal] annotation for an output parameter.
- Meaningless [MustDisposeResource] annotation for an input parameter
Meaningless [MustDisposeResource] annotation for an input parameter.
- Member hides static member from outer class
Member hides static member from outer class.
- Member initialized value ignored
Member initialized value ignored.
- Method is called from both CQRS contexts (show on declarations)
Method is called from both CQRS contexts (show on declarations).
- Method is called from both CQRS contexts (show on usages)
Method is called from both CQRS contexts (show on usages).
- Method is marked as OperationContract but containing type is not marked as ServiceContract
Method is marked as OperationContract but containing type is not marked as ServiceContract.
- Method with optional or 'params' parameter is hidden by overload
Method with optional or 'params' parameter is hidden by overload.
- Mismatch of optional parameter value in overridden method
Mismatch of optional parameter value in overridden method.
- Missing '.ConfigureAwait(false)' for async disposable in library code
Missing '.ConfigureAwait(false)' for async disposable in library code.
- Missing '.ConfigureAwait(false)' in library code
Missing '.ConfigureAwait(false)' in library code.
- Move the shebang directive to the beginning of the file
Move the shebang directive to the beginning of the file.
- Multiple sequential 'OrderBy' invocation
Multiple sequential 'OrderBy' invocation.
- Non-accessed field (non-private accessibility)
Non-accessed field (non-private accessibility).
- Non-accessed field (private accessibility)
Non-accessed field (private accessibility).
- Non-accessed positional property (non-private accessibility)
Non-accessed positional property (non-private accessibility).
- Non-accessed positional property (private accessibility)
Non-accessed positional property (private accessibility).
- Non-public member in implementation class hides default implementation in interface
Non-public member in implementation class hides default implementation in interface.
- Non-readonly type member referenced in 'GetHashCode()'
Non-readonly type member referenced in 'GetHashCode()'.
- Nullability conflicts with annotations in hierarchy
Nullability conflicts with annotations in hierarchy.
- Nullable warning suppression operator might be confused with inverted 'is' expression
Nullable warning suppression operator might be confused with inverted 'is' expression.
- One way operations must not return values
One way operations must not return values.
- Operator 'is'/'Type Of ... Is ...' can be used
Operator 'is'/'Type Of ..
- Operator without matching checked operator
Operator without matching checked operator.
- Overridden GetHashCode calls base 'Object.GetHashCode()'
Overridden GetHashCode calls base 'Object.GetHashCode()'.
- Parameter hides member
Parameter hides member.
- Parameter hides primary constructor parameter
Parameter hides primary constructor parameter.
- Parameter name differs between partial member declarations
Parameter name differs between partial member declarations.
- Possible 'System.ArgumentOutOfRangeException'. Index must be a non-negative integer.
Possible 'System.ArgumentOutOfRangeException'.
- Possible 'System.ArgumentOutOfRangeException'. Start index must be less than or equal to end index.
Possible 'System.ArgumentOutOfRangeException'.
- Possible 'System.InvalidCastException'
Possible 'System.InvalidCastException'.
- Possible 'System.InvalidCastException' in foreach loop
Possible 'System.InvalidCastException' in foreach loop.
- Possible 'System.InvalidOperationException'
Possible 'System.InvalidOperationException'.
- Possible 'System.InvalidOperationException: Collection was modified'
Possible 'System.InvalidOperationException: Collection was modified'.
- Possible 'System.NullReferenceException'
Possible 'System.NullReferenceException'.
- Possible ambiguity while accessing member by interface
Possible ambiguity while accessing member by interface.
- Possible comparison of value type with 'null'
Possible comparison of value type with 'null'.
- Possible cyclic constructor call
Possible cyclic constructor call.
- Possible incorrect implementation of Double-Check Locking pattern. Possible multiple write access to checked field.
Possible incorrect implementation of Double-Check Locking pattern.
- Possible incorrect implementation of Double-Check Locking pattern. Read access to checked field.
Possible incorrect implementation of Double-Check Locking pattern.
- Possible infinite inheritance
Possible infinite inheritance.
- Possible loss of fraction
Possible loss of fraction.
- Possible mistaken 'GetType()' invocation
Possible mistaken 'GetType()' invocation.
- Possible mistaken argument of type 'System.Type'
Possible mistaken argument of type 'System.Type'.
- Possible multiple enumeration
Possible multiple enumeration.
- Possible overflow
Possible overflow.
- Possible overflow in checked context
Possible overflow in checked context.
- Possible overflow in unchecked context
Possible overflow in unchecked context.
- Possible unassigned object created by 'new' expression
Possible unassigned object created by 'new' expression.
- Possible unintended reference comparison
Possible unintended reference comparison.
- Possibly impure struct method is called on readonly variable: struct value always copied before invocation
Possibly impure struct method is called on readonly variable: struct value always copied before invocation.
- Possibly misleading 'DefaultValueAttribute' usage to define optional parameter value
Possibly misleading 'DefaultValueAttribute' usage to define optional parameter value.
- Possibly missing comma before indexer initializer
Possibly missing comma before indexer initializer.
- Possibly mistaken use of a 'CancellationToken'
Possibly mistaken use of a 'CancellationToken'.
- Possibly unintended linear search in set
Possibly unintended linear search in set.
- Possibly unintended modification inside conditional invocation
Possibly unintended modification inside conditional invocation.
- Possibly unintended string interpolation instead of format string template
Possibly unintended string interpolation instead of format string template.
- Possibly wrong string comparison: spans are only equal when pointing to the same memory location
Possibly wrong string comparison: spans are only equal when pointing to the same memory location.
- Potentially misleading parameter name in lambda or local function
Potentially misleading parameter name in lambda or local function.
- Prefer explicitly provided tuple component name
Prefer explicitly provided tuple component name.
- Primary constructor parameter capturing is disallowed
Primary constructor parameter capturing is disallowed.
- Return of a task produced by 'using'-captured object
Return of a task produced by 'using'-captured object.
- Return of a variable captured by 'using' statement
Return of a variable captured by 'using' statement.
- Return type of a function can be made non-nullable
Return type of a function can be made non-nullable.
- Return value of 'GetEnumerator' method call is never disposed
Return value of 'GetEnumerator' method call is never disposed.
- Return value of [MustUseReturnValue]-annotated method is not used
Return value of [MustUseReturnValue]-annotated method is not used.
- Return value of a method annotated with [MustDisposeResource] is never disposed
Return value of a method annotated with [MustDisposeResource] is never disposed.
- Return value of a property must be disposed by the callee
Return value of a property must be disposed by the callee.
- Return value of iterator is not used
Return value of iterator is not used.
- Return value of pure method is not used
Return value of pure method is not used.
- Return value should be disposed but the method or function is not annotated with [MustDisposeResource]
Return value should be disposed but the method or function is not annotated with [MustDisposeResource].
- Safe cast expression always succeeds
Safe cast expression always succeeds.
- Shift expression with zero left operand equals zero
Shift expression with zero left operand equals zero.
- Similar anonymous type detected nearby
Similar anonymous type detected nearby.
- Similar expressions comparison
Similar expressions comparison.
- Some values of the enum are not processed inside 'switch' expression and are handled via exception in default arm
Some values of the enum are not processed inside 'switch' expression and are handled via exception in default arm.
- Some values of the enum are not processed inside 'switch' statement
Some values of the enum are not processed inside 'switch' statement.
- Some values of the enum are not processed inside 'switch' statement and are handled via default section
Some values of the enum are not processed inside 'switch' statement and are handled via default section.
- Static field or auto-property in generic type
Static field or auto-property in generic type.
- Static member initializer refers to static member below or in other part
Static member initializer refers to static member below or in other part.
- String formatting method problems
String formatting method problems.
- Structured log message items are duplicated or differ only in case
Structured log message items are duplicated or differ only in case.
- Structured message template problems
Structured message template problems.
- Suspicious 'volatile' field usage: compound operation is not atomic. 'Interlocked' class can be used instead.
Suspicious 'volatile' field usage: compound operation is not atomic.
- Suspicious locking over synchronization primitive
Suspicious locking over synchronization primitive.
- Suspicious parameter name in ArgumentNullException
Suspicious parameter name in ArgumentNullException.
- Suspicious shift count for this type of left operand
Suspicious shift count for this type of left operand.
- Suspicious type conversion or check
Suspicious type conversion or check.
- Suspicious use of variable with discard-like name
Suspicious use of variable with discard-like name.
- Symbol from module that might be missing at runtime
Symbol from module that might be missing at runtime.
- Tail recursive call can be replaced with loop
Tail recursive call can be replaced with loop.
- The expression of 'is' operator is never of the provided type
The expression of 'is' operator is never of the provided type.
- The given expression of 'is' operator is always of the provided type
The given expression of 'is' operator is always of the provided type.
- The pattern is redundant, it does not produce any runtime checks
The pattern is redundant, it does not produce any runtime checks.
- The source expression always matches the provided pattern
The source expression always matches the provided pattern.
- The source expression never matches the provided pattern
The source expression never matches the provided pattern.
- Thread static field has initializer
Thread static field has initializer.
- Try cast and check for null can be replaced with a type check
Try cast and check for null can be replaced with a type check.
- Type check and casts can be merged
Type check and casts can be merged.
- Type pattern and casts can be merged
Type pattern and casts can be merged.
- Unassigned field (non-private accessibility)
Unassigned field (non-private accessibility).
- Unassigned field (private accessibility)
Unassigned field (private accessibility).
- Unassigned readonly field
Unassigned readonly field.
- Unidentified CQRS entity
Unidentified CQRS entity.
- Usage of <inheritdoc /> is invalid
Usage of <inheritdoc /> is invalid.
- Use <inheritdoc /> on root level to inherit documentation from base candidate
Use <inheritdoc /> on root level to inherit documentation from base candidate.
- Use collection's count property
Use collection's count property.
- Use format specifier in format strings
Use format specifier in format strings.
- Use format specifier in interpolated strings
Use format specifier in interpolated strings.
- Use null check instead of a type check succeeding on any not-null value
Use null check instead of a type check succeeding on any not-null value.
- Use null check pattern instead of a type check succeeding on any not-null value
Use null check pattern instead of a type check succeeding on any not-null value.
- Use nullable annotation instead of an attribute
Use nullable annotation instead of an attribute.
- Useless arithmetical operation
Useless arithmetical operation.
- Using stackalloc inside loop
Using stackalloc inside loop.
- Value assigned to a property of non-variable qualifier expression can be lost
Value assigned to a property of non-variable qualifier expression can be lost.
- Variable can be declared as non-nullable
Variable can be declared as non-nullable.
- Variable in local function hides variable from outer scope
Variable in local function hides variable from outer scope.
- Virtual member call in constructor
Virtual member call in constructor.