title: Obtaining Cyclomatic Complexity
body: <p>I am looking into calculating the cyclomatic complexity of java methods using Rascal.</p>
  
  <p>One approach to this would be:</p>
  
  <ul>
  <li>getting the AST from the method</li>
  <li>use visit pattern on this tree</li>
  <li>check for the following keywords which all increase the CC with one: <code>case</code>, <code>catch</code>, <code>do</code>, <code>while</code>, <code>if</code>, <code>for</code>, <code>foreach</code></li>
  </ul>
  
  <p>Another one is using graph theory and using the formula e-n+2.
  both e and n can be obtained quite easily using rascal functionality. My problem is how do I go about constructing the control flow graph, I found the following module:
   <code>analysis::flow::ControlFlow</code> which seems to be a step in the right direction but I am totally lost on where to go from there. </p>