Showing 59 of 59 total issues
Method isBlank
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static boolean isBlank(CharSequence cs) { int strLen = length(cs); if (strLen == 0) { return true; } else {
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static <T> Map<String, T> gsonToMaps(String gsonString) { Map<String, T> map = null; if (gson != null) { map = gson.fromJson(gsonString, new TypeToken<Map<String, T>>() { }.getType());
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static <T> List<Map<String, T>> gsonToListMaps(String gsonString) { List<Map<String, T>> list = null; if (gson != null) { list = gson.fromJson(gsonString, new TypeToken<List<Map<String, T>>>() { }.getType());
- Read upRead up
Avoid too many return
statements within this method. Open
return (cal.getTime().getTime());
Avoid too many return
statements within this method. Open
return new Date();
Identical blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader(HTTP_X_FORWARDED_FOR); }
- Read upRead up
Avoid too many return
statements within this method. Open
return parseDate(source, FOR_MARTS.get(0));
Identical blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader(PROXY_CLIENT_IP); }
- Read upRead up
Similar blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_CLIENT_IP"); }
- Read upRead up
Avoid too many return
statements within this method. Confirmed
return defaultSupplier.get();
Identical blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader(HTTP_CLIENT_IP); }
- Read upRead up
Similar blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); }
- Read upRead up
Avoid too many return
statements within this method. Open
return (cal.getTime().getTime());
Identical blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader(WL_PROXY_CLIENT_IP); }
- Read upRead up
Similar blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); }
- Read upRead up
Similar blocks of code found in 4 locations. Consider refactoring. Open
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); }
- Read upRead up
Avoid too many return
statements within this method. Confirmed
return mapper.writeValueAsString(obj);
Method stop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static void stop(SRunnable sr) { if (sr.getName() == null) { throw new UnsupportedOperationException("停止线程时,线程名不能为空!"); } if (pool == null || pool.isShutdown()) return;//服务未启动
- Read upRead up
Method convert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override public Date convert(String source) { String value = source.trim(); if (StringUtils.EMPTY.equals(value)) { return new Date();
- Read upRead up