首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >持续代码质量管理-SonarQube-7.3简单使用 2.1. 查看配置2.2. 质量检测2.3. 浏览器查看

持续代码质量管理-SonarQube-7.3简单使用 2.1. 查看配置2.2. 质量检测2.3. 浏览器查看

作者头像
踏歌行
发布2020-10-15 14:31:29
2990
发布2020-10-15 14:31:29
举报
文章被收录于专栏:踏歌行的专栏踏歌行的专栏

安装了SonarQube以及Sonar Scanner之后,就需要那代码检测了。当然为了方便我们使用已有现成的demo,知道到对应的git地址下载即可。

1. sonar-examples下载

1 https://github.com/saurabhjuneja/sonar-example    

2. 案例检测

2.1. 查看配置

 1 [yun@mini04 python-sonar-runner]$ pwd
 2 /app/software/sonar-example-master/projects/languages/python/python-sonar-runner
 3 [yun@mini04 python-sonar-runner]$ ll
 4 total 12
 5 -rw-rw-r-- 1 yun yun 497 Aug  8  2015 README.md
 6 -rw-rw-r-- 1 yun yun 341 Aug  8  2015 sonar-project.properties
 7 drwxrwxr-x 5 yun yun  93 Aug  8  2015 src
 8 -rw-rw-r-- 1 yun yun 298 Aug  8  2015 validation.txt
 9 [yun@mini04 python-sonar-runner]$ cat README.md  # 查看使用方法
10 This example demonstrates how to analyze a Python project with the SonarQube Runner.
11 
12 Prerequisites
13 =============
14 * [SonarQube](http://www.sonarsource.org/downloads/) 4.5 or higher
15 * [SonarQube Runner](http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner) 2.4 or higher
16 * [SonarQube Python Plugin](http://docs.sonarqube.org/display/SONAR/Python+Plugin) 1.5 or higher
17 
18 Usage
19 =====
20 * Analyze the projec with SonarQube using the SonarQube Runner:
21 
22         sonar-runner
23 [yun@mini04 python-sonar-runner]$ cat sonar-project.properties  # 查看配置信息
24 # Required metadata
25 sonar.projectKey=org.codehaus.sonar:python-simple-sonar-runner
26 sonar.projectName=Python :: Simple Project : SonarQube Runner
27 sonar.projectVersion=1.0
28 
29 # Comma-separated paths to directories with sources (required)
30 sonar.sources=src
31 
32 # Language
33 sonar.language=py
34 
35 # Encoding of the source files
36 sonar.sourceEncoding=UTF-8

2.2. 质量检测

1 [yun@mini04 python-sonar-runner]$ pwd
2 /app/software/sonar-example-master/projects/languages/python/python-sonar-runner
3 [yun@mini04 python-sonar-runner]$ ll
4 total 12
5 -rw-rw-r-- 1 yun yun 497 Aug  8  2015 README.md
6 -rw-rw-r-- 1 yun yun 341 Aug  8  2015 sonar-project.properties
7 drwxrwxr-x 5 yun yun  93 Aug  8  2015 src
8 -rw-rw-r-- 1 yun yun 298 Aug  8  2015 validation.txt
9 [yun@mini04 python-sonar-runner]$ /app/sonar-scanner/bin/sonar-scanner   # 质量检测

2.3. 浏览器查看

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. sonar-examples下载
  • 2. 案例检测
    • 2.1. 查看配置
      • 2.2. 质量检测
        • 2.3. 浏览器查看
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档