In addition to the good suggestions already given, you could consider measuring the coupling of the code. The simplest (least coupled code) would have no static or global variables anywhere. The coupling metric would get bigger which each REFERENCE to a variable that is in any way static (that is, defined logically at a higher level than the current function's stack). A more accurate measure of coupling would increase the metric more for variables that are more global. For example, in various object oriented languages like Ada, C++, Java, etc. there are ways of making a variable global to a class where each method in the class can have access to that global variable. C++ programmers actually tend to call this level of globality "local variables" which makes it very hard to measure how global a variable is. However, by considering everything to be global (at some numerical level) that is not purely local (that is purely ADT, or purely reentrant) an accurate measure of coupling can be derived. This coupling number can be used to see the number of steps it takes to analyze the impact of changes to the code or to write or exectue test plans procedures for the cascading effects of changing variables. Mike Brenner [log in to unmask]