![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sonarqube
曾卫
笃信科技引领金融的理念践行者,成为国际领先的个人金融生活服务提供商的推动者,目前上海财经大学研究生在读。
展开
-
项目代码优化(六)
无效对象 场景 JSONObject total = new JSONObject(); 解释 英文 Dodgy - Dead store to local variableThis instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruc原创 2017-04-26 18:10:06 · 2041 阅读 · 0 评论 -
项目代码优化(一)
项目代码优化(一)a.正确使用Integer 场景 Map<String,Object> pp = new HashMap<>(); pp.put("subscriberCode", sn); pp.put("currentTime", UTCTimeUtil.getUTCDateTimeStr()); pp.put("duratio原创 2017-03-15 16:41:20 · 1730 阅读 · 0 评论 -
Linux下sonarqube安装使用方法(代码check工具)
背景 1、 虚拟机CentOS release 7.2 2、 sonarqube-6.2 3、 sonar-scanner-2.8 一、 sonarqube-6.2的安装 1、 sonarqube下载地址https://www.sonarqube.org/downloads/ 这里下载的是sonarqube-6.2,下载完成之后解压下载的zip压缩包。会产生下图所示的...转载 2018-06-04 13:48:06 · 699 阅读 · 0 评论 -
项目代码优化(二)
a.使用副本方式保护代码内部结构 场景 public Date getReleaseTime() { return releaseTime; } public void setReleaseTime(Date releaseTime) { this.releaseTime = (Date)releaseTime.clone(); } 解释原创 2017-03-15 17:43:56 · 729 阅读 · 0 评论 -
项目代码优化(三)
项目代码优化(三) a.关于js中alert()的使用 场景 if(true){ alert("执行成功!"); } 解释 英文 alert(...) can be useful for debugging during development, but in production mode this kind of pop-up could expose sensitive in...原创 2018-06-19 15:49:21 · 616 阅读 · 1 评论 -
项目代码优化(四)
项目代码优化(四) a.StringBuffer和StringBuilder的合理使用 场景 此处省略 解释 英文 Early classes of the Java API, such as Vector, Hashtable and StringBuffer, were synchronized to make them thread-safe. Unfortu...原创 2018-06-19 18:24:22 · 455 阅读 · 0 评论 -
项目代码优化(五)
项目代码优化(五) a.null和undefined的使用 场景 if(parentValues == null || parentValues == undefined) return []; 解释 英文 Conditional statements using a condition which cannot be anything but false have th...原创 2018-08-27 15:23:12 · 489 阅读 · 0 评论