简体   繁体   English

比较Visual Studio 2010上的两个函数调用图

[英]Compare two functions call graph on visual-studio 2010

In my situation, I would like to find out all the functions containing this function call 在我的情况下,我想找出包含此函数调用的所有函数

DBase.CreateCommand();

But not include the following call 但不包括以下电话

DBase.CloseCommand(cmd);

In that function. 在那个功能上。

What I'm trying to do is to find out any not closed database connections. 我正在尝试做的是找出所有未关闭的数据库连接。

A tool, plugin, regex etc. are all welcome. 欢迎使用工具,插件,正则表达式等。

You can change the name of the method: CreateCommand() into a different name so you will get a bunch of errors at compile time and you will check those errors one by one? 您可以将方法的名称: CreateCommand()更改为其他名称,这样在编译时会收到一堆错误,并且将一个一个地检查这些错误?

or you can search by exact match: "CreateCommand();" 或者您可以通过完全匹配进行搜索: "CreateCommand();" or in Visual Studio, right click on the method then select Find All References... 或在Visual Studio中,右键单击该方法,然后选择“查找所有引用...”。

You could try Resharper or something like that - whilst not providing a compare (that I know of) it will make them easier to modify as changes will ripple though and it has a lot of neat tools. 您可以尝试Resharper或类似的工具-尽管不提供比较(据我所知),但由于更改会引起涟漪,而且修改功能很多,它会使它们更易于修改。 Barring that Fortify scanning or other code analysis tools pick up un-released resources such as dbconns, and readers ect as well although I believe they may be quite pricey! 除非Fortify扫描或其他代码分析工具可以使用未发布的资源(例如dbconns),但读者也可以使用ectcon,尽管我认为它们可能会很昂贵!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM