Questions tagged [sonarjs]

SonarJS is the JavaScript analyzer for SonarQube and SonarLint.

Links:

34 questions
17
votes
1 answer

Sonarqube coverage configuration for React and Jest

I have problem with configuration sonarqube to work properly with React + Jest. My configuration: my_moudle.sonar.projectBaseDir=front_app my_module.sonar.javascript.file.suffixes=.js,.jsx…
B.Ohara
  • 241
  • 1
  • 2
  • 10
9
votes
2 answers

SonarQube and Lcov report Could not resolve file paths

We are trying to make a SonarQube code coverage report for our angular application. We have used Karma to generate a code coverage report and import it into SonarQube analyzer. The SonarQube already has C# coverage for our project, now we want to…
Murali Murugesan
  • 22,423
  • 17
  • 73
  • 120
5
votes
1 answer

How to make SonarJS show ESLint issues?

I am trying to import ESLint issues to SonarQube by the following: eslint -f json -o report.json . And then running sonar-scanner with key -Dsonar.eslint.reportPaths=report.json. However, SonarQube analysis reports only issues for rules provided…
4
votes
1 answer

Wildcards for lcov.info path in the SonarQube scanners?

I can't seem to use wildcards to specify a path to my lcov.info file in the SonarQube MSBuild Scanner. e.g.: /d:sonar.javascript.lcov.reportPath="..\..\build\coverage\lcov\*\lcov.info" but if I specify the full path, it works:…
Rodders
  • 2,425
  • 2
  • 20
  • 34
3
votes
1 answer

ignore rule on block

Like with sonar-java and the annotation @SuppressWarnings("squid:S2078"), is there any way with sonar-js to ignore one rule on a block of code ?? The git repo doesn't have any exemple of that. I develop a react-redux ES6 app and i have reducer with…
asicfr
  • 1,061
  • 1
  • 13
  • 30
3
votes
2 answers

SonarQube analysis on JSX file

I need to run SonarQube analysis for .jsx file . Is there any way so that we can run sonar-runner to analyse JSX file for performance issue?
curogal
  • 73
  • 1
  • 2
  • 5
2
votes
2 answers

SonarJs still shows warning about postMessage cross-domain issue

The error message is "make sure this cross-domain message is being sent to the intended domain". This check rule from RSPEC-2819 Authors should not use the wildcard keyword ( *) in the targetOrigin argument in messages that contain any confidential…
Clocher Zhong
  • 2,226
  • 1
  • 17
  • 33
2
votes
1 answer

How to disable Sensor ESLint-based SonarJS?

In our environment we already use ESLint to produce json report. Starting from Sonarqube 7.2, SonarJS plugin can import this report file. But I see in analysis report that some Sensor ESLint-based SonarJS also starting. But this one does not…
2
votes
1 answer

SonarJS code coverage is shown as 0

I am using SonarQube 6.5, And trying import lcov.info file for code coverage using sonar.javascript.lcov.reportPaths property. My build is done using Jenkins. code is deployed and tested at /path/to/Deploydirectory/parent-project1/project1/ and…
PPB
  • 287
  • 3
  • 7
  • 19
2
votes
0 answers

SonarJS not respecting sonar.javascript.globals

I have configured a long list of sonar.javascript.globals on the server side (SonarQube) for all js projects, however when triggering a sonar check from CI with sonar-maven-plugin I get the known S3827 (ReferenceErrorCheck). When I extend the mvn…
modzozo
  • 13
  • 4
1
vote
0 answers

Sonar scanner with SonarJS fails to parse typescript

I am using SonarQube Scanner 3.3.0.1492, with the SonarJS 5.2.1.7778 (javascript) plugin. I did a yarn install to install typescript v3.5.3. When I run the sonar scanner, I receive a couple of different parse errors for things that normally parse…
pasquers
  • 772
  • 1
  • 8
  • 24
1
vote
1 answer

How to suppress errors in SonarJS for a single line?

I'm trying to use Sonar with Javascript, and rather than ignoring errors after analysis in SonarQube, I'd like to just comment some lines with so that they never get flagged. (Something like the // NOSONAR comment in Sonar for Java that suppresses…
1
vote
1 answer

SonarJS marks issues if FlowType type annotations from the standard library are present

SonarJS 4.0 ignored FlowType annotations, but with SonarJS 4.1 they are marked as reference error (Rule: javascript:S3827). I just want to clearify if this is intended behaviour and what is the intended "workflow" regarding this. if it is not a bug,…
Simon Schrottner
  • 4,146
  • 1
  • 24
  • 36
1
vote
1 answer

How to set javascript ecmascript version in sonarjs?

I am currently using sonarqube for codecovergae.Karma and jasmine as testing tool. Due to project complexity and dependency, i m using babel transpiler to convert ts to es5. I am able to configure sonar-qube. However i am getting code smell like…
xdeepakv
  • 7,835
  • 2
  • 22
  • 32
1
vote
1 answer

How to use npm package of SONARJS

I'm wondering how to get complexity metrics for my JS functions. I've tried to run the package against my application, but had only several code style warnings. I'm pretty confident I should be warned about complexity in several cases. Is there a…
ivn-cote
  • 11
  • 1
1
2 3