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

Rubberduck Internal Codebase Analyzers #4250

Open
4 tasks
bclothier opened this issue Aug 2, 2018 · 4 comments
Open
4 tasks

Rubberduck Internal Codebase Analyzers #4250

bclothier opened this issue Aug 2, 2018 · 4 comments
Labels
development-issue Issues encountered while developing RD, not in RD itself enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. rubberduck-analyzer-project up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

Comments

@bclothier
Copy link
Contributor

bclothier commented Aug 2, 2018

For a while we've had RubberduckCodeAnalysis project which is referenced by all other Rubberduck.*** projects to manage code quality. Due to the complexity of the codebase and the COM interactions, code analyzers are good tools to aid in code review and maintaining the code quality of the project.

With PR #4238 we will now have 4 analyzers. There are other areas where we might want to see analyzers. Feel free to add what you think might be beneficial. Each should be its own PR.

  • Issue a warning for use of SCW classes within certain projects. For example, ideally, an inspection from Rubberduck.CodeAnalysis project should not need any COM access. However, it might be necessary for some certain inspections. The warning would provide an alert for closer scrutiny of the inspection being introduced.
  • Issue error for any direct COM access; all access must be meditated via SCWs exclusively. Namespaces that needs direct COM access must be annotated. This is to drive a clean separation at the seams.
  • Issue error for missing using or .Dispose of SCW that are owned by the classes. Note that this requires further thought regarding those provided by ProjectsProvider/ProjectRepository which actually requires the opposite inspection since those manage the lifetime of the SCWs.
  • ???
@bclothier bclothier added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky rubberduck-analyzer-project development-issue Issues encountered while developing RD, not in RD itself labels Aug 2, 2018
@rubberduck203
Copy link
Member

I thought Visual Studio provided a warning for Disposable objects that aren’t disposed. I might be imaging things or remembering something that’s only in the pro version.

@bclothier
Copy link
Contributor Author

Hmm. Curious. I think you're thinking of this CA2000. I think that comes from running code analysis. Or at least the ruleset that has that isn't enabled by default? The custom analyzers run without having to run the code analysis as a separate step.

@rubberduck203
Copy link
Member

Your right. I am thinking of that CA. Guess I’m surprised it isn’t also an analyzer.

@bclothier
Copy link
Contributor Author

FWIW: The IDisposable analyzer now has a open PR that will allow us to decorate the classes. This may need testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development-issue Issues encountered while developing RD, not in RD itself enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. rubberduck-analyzer-project up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Projects
None yet
Development

No branches or pull requests

2 participants