Automatic refactor access modifiers

Is there a tool that can be run through a visual studio solution and configure access modifiers for everything that is not called in the solution, is converted to private or internal, where applicable?

I suppose I could just change everything to private, and then use the compiler messages and do it manually ... but it might take some time if something was automatic, it would be fantastic!

+6
access-modifiers c # visual-studio refactoring
source share
1 answer

With NDepend, you can analyze your code for such things. It has an SQL-like query language where you can select all public members and be internal or private, for example:

SELECT METHODS WHERE CouldBeInternal SELECT METHODS WHERE CouldBePrivate 

EDIT: See this blog post for Optimal Encapsulation .

+3
source share

All Articles