sonar搭建

/ 测试开发 / 0 条评论 / 330浏览
sonar:
su - sonarqube
postgres sjb123456    postgres-11
进入postgres命令行
su - postgres
psql

sonar
http://192.168.7.110:9000
https://github.com/mc1arke/sonarqube-community-branch-plugin  
扫描时,增加-Dsonar.branch.name=${GIT_BRANCH}
https://github.com/caowenliang/sonar-pmd-p3c
pmd:基于源代码分析,主要面向安全编码规则  - 阿里有个p3c-pmd
checkstyle:基于源代码,与pmd类似,但更侧重编码的语法风格
findbugs:基于字节码分析,大量使用数据流分析技术,侧重运行时错误检测(runtime)
sonar order:
1. 空指针
2. 装包/解包https://www.jianshu.com/p/d14dc6943d9e
3. 闭包Integer ==判断不安全 https://blog.csdn.net/lixin2151408/article/details/78611593
4. 不可访问的代码
5. equals类型不等 Call to Integer.equals(String)
6. 方法标签和内部实现不一致