title: Cyclomatic complexity error in my code
body: <p>I am getting 2 errors in my grunt file</p>
  
  <p><code>line 61   col 25  This function's cyclomatic complexity is too high. (10)</code></p>
  
  <p><code>line 101  col 22  This function's cyclomatic complexity is too high. (10)</code></p>
  
  <p>how could I reduce the Cyclomatic complexity in this case ? my functions aren't that complex</p>
  
  <p>first error</p>
  
  <pre><code>    remove: function(line, row, type) {
        var spreadSelected = (row.spreadSelected &amp;&amp; type === 'spread'),
          totalSelected = (row.totalSelected &amp;&amp; type === 'total'),
          moneyLineSelected = (row.moneyLineSelected &amp;&amp; type === 'moneyline'),
          lineValue;
        if (spreadSelected || totalSelected || moneyLineSelected) {
          switch (type) {
            case 'spread':
              lineValue = row.spread.line;
              break;
            case 'total':
              lineValue = row.total.line;
              break;
            case 'moneyline':
              lineValue = row.moneyLineId;
              break;
            default:
              break;
          }
  
          AuthFactory.getCustomer().then(function(credentials) {
            betSlipSelectionRequest('/betSlip/removeSelection', {
              customerId: credentials.customer,
              game: row.game,
              pair: row.pair,
              line: lineValue
            });
          });
  
          if (spreadSelected) {
            row.spreadSelected = false;
          }
          if (totalSelected) {
            row.totalSelected = false;
          }
          if (moneyLineSelected) {
            row.moneyLineSelected = false;
          }
        }
      }...
  </code></pre>
  
  <p>and then the 2nd error function</p>
  
  <pre><code>    add: function(line, row, type) {
        var spreadSelected = (row.spreadSelected &amp;&amp; type === 'spread'),
          totalSelected = (row.totalSelected &amp;&amp; type === 'total'),
          moneyLineSelected = (row.moneyLineSelected &amp;&amp; type === 'moneyline'),
          lineValue;
        if (!(spreadSelected || totalSelected || moneyLineSelected)) {
          switch (type) {
            case 'spread':
              lineValue = row.spread.line;
              break;
            case 'total':
              lineValue = row.total.line;
              break;
            case 'moneyline':
              lineValue = row.moneyLineId;
              break;
            default:
              break;
          }
          AuthFactory.getCustomer().then(function(credentials) {
            betSlipSelectionRequest('/betSlip/addSelection', {
              customerId: credentials.customer,
              game: row.game,
              pair: row.pair,
              line: lineValue
            });
          });
          switch (type) {
            case 'spread':
              row.spreadSelected = true;
              break;
            case 'total':
              row.totalSelected = true;
              break;
            case 'moneyline':
              row.moneyLineSelected = true;
              break;
          }
        }
      }
  </code></pre>
  
  <p>the weird thing here: this error is only with me, my co-worker opens the same files and run grunt and there is no errors in their terminals.</p>