title: Sonarqube does not retrieve my JavaScript coverage from LCOV
body: <p>I have an application with the following structure:</p>
  
  <pre><code>my-application
    +- pom.xml
    +- app
    |   +- scripts
    |   |   +- app.js
    |   |   +- **/*.js
    |   +- 3rd-party-libs
    +- build
    +- node_modules
    +- test
  </code></pre>
  
  <p>I've create the <code>pom.xml</code> only to run the SonarQube analysis. Otherwise, all the tasks are run by Grunt (tests are run with Karma).</p>
  
  <p>The content of the <code>pom.xml</code> is the following:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;sonar.language&gt;js&lt;/sonar.language&gt;
      &lt;sonar.sourceEncoding&gt;UTF-8&lt;/sonar.sourceEncoding&gt;
      &lt;sonar.javascript.coveragePlugin&gt;lcov&lt;/sonar.javascript.coveragePlugin&gt;
      &lt;sonar.javascript.lcov.reportPath&gt;build/karma/coverage/lcov.info&lt;/sonar.javascript.lcov.reportPath&gt;
      &lt;sonar.exclusions&gt;app/3rd-party-libs/**,node_modules/**&lt;/sonar.exclusions&gt;
      &lt;sonar.dynamicAnalysis&gt;reuseReports&lt;/sonar.dynamicAnalysis&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
      &lt;sourceDirectory&gt;app/scripts&lt;/sourceDirectory&gt;
      &lt;testSourceDirectory&gt;test&lt;/testSourceDirectory&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>When I run <code>grunt test</code>, it creates a <code>build/karma/coverage/lcov.info</code> that contains the following information:</p>
  
  <pre><code>TN:
  SF:./app/scripts/app.js
  FN:16,(anonymous_1)
  FN:26,(anonymous_2)
  FNF:2
  ...
  </code></pre>
  
  <p>After the SonarQube analysis, the dashboard shows a 0% code coverage.</p>
  
  <p>I suspected that the path in the <code>SF:</code> was the source of the error. Thus, I've changed the <code>sonar.javascript.lcov.reportPath</code> property to use another <code>lcov.info</code> to test different values: <code>app.js</code>, <code>./app.js</code>, <code>app/scripts/app.js</code>, <code>./app/scripts/app.js</code>, but none worked, keeping the coverage to 0%.</p>
  
  <p>What I am missing?</p>
  
  <p>Just in case, I have the following configuration in my <code>karma.conf.js</code>:</p>
  
  <pre><code>coverageReporter: {
    reporters: [
      {
        type: 'lcov',
        dir: 'build/karma/coverage',
        subdir: '.'
      }
    ]
  },
  </code></pre>
  
  <p>ps: Sonar version is 3.7.2, but I also tried on a 4.3, with the same results...</p>
  
  <hr>
  
  <p><strong>Edit</strong>: I've updated my configuration to use Sonar-runner directly, I'm using the latest version of Sonar (5.0.1) and JS plugin (2.3). I've also modified manually the <code>lcov.info</code> to have a "good" format (at least one format that matches the Sonar repo example):</p>
  
  <pre><code>SF:./app/scripts/app.js
  DA:2,1
  DA:20,1
  DA:29,1
  DA:34,1
  end_of_record
  SF:./app/scripts/services/exampleService.js
  DA:1,1
  DA:11,1
  DA:12,0
  end_of_record
  </code></pre>
  
  <p>The <code>sonar-project.properties</code> looks like:</p>
  
  <pre><code>sonar.projectKey=xxx
  sonar.projectName=xxx
  sonar.projectVersion=xxx
  sonar.sourceEncoding=UTF-8
  
  sonar.sources=app/scripts
  sonar.tests=test
  sonar.exclusions=app/3rd-party-libs/**,node_modules/**
  sonar.dynamicAnalysis=reuseReports
  sonar.language=js
  sonar.projectBaseDir=.
  sonar.javascript.coveragePlugin=lcov
  sonar.javascript.lcov.reportPath=build/karma/coverage/lcov.info
  </code></pre>
  
  <p>And still, 0% of coverage :(</p>