sonarqube问题修改总结
四、异常处理
1、定义一个专门的异常用于异常处理
说明:Using such generic excepti0ns as Error, RuntimeException,Throwable, andException prevents calling methods from handling true, system-generated excepti0ns differently than application-generated errors.
错误示例:
修改建议:定义一个自己的异常类继承Exception用于包装RuntimeException。
2、单个方法不要跑出多个未处理的异常
SonarQube使用流程
使用流程图
1、开发负责人获取蕞新代码到本地;
2、开发负责人执行sonar-runner开始代码分析工作;
3、开发负责人将分析出来的issue指派给开发人员;
4、开发人员修复issue;
5、开发负责人重新获取蕞新源码,重新执行sonar-runner,检查issue的修复情况。
Sonarqube 检测代码
1配置sonar-scanner
[root@localhost conf]# cd /usr/local/sonarqube/softs/sonar-scanner-3.1.0.1141-linux/conf
2配置环境变量
[root@localhost sonar-scanner-3.1.0.1141-linux]# vim /etc/profile
3校验
[root@localhost sonar-scanner-3.1.0.1141-linux]# sonar-scanner -v
以上信息由专业从事代理商sonarqube教程的华克斯于2024/5/20 7:08:51发布
转载请注明来源:http://m.herostart.com/qynews/hksxxkj-2755573314.html