自动重构访问修饰符
是否有一种工具可以运行 Visual Studio 解决方案,并将访问修饰符调整为解决方案中未调用的任何内容,并在适用的情况下转换为私有或内部?
我想我可以将所有内容更改为私有,然后使用编译器消息并手动完成......但这可能需要一段时间,如果有一些自动的东西,那就太棒了!
Is there a tool that can run through a visual studio solution and adjust access modifiers to anything not being 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 by hand...but that could take a while, if there was something automatic, that would be fantastic!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用NDepend,你可以分析你的代码以获得类似的东西。它有一种类似 SQL 的查询语言,您可以在其中选择所有公共成员,也可以是内部成员或私有成员,如下所示:
编辑:请参阅有关 最佳封装。
With NDepend you can analyze your code for stuff like this. It has a SQL-like query language where you can select all the members that are public and could be internal or private, like this:
EDIT: See this blog post about Optimal Encapsulation.