持續代碼品質管理-SonarQube-7.3簡單使用

來源:互聯網
上載者:User

標籤:nal   圖片   資訊   lan   ges   code   技術   代碼品質   director   

 

       安裝了SonarQube以及Sonar Scanner之後,就需要那代碼檢測了。當然為了方便我們使用已有現成的demo,知道到對應的git地址下載即可。

 

 

1. sonar-examples下載
1 https://github.com/saurabhjuneja/sonar-example    

 

 

2. 案例檢測2.1. 查看配置
 1 [[email protected] python-sonar-runner]$ pwd 2 /app/software/sonar-example-master/projects/languages/python/python-sonar-runner 3 [[email protected] 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 [[email protected] python-sonar-runner]$ cat README.md  # 查看使用方法10 This example demonstrates how to analyze a Python project with the SonarQube Runner.11 12 Prerequisites13 =============14 * [SonarQube](http://www.sonarsource.org/downloads/) 4.5 or higher15 * [SonarQube Runner](http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner) 2.4 or higher16 * [SonarQube Python Plugin](http://docs.sonarqube.org/display/SONAR/Python+Plugin) 1.5 or higher17 18 Usage19 =====20 * Analyze the projec with SonarQube using the SonarQube Runner:21 22         sonar-runner23 [[email protected] python-sonar-runner]$ cat sonar-project.properties  # 查看配置資訊24 # Required metadata25 sonar.projectKey=org.codehaus.sonar:python-simple-sonar-runner26 sonar.projectName=Python :: Simple Project : SonarQube Runner27 sonar.projectVersion=1.028 29 # Comma-separated paths to directories with sources (required)30 sonar.sources=src31 32 # Language33 sonar.language=py34 35 # Encoding of the source files36 sonar.sourceEncoding=UTF-8

 

2.2. 品質檢測
1 [[email protected] python-sonar-runner]$ pwd2 /app/software/sonar-example-master/projects/languages/python/python-sonar-runner3 [[email protected] python-sonar-runner]$ ll4 total 125 -rw-rw-r-- 1 yun yun 497 Aug  8  2015 README.md6 -rw-rw-r-- 1 yun yun 341 Aug  8  2015 sonar-project.properties7 drwxrwxr-x 5 yun yun  93 Aug  8  2015 src8 -rw-rw-r-- 1 yun yun 298 Aug  8  2015 validation.txt9 [[email protected] python-sonar-runner]$ /app/sonar-scanner/bin/sonar-scanner   # 品質檢測

 

2.3. 瀏覽器查看

 

持續代碼品質管理-SonarQube-7.3簡單使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.