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) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 45 mins to fix

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));
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

    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);
    Severity: Minor
    Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.java - About 45 mins to fix

    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());
                            }
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

      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)

      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 {
      Severity: Minor
      Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java - About 45 mins to fix

        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)
        Severity: Major
        Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java - About 45 mins to fix

          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())
          Severity: Minor
          Found in zweb/src/main/java/org/zkoss/web/servlet/xel/RequestXelResolver.java - About 45 mins to fix

          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 {
          Severity: Minor
          Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 45 mins to fix

            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 {
            Severity: Minor
            Found in zweb/src/main/java/org/zkoss/web/servlet/http/Encodes.java - About 45 mins to fix

            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;
            Severity: Minor
            Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 45 mins to fix

            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);
                                    }
            Severity: Major
            Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 45 mins to fix

              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);
              Severity: Major
              Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (--depth < 0) {
                                            nestedTo = j;
                                            j = l;
                                            break; //done
                                        }
                Severity: Major
                Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 45 mins to fix

                  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 {
                  Severity: Minor
                  Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 45 mins to fix

                    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 {
                    Severity: Minor
                    Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/Interpreter.java - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (j + 2 < to && ctx.content.charAt(j + 2) == '{')
                                                  ++j; //skip '\\'
                      Severity: Major
                      Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if (slashes.isEmpty()) {
                                                    slashes.push(-1);
                                                }
                        Severity: Major
                        Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (j + 2 < to && ctx.content.charAt(j + 2) == '%')
                                                      ++j; //skip '\\'
                          Severity: Major
                          Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 45 mins to fix

                            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) {
                            Severity: Minor
                            Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language