I think we should start measuring our rate of change on the
Maintainability Index over time:

It's quite a simple process. For each 'module' of code, we just take:

  171 - 5.2 * ln(aveV) - 0.23 * aveV(g') - 16.2 * ln (aveLOC) - 50 * sin (sqrt(2.4 * 
perCM))

where 
  perCM    = the average percent of lines of comments per module,
  aveLOC   = the average count of lines of code per module
  aveV(g') = the average extended cyclomatic complexity per module 
  aveV     = the average Halstead Volume V per module.

For anyone not familiar with the latter concepts, the cyclomatic
complexity (CC) is simply calculated as:
  CC = E - N + p

Where for a connected graph of the module that shows the topology of
control flow within the program,
  E = the number of edges of the graph
  N = the number of nodes of the graph
  p = the number of connected components

and the Halstead Volume is simply
  HV = N * (LOG2 n)

where 
  N = N1 + N2
  n = n1 + n2
 
where 
  n1 = the number of distinct operators
  n2 = the number of distinct operands
  N1 = the total number of operators
  N2 = the total number of operands 

(This is spelt out in much more detail at
  http://www.sei.cmu.edu/activities/str/descriptions/mitmpm.html)

This should be fairly simple to implement (I'll leave that as an exercise
for the reader), and could probably be used as a starting point for
CPANTS.

Tony
-- 
--------------------------------------------------------------------------
 Tony Bowden | [EMAIL PROTECTED] | http://www.tmtm.com/
                        I'd rather walk than crawl but my heels are aching
--------------------------------------------------------------------------


PGP signature

Reply via email to