rspec/rules/S1481/csharp/rule.adoc
Alban Auzeill 2c306d110e Fix code block ambiguity with old header style
Ensure blank line before list and clean the one leading space
2020-06-30 17:16:12 +02:00

32 lines
466 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
----
public int NumberOfMinutes(int hours)
{
int seconds = 0; // seconds is never used
return hours * 60;
}
----
== Compliant Solution
----
public int NumberOfMinutes(int hours)
{
return hours * 60;
}
----
== Exceptions
Unused locally created resources in a <code>using</code> statement are not reported.
----
using(var t = new TestTimer()) // t never used, but compliant.
{
//...
}
----