sonar-dotnet icon indicating copy to clipboard operation
sonar-dotnet copied to clipboard

Implement S1123 - Obsolete attributes need explanation - for VB.NET

Open Corniel opened this issue 3 years ago • 0 comments

See: RSPEC-2289, and #365

Description

The Obsolete attribute can be applied with or without arguments, but marking something Obsolete without including advice as to why it's obsolete or on what to use instead will lead maintainers to waste time trying to figure those things out - every single time the warning is encountered.

Noncompliant Code Example

Public Class Car
  Public Sub CrankEngine(turnsOfCrank As Integer) 
  ' ...
End Class

Compliant Solution

Public Class Car
  <Obsolete("Replaced by the automatic starter")>
  Public Sub CrankEngine(turnsOfCrank As Integer) 
  ' ...
End Class

Corniel avatar Jun 14 '22 06:06 Corniel