Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pavel-mikula-sonarsource opened this issue Nov 28, 2022 · 0 comments · Fixed by #5737
Closed
Assignees
Labels
Area: VB.NET VB.NET rules related issues.
Milestone

Comments

@pavel-mikula-sonarsource
Copy link
Contributor

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
  <Obsolete>
  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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: VB.NET VB.NET rules related issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant