我需要一个C#分析工具
我有大量 C# 遗留代码。
我需要对其进行分析,以便推荐在程序中构建一些新功能的最佳方法。
有没有什么工具可以快速分析,并可以清晰地显示类关联,帮助我尽快了解这个旧逻辑?
任何关于如何最好地完成这项工作的经验故事或建议将不胜感激。
谢谢!
I have a big legacy code in C#.
I need to analyze it in order to recommend the best way to build some new features in the program.
Is there any tool which enables fast analyzing, and can show the class associations in a clear way which helps me get in to this old logic as fast as possible?
Any experience stories or recommendation on how get this best done would be appreciated.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
有一些静态分析工具可以帮助处理这样的代码库。
Visual Studio 2010 架构版本附带类图设计器,将为您生成类图和依赖关系(架构->生成依赖关系图->类图)。
还有商业版 nDepend。
There are static analysis tools that can help with such a codebase.
Visual Studio 2010 architecture edition comes with the class diagram designer, and will generate the class diagram and dependancies for you (Architecture->Generate Dependency Graph->Class Diagram).
There is also the commercial nDepend.
我建议您使用 NDepend。
看一下此列表,它包含每个工具的简短描述。
I would recommend you to use NDepend.
Take a look at this list, it includes short description of each tool.
我强烈建议您查看 Visual Studio 2010 Architecture Explorer 和依赖关系图为您提供强大的功能分析遗留代码。
I highly recommend you to take a look at Visual Studio 2010 Architecture Explorer and Dependency Graphs which provide you with great capabilities to analyze legacy codes.
为了完成 OD 答案,NDepend 是一个专门用于分析和掌握大型 .NET 代码库(遗留或不是)。
该工具提供快速分析、依赖图和依赖矩阵、代码比较、代码裁决工具、VS 完全集成以及更多功能特点。您现在可以在您的代码上尝试一下,因为我们建议提供免费的试用版。
由于您似乎对探索类关联之类的依赖关系特别感兴趣,这里是从依赖关系开始的介绍图形。
这里是从依赖矩阵开始的介绍(比图更适合探索大段代码中的依赖关系)。
To complete the O.D answer, NDepend is a tool especially dedicated to analyze and master large .NET code bases (legacy or not).
The tool proposes fast analysis, dependency graph and dependency matrix, code comparison, code ruling facilities, VS full integration and more features. You can try it now on your code since a free Trial version is proposed.
Since you seem interested especially by exploring dependencies like class associations, here is an introduction to start with dependency graph.
Here is an introduction to start with dependency matrix (better suited than graph to explore dependencies in a large piece of code).
恕我直言,你能得到的最好的方法是 Resharper——使用类型层次结构、值跟踪和调用跟踪的组合是导航旧军舰遗留代码库并掌握它的最佳方法。
IMHO the best you can get is Resharper - a combination of using Type Hierarchy, Value Tracking and Call Tracking is the best way to navigate an old warship legacy codebase and get a grasp on it.