zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java

Summary

Maintainability
F
2 wks
Test Coverage

File DesktopImpl.java has 1453 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* DesktopImpl.java

    Purpose:
        
    Description:
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 3 days to fix

    DesktopImpl has 137 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class DesktopImpl implements Desktop, DesktopCtrl, java.io.Serializable {
        private static final Logger log = LoggerFactory.getLogger(DesktopImpl.class);
        private static final long serialVersionUID = 20101123L;
    
        /** Represents media stored with {@link #getDownloadMediaURI}.
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 2 days to fix

      Method afterProcessEvent has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          public void afterProcessEvent(Event event) throws Exception {
              _eis.afterProcessEvent(event);
              _wapp.getConfiguration().afterProcessEvent(event);
      
              if (Events.ON_DESKTOP_RECYCLE.equals(event.getName())) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 4 hrs 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 enableServerPush0 has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          private boolean enableServerPush0(ServerPush sp, boolean enable) {
              if (_sess == null)
                  throw new IllegalStateException("Server push cannot be enabled in a working thread");
      
              final boolean serverPushAlreadyExists = _spush != null;
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 4 hrs 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 service has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          public void service(AuRequest request, boolean everError) {
              if (_ausvcs != null) {
                  //Note: removeListener might be called when invoking svc.service()
                  for (Iterator<AuService> it = new LinkedList<AuService>(_ausvcs).iterator(); it.hasNext();)
                      if (it.next().service(request, everError))
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 3 hrs 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 onPiggyback has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          public void onPiggyback() {
              //Note: we don't post ON_PIGGYBACK twice in an execution
              //(performance concern and back-compatibility).
              if (_piggybackListened && Executions.getCurrent().getAttribute(ATTR_PIGGYBACK_POSTED) == null) {
                  for (Page page : _pages) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 2 hrs 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 removeAttribute has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public Object removeAttribute(String name, boolean recurse) {
              if (recurse && !hasAttribute(name)) {
                  if (_sess != null) {
                      if (_sess.hasAttribute(name, true))
                          return _sess.removeAttribute(name, true);
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
      Open

          private boolean enableServerPush(ServerPush serverPush, boolean enable, Serializable enabler) {
              synchronized (enablers) {
                  boolean enablersEmptyBefore = enablers.isEmpty();
                  if (enable) {
                      //handle dummy target
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 setAttribute has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public Object setAttribute(String name, Object value, boolean recurse) {
              if (recurse && !hasAttribute(name)) {
                  if (_sess != null) {
                      if (_sess.hasAttribute(name, true))
                          return _sess.setAttribute(name, value, true);
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 service has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void service(AuRequest request, boolean everError) {
              if (_ausvcs != null) {
                  //Note: removeListener might be called when invoking svc.service()
                  for (Iterator<AuService> it = new LinkedList<AuService>(_ausvcs).iterator(); it.hasNext();)
                      if (it.next().service(request, everError))
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr to fix

        Method enableServerPush0 has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private boolean enableServerPush0(ServerPush sp, boolean enable) {
                if (_sess == null)
                    throw new IllegalStateException("Server push cannot be enabled in a working thread");
        
                final boolean serverPushAlreadyExists = _spush != null;
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr to fix

          Method destroy has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void destroy() {
                  final ExecutionMonitor execmon = _wapp != null //just in case
                          ? _wapp.getConfiguration().getExecutionMonitor() : null;
          
                  _rque = null; //denote it is destroyed
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr to fix

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

                public boolean removeListener(Object listener) {
                    boolean found = false;
                    if (listener instanceof EventInterceptor && _eis.removeEventInterceptor((EventInterceptor) listener))
                        found = true;
            
            
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 destroy has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public void destroy() {
                    final ExecutionMonitor execmon = _wapp != null //just in case
                            ? _wapp.getConfiguration().getExecutionMonitor() : null;
            
                    _rque = null; //denote it is destroyed
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 readObject has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
                    s.defaultReadObject();
            
                    init();
            
            
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr to fix

              Method setDeviceType has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void setDeviceType(String deviceType) {
                      //Note: we check _comps.isEmpty() only if device type differs, because
                      //a desktop might have several richlet and each of them will call
                      //this method once
                      if (!_devType.equals(deviceType)) {
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 getMaxSchedTime has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  private static long getMaxSchedTime() {
                      if (_maxSchedTime == null) {
                          //no need to be synchronized
                          final String PROP = "org.zkoss.zk.ui.maxScheduleTime";
                          final String val = Library.getProperty(PROP);
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 onEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                      public void onEvent(Event event) throws Exception {
                          final long max = System.currentTimeMillis() + getMaxSchedTime();
                          if (log.isDebugEnabled()) {
                              log.debug("Handling schedule server push, _schedInfos is empty: [{}]", !scheduledServerPush());
                          }
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 invokeExecutionCleanups has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void invokeExecutionCleanups(Execution exec, Execution parent, List<Throwable> errs) {
                      if (_execCleans != null) {
                          for (Iterator<ExecutionCleanup> it = new LinkedList<ExecutionCleanup>(_execCleans).iterator(); it
                                  .hasNext();) {
                              final ExecutionCleanup listener = it.next();
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 readObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
                      s.defaultReadObject();
              
                      init();
              
              
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr 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 addListener has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public void addListener(Object listener) {
                      boolean added = false;
                      if (listener instanceof EventInterceptor) {
                          _eis.addEventInterceptor((EventInterceptor) listener);
                          added = true;
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr to fix

                Method onEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public void onEvent(Event event) throws Exception {
                            final long max = System.currentTimeMillis() + getMaxSchedTime();
                            if (log.isDebugEnabled()) {
                                log.debug("Handling schedule server push, _schedInfos is empty: [{}]", !scheduledServerPush());
                            }
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 1 hr to fix

                  Method hasAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public boolean hasAttribute(String name, boolean recurse) {
                          if (hasAttribute(name))
                              return true;
                          if (recurse) {
                              if (_sess != null)
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 55 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

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

                        public String getNextUuid(Component comp) {
                            final IdGenerator idgen = ((WebAppCtrl) _wapp).getIdGenerator();
                            String uuid = null;
                            if (idgen != null) {
                                try {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 getDownloadMediaURI has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public String getDownloadMediaURI(Media media, String pathInfo) {
                            if (media == null)
                                throw new IllegalArgumentException("null media");
                    
                            if (_meds == null) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 addListener has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void addListener(Object listener) {
                            boolean added = false;
                            if (listener instanceof EventInterceptor) {
                                _eis.addEventInterceptor((EventInterceptor) listener);
                                added = true;
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 afterComponentDetached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void afterComponentDetached(Component comp, Page prevpage) {
                            if (_uiCycles != null) {
                                for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                    final UiLifeCycle listener = it.next();
                                    try {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 removeListener0 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private boolean removeListener0(List list, Object listener) {
                            //Since 3.0.6: To be consistent with Configuration,
                            //use equals instead of ==
                            if (list != null && listener != null)
                                for (Iterator it = list.iterator(); it.hasNext();) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 afterComponentMoved has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void afterComponentMoved(Component parent, Component child, Component prevparent) {
                            if (_uiCycles != null) {
                                for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                    final UiLifeCycle listener = it.next();
                                    try {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 afterPageAttached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private void afterPageAttached(Page page, Desktop desktop) {
                            if (_uiCycles != null) {
                                for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                    final UiLifeCycle listener = it.next();
                                    try {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 afterComponentAttached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void afterComponentAttached(Component comp, Page page) {
                            if (_uiCycles != null) {
                                for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                    final UiLifeCycle listener = it.next();
                                    try {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 afterPageDetached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private void afterPageDetached(Page page, Desktop prevdesktop) {
                            if (_uiCycles != null) {
                                for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                    final UiLifeCycle listener = it.next();
                                    try {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 getAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public Object getAttribute(String name, boolean recurse) {
                            Object val = getAttribute(name);
                            if (val != null || !recurse || hasAttribute(name))
                                return val;
                            if (_sess != null)
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 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 too many return statements within this method.
                    Open

                            return false;
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 30 mins to fix

                      Method invokeExecutionInits has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void invokeExecutionInits(Execution exec, Execution parent) throws UiException {
                              if (_execInits != null) {
                                  for (Iterator<ExecutionInit> it = new LinkedList<ExecutionInit>(_execInits).iterator(); it.hasNext();) {
                                      try {
                                          it.next().init(exec, parent);
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 25 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 invokeDesktopCleanups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void invokeDesktopCleanups() {
                              if (_dtCleans != null) {
                                  for (Iterator<DesktopCleanup> it = new LinkedList<DesktopCleanup>(_dtCleans).iterator(); it.hasNext();) {
                                      final DesktopCleanup listener = it.next();
                                      try {
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 25 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 setId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void setId(String id) {
                              if (!((ExecutionCtrl) _exec).isRecovering())
                                  throw new IllegalStateException("Callable only in recovering");
                              if (id == null || id.length() <= 1)
                                  throw new IllegalArgumentException(
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 25 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

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public Object setAttribute(String name, Object value, boolean recurse) {
                              if (recurse && !hasAttribute(name)) {
                                  if (_sess != null) {
                                      if (_sess.hasAttribute(name, true))
                                          return _sess.setAttribute(name, value, true);
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 990..1001

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 92.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public Object removeAttribute(String name, boolean recurse) {
                              if (recurse && !hasAttribute(name)) {
                                  if (_sess != null) {
                                      if (_sess.hasAttribute(name, true))
                                          return _sess.removeAttribute(name, true);
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 1014..1026

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 89.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public String getResourceURI(String pathInfo) {
                              final String uri;
                              if (pathInfo == null || pathInfo.length() == 0) {
                                  uri = _resourceURI;
                              } else {
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 480..490

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 84.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public String getUpdateURI(String pathInfo) {
                              final String uri;
                              if (pathInfo == null || pathInfo.length() == 0) {
                                  uri = _updateURI;
                              } else {
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 492..502

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 84.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public Object getAttribute(String name, boolean recurse) {
                              Object val = getAttribute(name);
                              if (val != null || !recurse || hasAttribute(name))
                                  return val;
                              if (_sess != null)
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 931..941

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 79.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                          private void afterPageAttached(Page page, Desktop desktop) {
                              if (_uiCycles != null) {
                                  for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                      final UiLifeCycle listener = it.next();
                                      try {
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 3 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1443..1454
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1456..1467
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1495..1506

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 75.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                          private void afterPageDetached(Page page, Desktop prevdesktop) {
                              if (_uiCycles != null) {
                                  for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                      final UiLifeCycle listener = it.next();
                                      try {
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 3 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1443..1454
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1456..1467
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1482..1493

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 75.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                          public void afterComponentAttached(Component comp, Page page) {
                              if (_uiCycles != null) {
                                  for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                      final UiLifeCycle listener = it.next();
                                      try {
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 3 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1456..1467
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1482..1493
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1495..1506

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 75.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                          public void afterComponentDetached(Component comp, Page prevpage) {
                              if (_uiCycles != null) {
                                  for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                                      final UiLifeCycle listener = it.next();
                                      try {
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 3 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1443..1454
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1482..1493
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1495..1506

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 75.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public boolean hasAttribute(String name, boolean recurse) {
                              if (hasAttribute(name))
                                  return true;
                              if (recurse) {
                                  if (_sess != null)
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 50 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 951..962

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 61.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                          public Event beforeSendEvent(Event event) {
                              event = _eis.beforeSendEvent(event);
                              if (event != null)
                                  event = _wapp.getConfiguration().beforeSendEvent(event);
                              return event;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 2 other locations - About 30 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1363..1368
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1370..1375

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 42.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                          public Event beforeProcessEvent(Event event) throws Exception {
                              event = _eis.beforeProcessEvent(event);
                              if (event != null)
                                  event = _wapp.getConfiguration().beforeProcessEvent(event);
                              return event;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 2 other locations - About 30 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1356..1361
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1363..1368

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 42.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                          public Event beforePostEvent(Event event) {
                              event = _eis.beforePostEvent(event);
                              if (event != null)
                                  event = _wapp.getConfiguration().beforePostEvent(event);
                              return event;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 2 other locations - About 30 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1356..1361
                      zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 1370..1375

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 42.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      There are no issues that match your filters.

                      Category
                      Status