aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Cleanup Mvc Analyzers

Open Youssef1313 opened this issue 3 years ago • 1 comments

Minor code cleanup.

  • Renaming of all analysis contexts to just context is intentional, and the shadowing is intentional. This is a common pattern in roslyn analyzers to avoid usage of outer contexts when they shouldn't be used. One common issue is accidentally using outerContext.CancellationToken instead of innerContext.CancellationToken. The name context is also shorter :)
  • Removed unnecessary ref in AttributesShouldNotBeAppliedToPageModelAnalyzer.
  • Minor changes to ActualApiResponseMetadataFactory:
    • Fixed a doc comment.
    • Removed unnecessary conditions that are already handled
    • Avoid unnecessary semantic model calls.
  • Cleanup unreachable conditions in codefix providers.

Youssef1313 avatar Jul 16 '22 13:07 Youssef1313

Thanks for your PR, @Youssef1313. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

ghost avatar Jul 16 '22 13:07 ghost

@JamesNK Want to take a look at this as well?

captainsafia avatar Dec 06 '22 23:12 captainsafia

This merge is long overdue but thank you, @Youssef1313!

captainsafia avatar Dec 07 '22 00:12 captainsafia