Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE0059 & IDE0060 false positive #44494

Open
ChezMose opened this issue Jan 23, 2025 · 0 comments
Open

IDE0059 & IDE0060 false positive #44494

ChezMose opened this issue Jan 23, 2025 · 0 comments
Labels
⌚ Not Triaged Not triaged

Comments

@ChezMose
Copy link

Describe the issue or suggestion

There is a case of false positive on IDE0059 and IDE0060 rules.
It occurs when you use a variable or argument as an input and an output parameter in a function call and when the out parameter is placed first.

Example for IDE0059

string input = "default";
var res = this.Adjust(out input, input);

Example for IDE0060

public void DoSomething(string input = "")
{
    var res = this.Adjust(out input, input);
    ...
}

Not a major issue for most people I guess, but our team considers a best practice to put all the output parameters on the left side of any call (same side as the returned parameter). And as we do defensive programming we often have a status returned as part of any operation, so we often have the multiple outputs.

@dotnet-policy-service dotnet-policy-service bot added the ⌚ Not Triaged Not triaged label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌚ Not Triaged Not triaged
Projects
None yet
Development

No branches or pull requests

1 participant