【问题标题】:SonarQube / AngularJS - How to I get SonarQube up and running to get my Angular project integrated / analyzed?SonarQube / AngularJS - 如何让 SonarQube 启动并运行以集成 / 分析我的 Angular 项目?
【发布时间】:2018-01-27 10:47:37
【问题描述】:

我有一个前端项目(AngularJS - 不是最新版本)并想用 SonarQube 分析代码。

这是我到目前为止所做的。

1) 从 GitHub 抓取我的项目并克隆到桌面。

2) 下载 SonarQube-6.5 并解压到桌面。

3) 打开sonarqube-6.5\extensions\plugins(在我解压的目录中)并粘贴一个前端插件(从https://github.com/groupe-sii/sonar-web-frontend-plugin下载)

4) 在我的项目的 web 目录中创建了 sonar-project.properties

内容

# Required metadata
sonar.projectKey=project-name
sonar.projectName=project name
sonar.projectVersion=0.1

# Comma-separated paths to directories with sources (required)
sonar.sources=src/app

# exclude some files and folders (typically dependencies)
sonar.exclusions=bower_components/**/*, node_modules/**/*

# Encoding of the source files
sonar.sourceEncoding=UTF-8

然后我在命令行中运行了以下内容。

cd 项目根目录

"c:\\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe" 开始 /k:"orag.sonarqube:sonarqube-scanner-msbuild" /n:"CMNHMobile-nextrelease" /v:"1.0" c:\pathto ms build\MSBuild.exe /t:Rebuild “c:\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe” 结束

执行这些步骤后,我的 localhost:9000 (SonarQube) 中没有列出任何项目

我可以做些什么来展示项目以供分析?

【问题讨论】:

标签: angular sonarqube


【解决方案1】:

使用以下插件 (SonarJS) 帮助解决了我的困惑并开始分析 - docs.sonarqube.org/display/PLUG/SonarJS

【讨论】:

    【解决方案2】:

    这是 SonarJS 项目 github 主页,您可以在其中获取最新更新:https://github.com/SonarSource/SonarJS

    【讨论】:

    • 谢谢 Sam,我忽略了提供我找到的实际插件的直接链接。你花时间回答我的问题,我给了你一分。
    猜你喜欢
    • 1970-01-01
    • 2020-12-15
    • 2019-07-23
    • 2018-11-12
    • 2019-02-23
    • 1970-01-01
    • 1970-01-01
    • 2022-08-08
    • 1970-01-01
    相关资源
    最近更新 更多