title: SonarQube: quality gate coverage on new code
body: <p>The scenario below is not working for me.</p>
  
  <p>I performed two analysis t1 and t2 as described below</p>
  
  <p>t1: Code with 13.6% coverage is analysed and sent to SonarQube server. Here I am using /d:sonar.projectDate=2016-11-24 as parameter to the scanner. It is 61 lines of code in t1.</p>
  
  <p><a href="https://i.stack.imgur.com/JxTQb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JxTQb.png" alt="enter image description here"></a></p>
  
  <p>t2: Removed the date parameter. Added new code without coverage and also added some duplicated lines. It is 158 lines of code in t2. Coverage dropped to 3.8%. Meaning that lots of code was introduced without the expected coverage.</p>
  
  <p><a href="https://i.stack.imgur.com/otTCH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/otTCH.png" alt="enter image description here"></a></p>
  
  <p>Questions:</p>
  
  <ol>
  <li>Why is my quality gate still not failing? I am using default quality gate on a local instance. Anything less then 80% should fail the quality gate.</li>
  <li>I see some other posts where people say that SCM should be enabled for this to work. What would be the relation? Does anybody know how this coverage on new code is really calculated?</li>
  <li>If I enable "common-cs:InsufficientLineCoverage" then the quality gate fail. But it is not related to the thresold that exists on the quality gate, it will follow the thresold of the rule which by default is 65%.</li>
  </ol>
  
  <p>Context where it happens:</p>
  
  <ol>
  <li>Local instance with Default Profile and Quality Gates</li>
  <li>SonarQube 6.1</li>
  <li>Scanner 2.2.0.24</li>
  <li>C# Plugin 5.5.0.479</li>
  </ol>