title: Programmatically checking code complexity, possibly via c#?
body: <p>I'm interested in data mining projects, and have always wanted to create a classification algorithm that would determine which specific check-ins need code-reviews, and which may not.</p>
  
  <p>I've developed many heuristics for my algorithm, although I've yet to figure out the killer...</p>
  
  <p>How can I programmatically check the computational complexity of a chunk of code?</p>
  
  <p>Furthermore, and even more interesting - how could I use not just the code but the diff that the source control repository provides to obtain better data there..</p>
  
  <p>IE:  If I add complexity to the code I'm checking in - but it reduces complexity in the code that is left - shouldn't that be considered 'good' code?</p>
  
  <p>Interested in your thoughts on this.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Apparently I wasn't clear.  I want this</p>
  
  <p>double codeValue = CodeChecker.CheckCode(someCodeFile);</p>
  
  <p>I want a number to come out based on how good the code was.  I'll start with numbers like VS2008 gives when you calculate complexity, but would like to move to further heuristics.</p>
  
  <p>Anyone have any ideas?  It would be much appreciated!</p>