title: Cyclomatic Complexity in Visual Studio
body: <p>I do some tests with Visual Studio Code Metrics. As I can calculate the Cyclomatic Complexity, each <code>if</code>, <code>while</code>, <code>for</code> - operators increase the complexity with 1. I have the next simple method:</p>
  
  <pre><code>static bool ContainsNegative(int a, int b, int c, int d)
      {
          if (a &lt; 0 || b &lt; 0 || c &lt; 0 || d &lt; 0) return false;
          return true;
      }
  </code></pre>
  
  <p>But for it, the Cyclomatic Complexity is 5, instead of 2 (1 for the method + 1 for the <code>if</code>).
  My question is - this is because the Code Metrics calculate each condition in <code>if</code> operator as a different <code>if</code>? I.e. my method is equivalent to:</p>
  
  <pre><code>static bool ContainsNegative(int a, int b, int c, int d)
      {
          if (a &lt; 0) return false;
          if (b &lt; 0) return false;
          if (c &lt; 0) return false;
          if (d &lt; 0) return false;
          return true;
      }
  </code></pre>
  
  <p>Here is a screen with results:
  <a href="https://i.stack.imgur.com/605hp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/605hp.png" alt="Cyclomatic Complexity in Visual Studio"></a></p>
  
  <p>Also, is there a list with all rules described in details?</p>
  
  <p>Thank you!</p>