-
Notifications
You must be signed in to change notification settings - Fork 29
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
NET-920 Modify rule S125: Add dotnet example #4589
Conversation
void Method(string s) | ||
{ | ||
// if (s.StartsWith('A')) | ||
// { | ||
// s = s.Substring(1); | ||
// } | ||
|
||
// Do something... | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not really inspired if you have a better idea 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about (but it's really nitpick):
int CalculateTotal(int[] prices)
{
int total = 0;
foreach (int price in prices)
{
total += price;
}
// int discount = 10;
// total -= discount;
return total;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To have some real code in the method, but as I said, very nitpick and optional
2421816
to
d8af44e
Compare
Quality Gate passed for 'rspec-tools'Issues Measures |
Quality Gate passed for 'rspec-frontend'Issues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
NET-920
Part of NET-255
Fixes SonarSource/sonar-dotnet#6062
Review
A dedicated reviewer checked the rule description successfully for: