Fix S6966 FP: Methods with different signatures should not trigger this rule. #9265
Labels
Area: C#
C# rules related issues.
Sprint: Hardening
Fix FPs/FNs/improvements
Type: False Positive
Rule IS triggered when it shouldn't be.
Projects
Milestone
Description
S6966 is being triggered on methods that do not match in method signature. For example, in the MongoDB driver,
Find
andFindAsync
are not related.Find
returnsIFindFluent
for building chained mongo requests, whileFindAsync
returnsIAsyncCursor
. The following should not be triggering S6966.UnrelatedThing Find(string s, int i = 0)
orUnrelatedThing Find(string s)
Task<string> FindAsync(string s)
Only
string Find(string s)
should trigger this rule.Repro steps
Expected behavior
_ = Find("123");
should not trigger S6966.Actual behavior
_ = Find("123");
triggers S6966.Known workarounds
Please provide a description of any known workarounds.
Related information
The text was updated successfully, but these errors were encountered: