rspec/rules/S1481/vbnet/rule.adoc

28 lines
510 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
Public Function NumberOfMinutes(ByVal hours As Integer) As Integer
Dim seconds As Integer = 0 ' Seconds never used
Return hours * 60
End Function
----
== Compliant Solution
----
Public Function NumberOfMinutes(ByVal hours As Integer) As Integer
Return hours * 60
End Function
----
== Exceptions
Unused locally created resources in a <code>Using</code> statement are not reported.
2020-06-30 12:47:33 +02:00
----
Using t = New TestTimer()
End Using
----