简体   繁体   English

sonar-swift分析xcode项目

[英]sonar-swift to analyse xcode project

Im trying to analyse swift app using SonarQube. 我试图使用SonarQube分析swift应用程序。 followed the instructions from here 按照这里的说明

Im able to run the sonarqube server and running sonar-scanner while running it I'm getting this error 我能够运行sonarqube服务器并在运行时运行声纳扫描仪我收到此错误

com.sonarsource.AABA: No license for swift com.sonarsource.AABA:没有swift许可证

I'm using this plug in, backelite-sonar-swift-plugin-0.2.4.jar i feel this plug in is free and we can use it. 我正在使用这个插件,backelite-sonar-swift-plugin-0.2.4.jar我觉得这个插件是免费的,我们可以使用它。 correct me it I'm wrong. 纠正我,我错了。

What I did was: 我做的是:

  1. Download Sonarqube LTS version ( https://www.sonarqube.org/downloads/ ) 下载Sonarqube LTS版本( https://www.sonarqube.org/downloads/
  2. Download and install dependencies and Sonar-Swift from https://github.com/Backelite/sonar-swift (including sonar-scanner) https://github.com/Backelite/sonar-swift下载并安装依赖项和Sonar-Swift(包括声纳扫描仪)
  3. Download sonar-project.properties ( https://gist.github.com/Edudjr/db51907068ea76b116d11d9a9b13f05f#file-sonar-project-properties ) and configure it according to your project. 下载sonar-project.properties( https://gist.github.com/Edudjr/db51907068ea76b116d11d9a9b13f05f#file-sonar-project-properties )并根据您的项目进行配置。 Place it in your project root folder. 将它放在项目根文件夹中。
  4. Download run-sonar-swift.sh ( https://gist.github.com/Edudjr/79a2379842357c33709aecf040d9ae77#file-run-sonar-swift-sh ), place it in somewhere in your mac and add to path (/etc/paths). 下载run-sonar-swift.sh( https://gist.github.com/Edudjr/79a2379842357c33709aecf040d9ae77#file-run-sonar-swift-sh ),将其放在mac的某个位置并添加到路径(/ etc / paths) )。 I did a small change in the script because oclint was not running properly. 我对脚本进行了一些小改动,因为oclint运行不正常。
  5. Start your Sonarqube server (sonar.sh console in sonar folder) and run run-sonar-swift.sh in your project root folder. 启动Sonarqube服务器(sonar文件夹中的sonar.sh控制台)并在项目根文件夹中运行run-sonar-swift.sh。 You should be done. 你应该完成。

Manual Installation 手动安装

  1. In the page dedicated to the plugin you want to install (ex: for Python : SonarPython), click on the "Download" link of the version compatible with your SonarQube version. 在专用于您要安装的插件的页面中(例如:对于Python:SonarPython),单击与SonarQube版本兼容的版本的“下载”链接。

  2. Upload the downloaded jar file in your SonarQube Server and put it in the directory : $SONARQUBE_HOME/extensions/plugins . 将下载的jar文件上传到SonarQube Server并将其放在以下目录中: $SONARQUBE_HOME/extensions/plugins

  3. If another version of the same plugin is already there, you need to remove it, since only one version of a given plugin may be available in the extensions/plugins directory. 如果已存在同一插件的另一个版本,则需要将其删除,因为extensions/plugins目录中只有一个给定插件版本可用。

  4. Once done, you will need to restart your SonarQube Server. 完成后,您需要重新启动SonarQube服务器。

https://docs.sonarqube.org/display/SONAR/Installing+a+Plugin https://docs.sonarqube.org/display/SONAR/Installing+a+Plugin

Backelite Sonar-Swift last release: Backelite Sonar-Swift上次发布:

https://github.com/Backelite/sonar-swift/releases https://github.com/Backelite/sonar-swift/releases

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

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