admin管理员组文章数量:1565830
1.修改异常处理 Either log or rethrow this exception.
private static String cc="error";
logger.error(cc,e);
2. 代码位置不符合规范 Move this variable to comply with Java Code Conventions.
放置到指定位置.
3. 直接返回结果 Immediately return this expression instead of assigning it to the temporary variable "callCount".
return xxx;
4. 添加 @Override Add the "@Override" annotation above this method signature
5. 方法的参数过多 Method has 12 parameters, which is greater than 7 authorized.
6 将值直接付给变量 不再定义后再赋值 Remove this useless assignment to local variable "BySelf".
-----源 :List<TblDdcCpdCampaignHist> campaignHistList = new ArrayList<>(); campaignHistList = ddcDao.getResultList ();
-----改 :List<TblDdcCpdCampaignHist> campaignHistList = ddcDao.getResultList ();
7 字段小写 Rename this local variable name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
8. 使用 Integer.toString() 代替 Use "Integer.toString" instead.
Integer.toString(y);
9. 使用Hibernate的参数绑定而不是级联。 Use Hibernate's parameter binding instead of concatenation.
源: Query query = getSession().createQuery("delete TabNew " +
" where campaignid = '"+campainId+"' AND dealerCustom = 'Y'");
query.executeUpdate();
改:Query query = getSession().createQuery("delete TabNew " +
" where campaignid = ? AND dealerCustom = 'Y'");
query.setLong(0, campainId);
query.executeUpdate();
10. 重新调整修饰符以符合Java语言规范。 Reorder the modifiers to comply with the Java Language Specification.
源: final static
改: static final
版权声明:本文标题:sonarqube检查出的bug修改总结 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1725430075a1022809.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论