Back to Roslyn

Roslyn.Diagnostics.Analyzers

src/RoslynAnalyzers/Roslyn.Diagnostics.Analyzers/Roslyn.Diagnostics.Analyzers.md

11.0.1004.3 KB
Original Source

Roslyn.Diagnostics.Analyzers

RS0001: Use 'SpecializedCollections.EmptyEnumerable()'

Use 'SpecializedCollections.EmptyEnumerable()'

ItemValue
CategoryRoslynDiagnosticsPerformance
EnabledTrue
SeverityWarning
CodeFixFalse

RS0002: Use 'SpecializedCollections.SingletonEnumerable()'

Use 'SpecializedCollections.SingletonEnumerable()'

ItemValue
CategoryRoslynDiagnosticsPerformance
EnabledTrue
SeverityWarning
CodeFixFalse

RS0004: Invoke the correct property to ensure correct use site diagnostics

Invoke the correct property to ensure correct use site diagnostics

ItemValue
CategoryUsage
EnabledFalse
SeverityError
CodeFixFalse

RS0006: Do not mix attributes from different versions of MEF

Do not mix attributes from different versions of MEF.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledTrue
SeverityWarning
CodeFixFalse

RS0019: 'SymbolDeclaredEvent' must be generated for source symbols

Compilation event queue is required to generate symbol declared events for all declared source symbols. Hence, every source symbol type or one of its base types must generate a symbol declared event.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledFalse
SeverityError
CodeFixFalse

RS0023: Parts exported with MEFv2 must be marked with 'SharedAttribute'

Part exported with MEFv2 must be marked with the 'SharedAttribute'.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledTrue
SeverityWarning
CodeFixTrue

RS0032: Test exports should not be discoverable

Test exports should not be discoverable.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledFalse
SeverityWarning
CodeFixTrue

RS0033: Importing constructor should be marked with 'ObsoleteAttribute'

Importing constructor should be marked with 'ObsoleteAttribute'.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledTrue
SeverityWarning
CodeFixTrue

RS0034: Exported parts should have a public constructor marked with 'ImportingConstructorAttribute'

Exported parts should be marked with 'ImportingConstructorAttribute'.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledTrue
SeverityWarning
CodeFixTrue

RS0038: Prefer null literal

Use 'null' instead of 'default' for nullable types.

ItemValue
CategoryRoslynDiagnosticsMaintainability
EnabledTrue
SeverityWarning
CodeFixTrue

RS0040: Defaultable types should have defaultable fields

Defaultable types should have defaultable fields.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledTrue
SeverityWarning
CodeFixFalse

RS0042: Do not copy value

Auto-properties always copy values, so they cannot be declared with non-copyable types.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledTrue
SeverityWarning
CodeFixFalse

RS0043: Do not call 'GetTestAccessor()'

'GetTestAccessor()' is a helper method reserved for testing. Production code must not call this member.

ItemValue
CategoryRoslynDiagnosticsMaintainability
EnabledTrue
SeverityWarning
CodeFixFalse

RS0046: Avoid the 'Opt' suffix

Avoid the 'Opt' suffix in a nullable-enabled code.

ItemValue
CategoryRoslynDiagnosticsDesign
EnabledTrue
SeverityWarning
CodeFixTrue

RS0049: Instance of TemporaryArray<T>.AsRef() must be a 'using' variable

Instance of TemporaryArray<T>.AsRef() must be a 'using' variable.

ItemValue
CategoryRoslynDiagnosticsReliability
EnabledTrue
SeverityWarning
CodeFixFalse

RS0062: Do not capture primary constructor parameters

Primary constructor parameters should not be implicitly captured. Manually assign them to fields at the start of the type.

ItemValue
CategoryRoslynDiagnosticsMaintainability
EnabledFalse
SeverityError
CodeFixFalse

RS0063: Do not use interpolated strings with 'Debug.Assert'

'Debug.Assert' on .NET Framework eagerly creates the string value. This can cause OOMs in tests, particularly for strings that involve syntax nodes. Use 'RoslynDebug.Assert' instead, which will only create the string if required.

ItemValue
CategoryRoslynDiagnosticsPerformance
EnabledFalse
SeverityWarning
CodeFixTrue