美文网首页
再试sonarqube

再试sonarqube

作者: 十一岁的加重 | 来源:发表于2018-05-27 17:57 被阅读24次

很早之前研究过sonarqube,很多坑,尝试了很多次,一直没有成功,最近又想尝试了,很多事,只要一直惦记,一直努力,总有一天会顿悟。
下载最近版本


image.png

启动


image.png

打开网页


image.png

登录


image.png

不知道什么token


image.png image.png image.png image.png image.png
sonar-scanner \
  -Dsonar.projectKey=what \
  -Dsonar.sources=. \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.login=faf84da0d53d2e0a760004b943f1cf73499e6fde
image.png

开始配置下载的


image.png

将下载的文件展开到您选择的目录中。 我们将在下面的步骤中将它称为<install_directory>。
通过编辑<install_directory> /conf/sonar-scanner.properties更新全局设置以指向SonarQube服务器:

#----- Default SonarQube server
#sonar.host.url=[http://localhost:9000]

https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner


# must be unique in a given SonarQube instance
sonar.projectKey=my:project
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=My project
sonar.projectVersion=1.0
 
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set. 
sonar.sources=.
 
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8

加入我们的环境变量


image.png
image.png

怎么难你的环境变量加成功了
查看一下环境变量有没有你的加
查看环境变量

echo $PATH

终端运行一下你的命令


image.png

然后呢
配置下记得有个中文界面的

image.png
image.png
半天安装不了,直接去github下载的,然后放进了插件文件 夹
https://github.com/SonarQubeCommunity/sonar-l10n-zh/releases
image.png
image.png
重启
./sonar.sh restart

终于中文了


image.png

随便搞个名字再把上面的代码放在脚本里

image.png
然后就…………居然成功了,以前没有这么简单啊,我开始有点接受不了了,不行,明天得去公司重新这样操作下
image.png
问题1、objc的插件来自这里
https://github.com/iamlile/sonar_objectivec_swift image.png

问题2、居然检查了pod里的代码


image.png

参考文章1:
https://testerhome.com/topics/13158
其脚本一直走不通,已回帖,期待解决
参考文章2:
https://yq.aliyun.com/articles/541761?spm=a2c41.11181499.0.0
自定义规则实践中

image.png
cd oclint-scripts
./make

然后

oclint-scripts/scaffoldRule JustTest -t ASTVisitor
image.png

修改自定义规则后,校验

./build/oclint-release/bin/oclint -report-type pmd -o test.xml 测试代码目录/测试文件.m

相关文章

网友评论

      本文标题:再试sonarqube

      本文链接:https://www.haomeiwen.com/subject/qyxijftx.html