Showing 4,841 of 7,782 total issues

Avoid deeply nested control flow statements.
Open

                        for (Object[] evtinf : kidevts)
                            evtmap.add(evtinf);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubsComponent.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

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

          public static ForEach getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end,
                  ExValue step) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.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

          Avoid deeply nested control flow statements.
          Open

                                  if ("div".equals(tn) || "span".equals(tn)) {
                                      l_loop: for (int j = 0, len = sb.length(); j < len; ++j)
                                          switch (sb.charAt(j)) {
                                          case '>':
                                              disableUnavailable = true; //make output cleaner
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlNativeComponent.java - About 45 mins to fix

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

                private boolean containsVariable(Object x, String fdname) {
                    //#feature 2770471 GenericAutowireComposer shall support wiring ZScript varible
                    if (x instanceof Page) {
                        final Page page = (Page) x;
                        return (!_ignoreZScript && page.getZScriptVariable(fdname) != null)
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.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 getInstance has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static ForEach getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end,
                        ExValue step) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (arg2 != arg && arg2 != null)
                                          injectField(arg2, arg2.getClass(), fd);
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 45 mins to fix

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

                    public static final void showNotification(String msg, String type, Component ref, int x, int y, int duration) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Clients.java - About 45 mins to fix

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

                      public static final void showNotification(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/Clients.java - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (srccomp == null) {
                                                    Page page = xcomp.getPage();
                                                    if (page != null)
                                                        srccomp = page.getXelVariable(null, null, srccompid, true);
                                                }
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWires.java - About 45 mins to fix

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

                          public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName,
                                  int sizeThreshold, File repository);
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/DiskFileItemFactory.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

                          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

                            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 show has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

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

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

                                  public void removeListener(final Class<?> klass) {
                                      if (_monitor != null && _monitor.getClass().equals(klass))
                                          _monitor = null;
                                      if (_pfmeter != null && _pfmeter.getClass().equals(klass))
                                          _pfmeter = null;
                              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 loadUtilityHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private static final void loadUtilityHandler() {
                                      if (_handler != null)
                                          return;
                                      synchronized (SelectorComposer.class) {
                                          if (_handler != null)
                              Severity: Minor
                              Found in zk/src/main/java/org/zkoss/zk/ui/select/SelectorComposer.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 (srccomp == null || !(srccomp instanceof Component)) {
                                                              if (log.isDebugEnabled())
                                                                  log.debug(
                                                                          "Cannot find the associated component to forward event: {}",
                                                                          mdname);
                              Severity: Major
                              Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWires.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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language