Showing 4,841 of 7,782 total issues

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

    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

      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

        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 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 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

          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 (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 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

                  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

                    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

                    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

                      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

                                  for (j = i + 1; j < n; ++j) q[j].i--;
                        Severity: Major
                        Found in zktest/src/main/webapp/js/d3.js - About 45 mins to fix

                          Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 45 mins to fix

                            Function on has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            function on( elem, types, selector, data, fn, one ) {
                            Severity: Minor
                            Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 45 mins to fix

                              Function _one_mult has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  _one_mult: function(a, b, c, d, e, g) {
                              Severity: Minor
                              Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
                                            if (d3_layout_packIntersects(k, c)) {
                                              if (s2 < s1) {
                                                isect = -1;
                                                j = k;
                                Severity: Major
                                Found in zktest/src/main/webapp/js/d3.layout.js - About 45 mins to fix

                                  Function d has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                              d = function(a, b, d, e, l, m) {
                                  Severity: Minor
                                  Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language