sonar相关

发布时间 2023-12-06 14:21:32作者: 脉动丶

SonarQube使用

开发人员使用SonarQube

在SonarQube中完成注册并生成token

1、在https://sonar.atayun.com/ 中完成登录并点击 右上角头像 -> My Account

image-20221116103305218

2、点击 Security 填写token名称 并生成 token

image-20221116103710540

3、把token信息copy并保存

image-20221116103738415

SonarLint 安装

1、在File -> Plugins ->Marketplace中搜索sonar并安装

image-20221116102405157

SonarLint集成SonarQube

1、在File -> Tools -> SonarLint 中配置SonarQube相关信息

image-20221116102100050

2、选中SonarQube并填写 Connection Name 和 SonarQube URL:https://sonar.atayun.com/ 并点next

image-20221116102953616

3、填写之前在SonarQube 中生成的token,点击Next ->Next -> Create 完成配置。

image-20221116104039787

4、在Project Settings中配置project信息,选择刚才建立的Connection 并选择一个Project key

image-20221116105705279

5、点击添加按钮 “+” 添加其他的 Project key,完成后点击Apply 完成配置。

image-20221116110304996

SonarLint使用

1、点击工具栏 SonarLint -> Current File可以看到当前文件的扫描结果

image-20221116132106571

2、点击工具栏 SonarLint -> Report 可以看到本次提交的文件的扫描结果

image-20221116131941798