C#调用图生成工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/793685/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 01:23:52  来源:igfitidea点击:

C# Call Graph Generation Tool

c#.netcode-analysiscall-graph

提问by Waylon Flinn

I just got a heaping pile of (mostly undocumented) C# code and I'd like to visualize it's structure before I dive in and start refactoring. I've done this in the past (in other languages) with tools that generate call graphs.

我刚刚得到一堆(大部分是未记录的)C# 代码,我想在深入研究并开始重构之前将其结构可视化。我过去(在其他语言中)使用生成调用图的工具完成了此操作。

Can you recommend a good tool for facilitating the discovery of structure in C#?

你能推荐一个很好的工具来促进 C# 中结构的发现吗?

UPDATE

更新

In addition to the tools mentioned here I've seen (through the tubes) people say that .NET Reflectorand CLR Profilerhave this functionality. Any experience with these?

除了这里提到的工具之外,我还看到(通过管道)人们说.NET ReflectorCLR Profiler具有此功能。有这些经验吗?

采纳答案by Sam Saffron

NDependis pretty good at this. Additionally Visual Studio 2008 Team System has a bunch of features that allow you to keep track of cyclomatic complexity but its much more basic than NDepend. (Run code analysis)

NDepend在这方面做得很好。此外,Visual Studio 2008 Team System 有许多功能可以让您跟踪圈复杂度,但它比 NDepend 基础得多。(运行代码分析)

回答by Adam Robinson

I'm not sure if it will do it over just source code, but ANTS Profilerwill produce a call graph for a running application (may be more useful anyway).

我不确定它是否会仅通过源代码来完成,但ANTS Profiler将为正在运行的应用程序生成调用图(无论如何可能更有用)。

回答by Marc Gravell

Visual Studio 2010.

视觉工作室 2010

Plus, on a method-by-method basis - Reflector (Analyzer (Ctrl+R); "Depends On" and "Used By")

另外,在逐个方的基础上 - 反射器(分析器(Ctrl + R);“取决于”和“使用者”)

回答by codekaizen

SequenceViz and DependencyStructureMatrix for Reflector might help you out: http://www.codeplex.com/reflectoraddins

反射器的 SequenceViz 和 DependencyStructureMatrix 可能会帮助你:http: //www.codeplex.com/reflectoraddins

回答by C. Ross

I've used doxygento some success. It's a little confusing, but free and it works.

我已经使用doxygen取得了一些成功。这有点令人困惑,但免费且有效。

回答by Patrick from NDepend team

Concerning NDepend, it can produce some usable call graph like for example (image full size here)

关于 NDepend,它可以生成一些可用的调用图,例如(此处为图像全尺寸)

alt text

替代文字

Find more explanations about NDepend call graph here.

在此处查找有关 NDepend 调用图的更多说明。

回答by Dhile

It's bit late, but http://sequenceviz.codeplex.com/is an awesome tool that shows the caller graph/Sequence diagram. The diagrams are generated by reverse engineering .NET Assemblies.

有点晚了,但是http://sequenceviz.codeplex.com/是一个很棒的工具,可以显示调用者图/序列图。这些图表是通过逆向工程 .NET 程序集生成的。

回答by Bill Yang

As of today (June 2017), the best tool in class is Resharper's Inspect feature. It allows you to find all incoming calls, outgoing calls, value origin/destination, etc.

截至今天(2017 年 6 月),课堂上最好的工具是 Resharper 的 Inspect 功能。它允许您查找所有来电、去电、值来源/目的地等。

The best part of ReSharper, compared to other tools mentioned above: it's less buggy.

与上面提到的其他工具相比,ReSharper 最好的部分是:它的错误更少。