Compare commits

...

2 Commits

Author SHA1 Message Date
Antonio Aversa
87d0363a4d Fix RSPEC validation issue 2024-05-03 14:25:03 +02:00
antonioaversa
07a6a39e92 Create rule S6675 2024-05-03 14:25:03 +02:00
4 changed files with 5 additions and 2 deletions

View File

@ -13,7 +13,7 @@
"constantCost": "5min"
},
"tags": [
"confusing",
"confusing",
"clumsy",
"logging"
],

View File

@ -4,7 +4,7 @@ The https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writel
https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch[`TraceSwitch`] allows trace control via `bool` properties for each relevant https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracelevel[`TraceLevel`], such as https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch.traceerror[`TraceSwitch.TraceError`].
Using `Trace.WriteLineIf` with such properties should be avoided since it can lead to misinterpretation and produce confusion.
Using `Trace.WriteLineIf` with such properties should be avoided since it can lead to misinterpretation and produce confusion.
In particular, `Trace.WriteLineIf` may appear as equivalent to the level-specific tracing methods provided by `Trace`, such as https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror[`Trace.Error`], but it is not.

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1 @@
include::../rule.adoc[]