Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                        if (html >= 0)
                            junav = sb.lastIndexOf("</html");
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlNativeComponent.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (containsVariable(x, fdname)) {
                                final Object arg = getVariable(x, fdname);
                                if (!injectByMethod(md, parmcls[0], arg == null ? null : arg.getClass(), arg, fdname)) {
                                    final Object arg2 = getFellow(x, fdname);
                                    if (arg2 != arg && arg2 != null)
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (v.length() != 0 && ((cc = v.charAt(v.length() - 1)) == ';' || cc == ','
                                      || (v.indexOf("function") < 0 && v.indexOf(';') >= 0)))
                                  throw new UiException("Illegal client override: " + v
                                          + (name.startsWith("on")
                                                  ? "\nTo listen an event, remember to captalize the third letter, such as onClick"
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 45 mins to fix

        Method show has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static void show(String msg, String type, Component ref, String position, int duration, boolean closable) {
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/util/Notification.java - About 45 mins to fix

          Method enableEventThread has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public void enableEventThread(boolean enable) {
                  if (!enable && _wapp != null) {
                      final UiEngine engine = ((WebAppCtrl) _wapp).getUiEngine();
                      if (engine != null) {
                          if (engine.hasSuspendedThread())
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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 matchClasses has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              /*package*/ static boolean matchClasses(Component component, Set<String> classes) {
                  if (classes == null || classes.isEmpty())
                      return true;
          
                  if (!(component instanceof HtmlBasedComponent))

          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 (!isDescendant(rt2, rt))
                                      return null;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (rt2 instanceof ShadowElement) {
                                        if (((ShadowElement) rt2).getShadowHost() != rt)
                                            return null;
                                    } else if (rt2.getParent() != rt) {
                                        return null;
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              for (EventListener<? extends Event> listener : listeners)
                                                  if (listener instanceof ComposerEventListener)
                                                      c.removeEventListener(name, listener);
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/select/Selectors.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (!isGeneralSibling(rt2, rt))
                                            return null;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (parentCtrl.getShadowRoots().contains(comp)) {
                                              return true;
                                          }

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (tmp != null) {
                                                        if (template == null) {
                                                            // Bug ZK-2855: only assign first match, all following matches will be discarded
                                                            template = tmp;
                                                        }
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/Templates.java - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (t != null)
                                                  return t;
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/Templates.java - About 45 mins to fix

                        Method encodeURL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public String encodeURL(String uri) {
                                if (uri == null || uri.isEmpty()) // ZK-5598
                                    return uri;
                                try {
                                    String encodedURL = Encodes.encodeURL(_ctx, _request, _response, uri);
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/http/ExecutionImpl.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 outErrReloads has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void outErrReloads(RequestContext reqctx, Configuration config, StringBuffer sb, Object[][] infs) {
                                for (int j = 0; j < infs.length; ++j) {
                                    if (j > 0)
                                        sb.append(',');
                                    sb.append('\'').append(infs[j][0]).append("':'");
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.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 handleError has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            private void handleError(Session sess, RenderRequest request, RenderResponse response, String path, Throwable err,
                                    String msg) throws PortletException, IOException {
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.java - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  for (int k = j += 7; k < len; ++k) {
                                                      if (sb.charAt(k) == '>') {
                                                          if (shallFilter(sb.substring(j, k)))
                                                              return sb.substring(k + 1);
                                                          break;
                          Severity: Major
                          Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutFilter.java - About 45 mins to fix

                            Method getValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private static Object getValue(Component component, String name) {
                                    try {
                                        return component.getClass().getMethod("get" + capitalize(name)).invoke(component);
                                    } catch (NoSuchMethodException e) {
                                        // no such method

                            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 getObjectByName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    private Object getObjectByName(PsdoCompFunctor functor, String name, Class<?> type,
                                            List<VariableResolver> resolvers) {
                            
                                        Object result = functor.getXelVariable(name);
                                        if (isValidValue(result, type))
                            Severity: Minor
                            Found in zk/src/main/java/org/zkoss/zk/ui/select/Selectors.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 (t != null)
                                                        return t;
                            Severity: Major
                            Found in zk/src/main/java/org/zkoss/zk/ui/Templates.java - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language