Fix S1226 FP: Parameters wrongly considered as unread before reassignment #2555
Labels
Area: C#
C# rules related issues.
Area: VB.NET
VB.NET rules related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
Projects
Milestone
Description
According to RSPEC-1226
Is null-checking or passing a parameter to a method like
string.IsNullOrWhiteSpace(text)
not reading the parameter?Repro steps
Expected behavior
The variable
text
has been used before it was assigned. So this code should be compliant.Actual behavior
The code is marked as non-compliant.
Known workarounds
Use the parameter to assign a local variable.
Related information
The text was updated successfully, but these errors were encountered: