欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

Sonar6.0應(yīng)用之二:SonarWeb界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

一、安裝好了SonarQube服務(wù)端后,在其它電腦的瀏覽器上登陸,開始安裝其它編程語言檢測插件

成都創(chuàng)新互聯(lián)公司長期為數(shù)千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為麻章企業(yè)提供專業(yè)的成都網(wǎng)站設(shè)計、網(wǎng)站建設(shè),麻章網(wǎng)站改版等技術(shù)服務(wù)。擁有十年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

系統(tǒng)已經(jīng)裝好的語言插件:

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

下載了軟件項目中常用的語言:Android、CSS、Web、XML

JAVA相關(guān)的:Checkstyle、Findbugs、PMD

Java 靜態(tài)分析工具分析對象

應(yīng)用技術(shù)

Checkstyle

Java 源文件,缺陷模式匹配

FindBugs

字節(jié)碼,缺陷模式匹配;數(shù)據(jù)流分析

PMD

Java 源代碼,缺陷模式匹配

下載完分析語言規(guī)則后,重啟服務(wù)

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

 

二、安裝命令行分析端

sonar的命令行分析端軟件有兩種分別是Runner和Scanner,官網(wǎng)文檔中寫的是Scanner,但Runner和它安裝、使用都基本一致。

1、在CentOS上安裝sonar-runner-dist-2.4

cd /usr/local/src/

wget http://repo1.maven.org/maven2/org/codehaus/sonar/runner/sonar-runner-dist/2.4/sonar-runner-dist-2.4.zip

unzip sonar-runner-dist-2.4.zip

mv sonar-runner-2.4/ /usr/local/

  • 配置PATH路徑

vim /etc/profile

在文件最后加入如下內(nèi)容,保存并退出。

PATH=$PATH:/usr/local/sonar-runner-2.4/bin  
export PATH

  • 配置sonar-runner啟動配置文件

vim /usr/local/sonar-runner-2.4/conf/sonar-runner.properties

把下面內(nèi)容前#號去掉或增加后,保存并退出

sonar.jdbc.url=jdbc:MySQL://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8

sonar.jdbc.username=sonar   

sonar.jdbc.password=sonar  
sonar.host.url=http://192.168.1.190    
sonar.login=admin  
sonar.password=admin

  • 安裝成功后重啟服務(wù)器,在命令行運行以上命令并回顯,表示運行成功。

[root@sonar local]# sonar-runner -h  
INFO:    
INFO: usage: sonar-runner [options]    
INFO:    
INFO: Options:    
INFO:  -D,--define <arg>     Define property    
INFO:  -e,--errors           Produce execution error messages    
INFO:  -h,--help             Display help information    
INFO:  -v,--version          Display version information    
INFO:  -X,--debug            Produce execution debug output

 

2、在CentOS上安裝sonar-scanner2.8

cd /usr/local/src/
wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.8.zip
unzip sonar-scanner-2.8.zip
mv sonar-scanner-2.8/ /usr/local/
  • 配置PATH路徑

vim /etc/profile

在文件最后加入如下內(nèi)容,保存并退出。

PATH=$PATH:/usr/local/sonar-runner-2.4/bin:/usr/local/sonar-scanner-2.8/bin  
export PATH

  • 配置sonar-scanner啟動配置文件

vim /usr/local/sonar-scanner-2.8/conf/sonar-scanner.properties

把下面內(nèi)容前#號去掉或增加后,保存并退出

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8  
sonar.jdbc.username=sonar  
sonar.jdbc.password=sonar  
sonar.host.url=http://192.168.1.190    
sonar.login=admin  
sonar.password=admin

  • 安裝成功后重啟服務(wù)器,在命令行運行以上命令并回顯,表示運行成功。

[root@sonar local]# sonar-scanner -h  
INFO:    
INFO: usage: sonar-scanner [options]    
INFO:    
INFO: Options:    
INFO:  -D,--define <arg>     Define property    
INFO:  -h,--help             Display help information    
INFO:  -v,--version          Display version information    
INFO:  -X,--debug            Produce execution debug output    
INFO:  -i,--interactive      Run interactively

 

三、把開發(fā)程序的源代碼打包成zip文件上傳到安裝有Runner或Scanner的服務(wù)器上

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

解壓上傳的源代碼:

cd /usr/local/

unzip whale.zip

 

四、使用sonar-scanner進(jìn)行代碼質(zhì)量分析

1、在服務(wù)器上建立一個準(zhǔn)備用Scanner執(zhí)行的配置文件

cd whale/

vim sonar-project.properties

2、建立文件內(nèi)容如下:

# must be unique in a given SonarQube instance  
sonar.projectKey=whale:scanner        
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.    
sonar.projectName=whale-scanner    
sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.  
# Since SonarQube 4.2, this property is optional if sonar.modules is set.    
# If not set, SonarQube starts looking for source code from the directory containing    
# the sonar-project.properties file.    
sonar.sources=.

# Encoding of the source code. Default is default system encoding  
#sonar.sourceEncoding=UTF-8

3、保存并退出后運行命令進(jìn)行分析(分析中不能執(zhí)行Findbugs3.4.3分析,在web端卸載這個規(guī)則后可以正常分析):

sonar-scanner

4、在web中查看Scanner代碼質(zhì)量分析的結(jié)果。

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

 

五、使用sonar-Runner進(jìn)行代碼質(zhì)量分析

1、修改下Scanner執(zhí)行時的配置文件

cd /usr/local/whale/

vim sonar-project.properties

2、修改文件內(nèi)容如下:

# must be unique in a given SonarQube instance  
sonar.projectKey=whale:runner    
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.    
sonar.projectName=whale-runner    
sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.  
# Since SonarQube 4.2, this property is optional if sonar.modules is set.    
# If not set, SonarQube starts looking for source code from the directory containing    
# the sonar-project.properties file.    
sonar.sources=.

# Encoding of the source code. Default is default system encoding  
#sonar.sourceEncoding=UTF-8

3、保存并退出后運行命令進(jìn)行分析(分析中不能執(zhí)行Findbugs3.4.3分析,在web端卸載這個規(guī)則后可以正常分析):

sonar-runner

4、在web中查看runner代碼質(zhì)量分析的結(jié)果。

Sonar6.0應(yīng)用之二:Sonar Web界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析

 

結(jié)果一樣,證明Runner和Scanner功能差不多。

當(dāng)前標(biāo)題:Sonar6.0應(yīng)用之二:SonarWeb界面配置及與Runner、Scanner集成進(jìn)行命令行代碼分析
當(dāng)前鏈接:http://aaarwkj.com/article20/ihhpco.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站、小程序開發(fā)網(wǎng)站營銷、網(wǎng)站維護(hù)、網(wǎng)站制作、微信公眾號

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)頁設(shè)計公司
国产大学生情侣在线视频| 欧美久久精品在线观看| 亚洲欧美一区二区粉嫩| 91免费人成网站在线观看| 中文字幕日韩欧美一区| av第一福利大全导航| 欧美日韩国产综合下一页| 国产精品久久久av大片| 天天操天天夜夜操夜夜| 密臀精品国产一区二区| 国产黄色大片在线关看| 18岁以下禁看视频网站| 高h视频在线播放观看| 亚洲日本精品国产第一区| 国产一区二区伦理视频| 2004年亚洲中文字幕| 亚洲一区二区三区视频在线观看| 国产黄色看三级91大片| av中文字幕亚洲一区二区| 乱码日本欧美一区二区| 十八岁毛片一区二区三区| 亚洲国产精品视频中文字幕| 亚洲家庭伦理在线观看| 亚洲毛片高清一区二区三区| 日韩精品在线观看电影| 日韩欧美啪啪一区二区| 黄色三级欧美一区二区| 亚洲av优选在线观看精品| 久久精品国产亚洲av无| 福利在线午夜绝顶三级| 丁香婷婷激情五月天综合| 国产亚洲国产av网站在线| 欧美一区二区久久综合| 女性裸体无遮挡啪啪网站| 韩国三级网站在线观看视频| 国产精品毛片一区内射| 国产一区二区三区91精品| 98精品熟女亚洲av| 亚洲国产自拍偷拍视频| 日本精品在线一区二区| 国产一区二区欧美精品|