Ferrous API Reference

All Types / Ferrous.Pedantic

class IndexingSafetyAnalyzer

public sealed class IndexingSafetyAnalyzer : DiagnosticAnalyzer

Roslyn diagnostic analyzer (FE0420, inspired by clippy::indexing_slicing) that flags unchecked array, list, span, and string indexing inside [NoThrow] or Result-returning methods unless bounds are proven by an enclosing loop or guard.

Constants

public const string UncheckedIndexingDiagnosticId = "FE0420"

Diagnostic ID for unchecked indexing inside [NoThrow] or Result-returning methods.

Properties

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics

Methods

public override void Initialize(AnalysisContext context)