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
精彩评论