rspec/rules/S4829/csharp/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

62 lines
1.2 KiB
Plaintext

include::../description.adoc[]
include::../ask-yourself.adoc[]
include::../recommended.adoc[]
== Sensitive Code Example
----
using System;
public class C
{
public void Main()
{
Console.In; // Sensitive
var code = Console.Read(); // Sensitive
var keyInfo = Console.ReadKey(...); // Sensitive
var text = Console.ReadLine(); // Sensitive
Console.OpenStandardInput(...); // Sensitive
}
}
----
== Exceptions
This rule does not raise issues when the return value of the ``++Console.Read++`` ``++Console.ReadKey++`` or ``++Console.ReadLine++`` methods is ignored.
----
using System;
public class C
{
public void Main()
{
Console.ReadKey(...); // Return value is ignored
Console.ReadLine(); // Return value is ignored
}
}
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
=== on 16 Oct 2018, 17:43:47 Nicolas Harraudeau wrote:
*Implementation details*:
Any reference to ``++Console.In++`` should create an issue.
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]