Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Apr 9, 2024

You can preview this rule here (updated a few minutes after each push).

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

@github-actions github-actions bot added the dotnet label Apr 9, 2024
@martin-strecker-sonarsource martin-strecker-sonarsource changed the title Create rule S6966 Create rule S6966: Awaitable method should be used Apr 9, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

I did not look at the code snippets yet.
I release the review so that you can take a look.

Excellent write-up!
I like that it's very to-the-point, while also describing the problems of blocking.
Nice job!
Most of my comments are phrasing suggestions or more documentation links.

(looking at code now)

"constantCost": "5min"
},
"tags": [
"async-await"

Choose a reason for hiding this comment

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

What do you think about performance as well?

Choose a reason for hiding this comment

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

I'm not sure. This is about freeing up a resource (thread), that is not needed until the awaited task is finished. That may or may not be beneficial performance-wise.
For me, this rule is more about correctness: If you are async already, then be as async as possible and slice your method at every opportunity.
What do you think?

Choose a reason for hiding this comment

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

I get your point, but at the end of the day, what happens if you are inefficient about freeing resources?

If your application does not need to scale, it really doesn't matter.
The only time it matters is if you want to use all the resources available in an optimal way.
And if you fail at that, it means you are serving < MAX clients, or something similar.

I would ask Denis as well, as it also has to do with how we want to promote it.

Choose a reason for hiding this comment

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

@denis-troller What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Very good tests.
Left a couple of suggestions and questions.

@sonarqube-next
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

@sonarqube-next
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
Contributor

Choose a reason for hiding this comment

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

LGTM!
One comment remaining, please consider asking Denis' opinion.

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.

4 participants