开发者

Tool to Identifying Global Variables in VB.NET

Is there an automated tool for VB.Net that will identify all global variables in a project?

Short of that, is there any scripts that can be used that will facilitate a manual review of global variables?

There seems to be tools for C/C++, but not for VB.Net:

Tools to find global/static variables in C codebase

Is there a tool to list global v开发者_Python百科ariables used and output by a C function?

EDIT:

My current approach uses the following VS REGEX searches:

For finding global variables:

~(Private:b+)Shared:b+:i:b+As:b+

For finding global properties:

~(Private:b+)Shared:b+(~(ReadOnly:b+):i:b+)@Property:b+:i([(][)]|[]):b+As:b+


fxCop might help, but you might need to write a plugin for that particular function.

Also, ndepend (Using the CQL "code query langauge") I'm pretty sure will give you a report or globals (and a whole lot more).


What are you calling a "global variable"? a variable defined as Shared (private or otherwise) isn't 'global' at all.

Really, the only 'global' variables left in vb.net are declared as public in a module

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜