Richard Fennell
Richard Fennell

Reputation: 160

Unable to analyse Javascript file with SonarQube

When trying to do analysis of a project using the javascript 2.9 plugin (using SonarQube 5.2 and the MSBuild runner) I am getting the error on a file

ERROR: Error during Sonar runner execution [error]Caused by: org.sonar.squidbridge.api.AnalysisException: Unable to analyse file: C:/Builds/source/_work/thefile.js

I have tried uninstalling the javascript plugin, but that just moved the issues to the failure being on a CSS file, as in CSS reported issue

Anyone got a solution that does not involve unloading the javascript and css plugins?

Upvotes: 2

Views: 4634

Answers (1)

Pierre-Yves
Pierre-Yves

Reputation: 1546

Your logs contain some stacktraces which contain useful information. The errors you get come from the SonarQube Web plugin, not the JavaScript plugin. I created the following ticket to track this issue: https://jira.sonarsource.com/browse/SONARWEB-43

Edit: This bug in the SonarQube Web plugin prevents the analysis from completing. The Web plugin is automatically called in the analysis because it's supposed to analyse all files which name ends with ".html".

Possible workarounds:

  • Disable the plugin for the analysis with the following setting: sonar.excludePlugins=web
  • Exclude html files from the analysis

See http://docs.sonarqube.org/display/SONAR/Analysis+Parameters and http://docs.sonarqube.org/display/SONAR/SonarQube+Scanner+for+MSBuild+Configuration

Upvotes: 1

Related Questions