码迷,mamicode.com
首页 > 其他好文 > 详细

持续代码质量管理-SonarQube-7.3简单使用

时间:2018-10-14 21:01:12      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:nal   图片   信息   lan   ges   code   技术   代码质量   director   

 

       安装了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. 浏览器查看

技术分享图片

 

持续代码质量管理-SonarQube-7.3简单使用

标签:nal   图片   信息   lan   ges   code   技术   代码质量   director   

原文地址:https://www.cnblogs.com/zhanglianghhh/p/9787489.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!