Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                            if (val == null)
                                continue; //don't use it in clone
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

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

        public String setWidgetOverride(String name, String script) {
            if (name == null)
                throw new IllegalArgumentException();
    
            final String old;
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 setMold has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public void setMold(String mold) {
            if (mold != null && (DEFAULT.equals(mold) || mold.length() == 0))
                mold = null;
            if (!Objects.equals(_auxinf != null ? _auxinf.mold : DEFAULT, mold)) {
                if (!_def.hasMold(mold != null ? mold : DEFAULT))
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 (!keyWritten) {
                                keyWritten = true;
                                s.writeObject(me.getKey());
                            }
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/EventListenerInfo.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (shadowHost.getParent() != null) {
                                      return ((AbstractComponent) shadowHost.getParent()).getShadowVariable0(shadowHost, name,
                                              recurse);
                                  }
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (tis.isEmpty()) { //no more event
                                    _auxinf.forwards.remove(orgEvent);
                                    removeEventListener(orgEvent, info.listener);
                                }
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (ls.size() == 1)
                                      _listeners.remove(evtnm);
                                  else
                                      it.remove();
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (add)
                                        exec.addResponseHeader(nm, (Date) val);
                                    else
                                        exec.setResponseHeader(nm, (Date) val);
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 45 mins to fix

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

                  public boolean doCatch(Throwable ex) throws Exception {
                      for (int j = 0; j < _cs.length; ++j)
                          if (_cs[j] instanceof ComposerExt && shallInvoke(_cs[j]))
                              if (((ComposerExt) _cs[j]).doCatch(ex))
                                  return true; //caught (eat it)
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/MultiComposer.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 compareTo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      public int compareTo(Object o) {
                          final TimedValue tv = (TimedValue) o;
                          return _priority == tv._priority ? _timed > tv._timed ? 1 : _timed == tv._timed ? 0 : -1
                                  : _priority > tv._priority ? -1 : 1; //higher priority, earlier (smaller)
                      }
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 (ck != null && ck.getParent() == parent) {
                                          newsibs.add(ck);
                                          attached[k] = null;
                                      }
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 45 mins to fix

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

                    public void addRequests(Collection<AuRequest> requests) {
                        for (AuRequest request : requests) {
                            try {
                                request.activate();
                                if (!isObsolete(request))
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/RequestQueueImpl.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 newComposer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static Composer newComposer(Page page, Object o) throws Exception {
                        Class cls;
                        if (o instanceof String) {
                            final String clsnm = ((String) o).trim();
                            if (page != null)
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/Utils.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 (Events.isListened(root, Events.ON_PIGGYBACK, false)) { //asap+deferrable
                                            Events.postEvent(new Event(Events.ON_PIGGYBACK, root));
                                            Executions.getCurrent().setAttribute(ATTR_PIGGYBACK_POSTED, Boolean.TRUE);
                                        }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 45 mins to fix

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

                      private static void desktopDestroyed(Desktop desktop) {
                          final Session sess = desktop.getSession();
                          final Execution exec = new ExecutionImpl(desktop.getWebApp().getServletContext(), null, null, desktop, null);
                          final DesktopCtrl desktopCtrl = (DesktopCtrl) desktop;
                          final Execution oldExec = desktop.getExecution();
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/SimpleDesktopCache.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 enableServerPush has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public boolean enableServerPush(ServerPush serverpush) {
                          final boolean serverPushAlreadyExists = _spush != null, enable = serverpush != null;
                          if (serverPushAlreadyExists != enable || serverpush != _spush) {
                              if (serverPushAlreadyExists)
                                  enableServerPush(false, null);
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 doBeforeCompose has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public ComponentInfo doBeforeCompose(Page page, Component parent, ComponentInfo compInfo) throws Exception {
                          for (int j = 0; j < _cs.length; ++j)
                              if (_cs[j] instanceof ComposerExt && shallInvoke(_cs[j])) {
                                  compInfo = ((ComposerExt) _cs[j]).doBeforeCompose(page, parent, compInfo);
                                  if (compInfo == null)
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/MultiComposer.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 createComponentsDirectly0 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private Component createComponentsDirectly0(Reader reader, String ext, Component parent, Component insertBefore,
                              VariableResolver resolver, Map<?, ?> arg) throws IOException {
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractExecution.java - About 45 mins to fix

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

                        public boolean ceaseSuspendedThread(Desktop desktop, EventProcessingThread evtthd, String cause) {
                            final Map<Object, List<EventProcessingThreadImpl>> map;
                            synchronized (_suspended) {
                                map = _suspended.get(desktop);
                            }
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 createComponentsDirectly0 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        private Component createComponentsDirectly0(String content, String ext, Component parent, Component insertBefore,
                                VariableResolver resolver, Map<?, ?> arg) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractExecution.java - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language