Ferrous API Reference

All Types / Ferrous.Pedantic

class PedanticSafetyAnalyzer

public sealed class PedanticSafetyAnalyzer : DiagnosticAnalyzer

Roslyn diagnostic analyzer enforcing Rust-inspired panic-free, zero-allocation, numeric, equality, and unsafe safety rules (FE0410–FE0417).

Constants

public const string ThrowingBclCallDiagnosticId = "FE0410"

Diagnostic ID for calling known-throwing BCL APIs inside [NoThrow] or Result-returning methods.

public const string SwallowedExceptionDiagnosticId = "FE0411"

Diagnostic ID for empty or swallowed catch blocks.

public const string DefensiveStructCopyDiagnosticId = "FE0412"

Diagnostic ID for hidden defensive struct copies on readonly fields or in parameters.

public const string AllocationInNoAllocDiagnosticId = "FE0413"

Diagnostic ID for heap allocations or boxing inside [NoAlloc] methods.

public const string UncheckedArithmeticDiagnosticId = "FE0414"

Diagnostic ID for unchecked integer arithmetic inside [Checked] scopes.

public const string LossyNumericCastDiagnosticId = "FE0415"

Diagnostic ID for lossy or sign-changing explicit numeric casts.

public const string FloatEqualityOrHashKeyDiagnosticId = "FE0416"

Diagnostic ID for direct floating-point equality comparisons or float hash keys.

public const string UndocumentedUnsafeDiagnosticId = "FE0417"

Diagnostic ID for undocumented unsafe / low-level memory APIs or overbroad unsafe modifiers.

Properties

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics

Methods

public override void Initialize(AnalysisContext context)