Showing 7,775 of 7,775 total issues
Method remove
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean remove(Object o) {
//bug #1819318 Problem while using SortedSet with Databinding
if (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
int index = indexOfAndRemove(o);
if (index < 0) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (realIndex >= 0 && realIndex < getItemCount())
removeChild(getChildren().get(realIndex));
Method modifyPath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public String modifyPath(String path) throws UnsupportedEncodingException {
if (path.startsWith(ZVER)) {
final int j = path.indexOf('/', ZVER.length());
if (j >= 0)
path = path.substring(j);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (m.getPageSize() > 0) { //min page size is 1
pgi.setPageSize(m.getPageSize());
} else {
m.setPageSize(pgi.getPageSize());
}
Method resolveVariable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public Object resolveVariable(String name) throws XelException {
final RequestContext jc = RequestContexts.getCurrent();
if (jc != null) {
final VariableResolver parent = jc.getVariableResolver();
if (parent != null)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sendRedirect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static final void sendRedirect(ServletContext ctx, HttpServletRequest request, HttpServletResponse response,
String uri, Map params, int mode) throws IOException, ServletException {
Avoid deeply nested control flow statements. Open
if (j >= 0) {
String s = range.substring(j + 1).trim();
if (s.length() > 0) {
int to = Integer.parseInt(s);
if (to >= from)
Method getValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected Object getValue(String key) {
Object o = _values.get(key);
if (o == null) {
final Enumeration e = hreq.getHeaders(key);
if (e == null || !e.hasMoreElements())
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method include
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static final void include(ServletContext ctx, ServletRequest request, ServletResponse response, String uri,
Map params, int mode) throws IOException, ServletException {
Method urlEncoder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static URLEncoder urlEncoder() {
if (_urlenc == null) {
final String cls = Library.getProperty("org.zkoss.web.servlet.http.URLEncoder");
if (cls != null && cls.length() > 0) {
try {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getExtension
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static final String getExtension(String path, boolean lastOnly) {
if (lastOnly)
return getExtension(path);
if (path == null)
return null;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (preslash == 0) { //special case "/../"
throw new IllegalArgumentException("Illegal path: " + path);
}
Avoid deeply nested control flow statements. Open
if (j >= 0) {
int k = ua.indexOf('.', j += 8);
if (k >= 0) {
for (int len = ua.length(); ++k < len;) {
final char cc = ua.charAt(k);
Avoid deeply nested control flow statements. Open
if (--depth < 0) {
nestedTo = j;
j = l;
break; //done
}
Method forward
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static final void forward(ServletContext ctx, ServletRequest request, ServletResponse response, String uri,
Map params, int mode) throws IOException, ServletException {
Method interpret
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public final void interpret(ServletContext ctx, HttpServletRequest request, HttpServletResponse response,
String content, String ctype, Locator locator) throws DspException, IOException, XelException {
Avoid deeply nested control flow statements. Open
if (j + 2 < to && ctx.content.charAt(j + 2) == '{')
++j; //skip '\\'
Avoid deeply nested control flow statements. Open
if (slashes.isEmpty()) {
slashes.push(-1);
}
Avoid deeply nested control flow statements. Open
if (j + 2 < to && ctx.content.charAt(j + 2) == '%')
++j; //skip '\\'
Method encodeRedirectURL
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static final String encodeRedirectURL(ServletContext ctx, HttpServletRequest request,
HttpServletResponse response, String uri, Map params, int mode) {