java-idea-sonar

26 篇文章 0 订阅

sonar

代码质量管理

服务器sonar

有专业的管理页面,对git上的代码进行扫描,实现对项目的整体分析,sonar的问题标注点比较清晰

idea的sonar

以前安装过发现要使用到服务器地址,现在安装发现不需要服务器的sonar支持,可能是升级了吧,安装过程容易失败,网上也有对应的解决方案

sonar代码检查

方法复杂度问题

这个很有学习价值,看下面的官方解释
https://www.sonarsource.com/docs/CognitiveComplexity.pdf

比较的要求

Comparisons of dissimilar types will always return false. The comparison and all its dependent code can simply be removed. This includes:

  • comparing an object with null
  • comparing an object with an unrelated primitive (E.G. a string with an int)
  • comparing unrelated classes
  • comparing an unrelated class and interface
  • comparing unrelated interface types
  • comparing an array to a non-array
  • comparing two arrays

数组比较工具
Arrays.equals(array1, array2)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值