简体   繁体   English

使用 SonarQube 5.4 进行 Scala 分析

[英]Scala analysis with SonarQube 5.4

I want to know if SonarQube 5.4 supports scala?我想知道SonarQube 5.4 是否支持scala? Can we perform scala analysis with respect to SonarQube?我们可以对 SonarQube 进行 Scala 分析吗? By default SonarQube does java analysis, I want to know if it works with scala because our code is built with sbt.默认情况下,SonarQube 进行 java 分析,我想知道它是否适用于 scala,因为我们的代码是用 sbt 构建的。

I've gone through some third party plugins like我已经使用了一些第三方插件,例如

  • Sagacify/sonar-scala Sagacify/sonar-scala
  • ncredinburgh/sonar-scalastyle ncredinburgh/sonar-scalastyle
  • RadoBuransky/sonar-scoverage-plugin RadoBuransky/sonar-scoverage-plugin

Error during SonarQube Scanner execution: SonarQube 扫描仪执行期间出错:

ERROR: You must install a plugin that supports the language 'scala'
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR: SonarQube scanner exited with non-zero code: 1

根据他们的主页 ( https://www.sonarqube.org/features/multi-languages/ ) 不支持 Scala。

I know this is a year old question.我知道这是一个老问题。 But I did integrate sonrqube-6.7.1 successfully in scala project for coverage as well as static code analysis.但是我确实在 Scala 项目中成功集成了sonrqube-6.7.1 以进行覆盖和静态代码分析。

  1. For code coverage report using scoverage对于使用 scoverage 的代码覆盖率报告

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")

  1. For code analysis using below plugin使用以下插件进行代码分析

addSbtPlugin("com.github.mwz" % "sbt-sonar" % "1.6.0") addSbtPlugin("com.github.mwz" % "sbt-sonar" % "1.6.0")

  1. install sonarscala and scoverage plugins from Sonarqube marketplace从 Sonarqube 市场安装 sonarscala 和 scoverage 插件

  2. configure sonar-scanner on server and envirnment variable SONAR_SCANNER_HOME = <>在服务器和环境变量上配置声纳扫描仪 SONAR_SCANNER_HOME = <>

  3. sbt sonarScan - this will publish reports to sonarqube sbt sonarScan - 这将向 sonarqube 发布报告

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM