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

NET-920 Modify rule S125: Add dotnet example #4589

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

sebastien-marichal
Copy link
Contributor

@sebastien-marichal sebastien-marichal commented Dec 24, 2024

NET-920

Part of NET-255

Fixes SonarSource/sonar-dotnet#6062

Review

A dedicated reviewer checked the rule description successfully for:

  • logical errors and incorrect information
  • information gaps and missing content
  • text style and tone
  • PR summary and labels follow the guidelines

Comment on lines +17 to +25
void Method(string s)
{
// if (s.StartsWith('A'))
// {
// s = s.Substring(1);
// }

// Do something...
}
Copy link
Contributor Author

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 😅

Copy link
Contributor

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;
}

Copy link
Contributor

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

Copy link

Quality Gate passed Quality Gate passed for 'rspec-tools'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link

Quality Gate passed Quality Gate passed for 'rspec-frontend'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link
Contributor

@CristianAmbrosini CristianAmbrosini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sebastien-marichal sebastien-marichal merged commit e5a0528 into master Dec 24, 2024
13 checks passed
@sebastien-marichal sebastien-marichal deleted the sma/modify-S125 branch December 24, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule S125: improve rule documentation with examples
2 participants