SonarQube 文檔 - daniel-qa/Information-Security GitHub Wiki
- SonarQube 是一套
分析程式碼品質的工具
,支援超過 25 種程式語言,如 C/C++、C#/VB.NET、Java、JavaScript、Python…等。 - 使用 Sonar 開發
SonarQube 操作說明
Gogs & Jenkins & SonarQube
Install SonarQube
- Install SonarQube
- linux 環境,創建一個 sonar 帳戶,把 sonar資料夾群組權限改為 sonar
chown -R sonar:sonar
- Start SonarQube
/bin/sonar.sh start
-
Sonar, by default, creates an Administrator account with username admin and password admin.
Visit the official documentation of the Scanner to download the latest version, and add the bin directory to the %PATH% environment variable
- SonarScanner 設定檔
其實 SonarScanner 也可以進行一些客製化的設定檔,這時候就需要建立一個叫 sonar-project.properties 的檔案,這份檔案裡面可以設定一些 SonarScanner 提供的 analysis parameter,由於這些設定參數實在是太多了,所以筆者不會一一介紹,有興趣的讀者可以參考官網,裡面有所有參數的詳細介紹,整體寫法會像下圖這樣: