Meziantou.Analyzer
Meziantou.Analyzer copied to clipboard
Interest in a ReturnTaskDirectlyAnalyzer?
Hi, I made an analyzer which detects instances of a Task
which can be returned directly: https://github.com/CollinAlpert/ReturnTaskDirectlyAnalyzer
I'd love more people to use it and was wondering if you'd be interested in me opening a PR adding it to this package.
Hi, you can submit a PR with the rule to remove await when this is not needed.
- You can add a new id in
RuleIdentifiers.cs
- Don't forget to generate the documentation file using the
DocumentationGenerator
project
Removing await
changes the behavior of methods (exception handling, debugging, and surely other things), but it improves the performance. I think it is ok to set the analyzer level to Info.
Note that we used to have this rule in our code and have scaled back on it (we still use it in some places).
The problem with this is that it really kills the reconstructed callstack in cases of errors, which makes it close to impossible to track where the code was called for.
That's interesting. I know this pattern changes behavior, however I never had the problem of an unreadable stack trace due to this. There were always plenty of other async methods which did show up.
That's interesting. I know this pattern changes behavior, however I never had the problem of an unreadable attack trace due to this. There were always plenty of other async methods which did show up.
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.