zul/src/main/java/org/zkoss/zul/Listbox.java

Summary

Maintainability
F
1 mo
Test Coverage

File Listbox.java has 2658 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Listbox.java

    Purpose:

    Description:
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 wk to fix

    Method service has a Cognitive Complexity of 276 (exceeds 5 allowed). Consider refactoring.
    Open

        @SuppressWarnings({ "rawtypes", "unchecked" })
        public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
            final String cmd = request.getCommand();
            if (cmd.equals(Events.ON_DATA_LOADING)) {
                if (_rod) {
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 5 days 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

    Listbox has 178 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Listbox extends MeshElement {
        private static final long serialVersionUID = 2009111111L;
        public static final String LOADING_MODEL = "org.zkoss.zul.loadingModel";
        public static final String SYNCING_MODEL = "org.zkoss.zul.syncingModel";
    
    
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 3 days to fix

      Method insertBefore has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean insertBefore(Component newChild, Component refChild) {
              if (newChild instanceof Listitem) {
                  final boolean isReorder = newChild.getParent() == this;
                  //bug #3051305: Active Page not update when drag & drop item to the end
                  if (isReorder) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 days 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 setModel has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
      Open

          public void setModel(ListModel<?> model) {
              //ZK-3514: speed up
              if (_model != null && _model != model) {
                  int threshold = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
                  int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize());
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 day 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 295 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @SuppressWarnings({ "rawtypes", "unchecked" })
          public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
              final String cmd = request.getCommand();
              if (cmd.equals(Events.ON_DATA_LOADING)) {
                  if (_rod) {
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 day to fix

        Method renderProperties has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
        Open

            protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
                super.renderProperties(renderer);
        
                // ZK-4970: reset invalidateListitems here.
                Executions.getCurrent().removeAttribute("zkoss.Listbox.invalidateListitems" + getUuid());
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 day 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 updateVisibleCount has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
        Open

            private void updateVisibleCount(Listitem item, boolean isRemove) {
                if (item instanceof Listgroup || item.isVisible()) {
                    final Listgroup g = getListgroupAt(item.getIndex());
        
                    // We shall update the number of the visible item in the following
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 day 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 fixGroupsInfoBeforeInsert has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

            private void fixGroupsInfoBeforeInsert(Component newChild, Component refChild, boolean isReorder) {
                if (_isReplacingItem) //@see Renderer#render
                    return; //called by #insertBefore(), skip handling GroupInfo
        
                if (newChild instanceof Listgroupfoot) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 day 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 fixGroupsInfoAfterRemove has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

            private void fixGroupsInfoAfterRemove(Component child, int index) {
                if (!_isReplacingItem) { //@see Renderer#render
                    //called by #removeChild(), handling GroupInfo if !isReplcingItem
                    if (child instanceof Listgroup) {
                        int[] prev = null, remove = null;
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 6 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 setSelectedIndex has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

            @SuppressWarnings("rawtypes")
            public void setSelectedIndex(int jsel) {
                final int isz = _items.size();
                final int tsz = _model != null ? _model.getSize() : isz;
                if (jsel >= tsz)
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 6 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 beforeChildAdded has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
        Open

            public void beforeChildAdded(Component newChild, Component refChild) {
                if (newChild instanceof Listitem) {
                    if (newChild instanceof Listgroupfoot) {
                        if (!hasGroup())
                            throw new UiException("Listgroupfoot cannot exist alone, you have to add a Listgroup first");
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 5 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 onListDataChange has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

            @SuppressWarnings("rawtypes")
            private void onListDataChange(ListDataEvent event) {
                int type = event.getType();
                // ZK-4549: should ignore before handling sorting
                if (getAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED) != null
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 5 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 setPaginal has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            public void setPaginal(Paginal pgi) {
                if (!Objects.equals(pgi, _pgi)) {
                    final Paginal old = _pgi;
                    _pgi = pgi; // assign before detach paging, since removeChild
                    // assumes it
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixGroupsInfoAfterInsert has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            private void fixGroupsInfoAfterInsert(Listitem newItem) {
                if (_isReplacingItem) //@see Renderer#render
                    return; //called by #insertBefore(), skip handling GroupInfo
        
                if (newItem instanceof Listgroup) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixItemIndices has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            /* package */void fixItemIndices(int j, int to, boolean infront) {
                int realj = getRealIndex(j);
                if (realj < 0) {
                    realj = 0;
                }
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 insertBefore has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public boolean insertBefore(Component newChild, Component refChild) {
                if (newChild instanceof Listitem) {
                    final boolean isReorder = newChild.getParent() == this;
                    //bug #3051305: Active Page not update when drag & drop item to the end
                    if (isReorder) {
        Severity: Major
        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 3 hrs to fix

          Method removeChild has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

              public boolean removeChild(Component child) {
                  if (_paging == child && _pgi == child && inPagingMold())
                      throw new IllegalStateException(
                              "The paging component cannot be removed manually. It is removed automatically when changing the mold");
                  // Feature 1906110: prevent developers from removing it accidently
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Listbox.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 setModel has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void setModel(ListModel<?> model) {
                  //ZK-3514: speed up
                  if (_model != null && _model != model) {
                      int threshold = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
                      int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize());
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 3 hrs to fix

            Method doInitRenderer has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                @SuppressWarnings("rawtypes")
                private void doInitRenderer() {
                    if (getPage() == null)
                        return;
                    // sync the multiple status from model
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Listbox.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 addItemToSelection has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                public void addItemToSelection(Listitem item) {
                    if (item.getParent() != this)
                        throw new UiException("Not a child: " + item);
            
                    if (!item.isSelected()) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Listbox.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 renderProperties has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
                    super.renderProperties(renderer);
            
                    // ZK-4970: reset invalidateListitems here.
                    Executions.getCurrent().removeAttribute("zkoss.Listbox.invalidateListitems" + getUuid());
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 hrs to fix

              Method init has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void init() {
                      _items = new AbstractSequentialList<Listitem>() {
                          public ListIterator<Listitem> listIterator(int index) {
                              return new ItemIter(index);
                          }
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 hrs to fix

                Method setItemRenderer has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void setItemRenderer(ListitemRenderer<?> renderer) {
                        if (_renderer != renderer) {
                            _renderer = renderer;
                
                            if (_model != null) {
                Severity: Minor
                Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixGroupsInfoBeforeInsert has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private void fixGroupsInfoBeforeInsert(Component newChild, Component refChild, boolean isReorder) {
                        if (_isReplacingItem) //@see Renderer#render
                            return; //called by #insertBefore(), skip handling GroupInfo
                
                        if (newChild instanceof Listgroupfoot) {
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 hrs to fix

                  Method onListDataChange has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @SuppressWarnings("rawtypes")
                      private void onListDataChange(ListDataEvent event) {
                          int type = event.getType();
                          // ZK-4549: should ignore before handling sorting
                          if (getAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED) != null
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 hrs to fix

                    Method setSelectedIndex has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @SuppressWarnings("rawtypes")
                        public void setSelectedIndex(int jsel) {
                            final int isz = _items.size();
                            final int tsz = _model != null ? _model.getSize() : isz;
                            if (jsel >= tsz)
                    Severity: Minor
                    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                      Method render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              /* package */@SuppressWarnings({ "unchecked", "rawtypes" })
                              void render(Listitem item, int index) throws Throwable {
                                  if (item.isLoaded()) {
                                      return; // nothing to do
                                  }
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                        Method setMold has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public void setMold(String mold) {
                                final String old = getMold();
                                if (!Objects.equals(old, mold)) {
                                    super.setMold(mold);
                                    // we have to change model before detaching paging,
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 render has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                                /* package */@SuppressWarnings({ "unchecked", "rawtypes" })
                                void render(Listitem item, int index) throws Throwable {
                                    if (item.isLoaded()) {
                                        return; // nothing to do
                                    }
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 init has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void init() {
                                _items = new AbstractSequentialList<Listitem>() {
                                    public ListIterator<Listitem> listIterator(int index) {
                                        return new ItemIter(index);
                                    }
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 updateVisibleCount has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private void updateVisibleCount(Listitem item, boolean isRemove) {
                                if (item instanceof Listgroup || item.isVisible()) {
                                    final Listgroup g = getListgroupAt(item.getIndex());
                        
                                    // We shall update the number of the visible item in the following
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                          Method doSelectionChanged has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private void doSelectionChanged() {
                                  final Selectable<Object> smodel = getSelectableModel();
                                  final Set<Object> selObjs = smodel.getSelection();
                                  final int expSelCnt = selObjs.size();
                                  if (expSelCnt == 0) {
                          Severity: Minor
                          Found in zul/src/main/java/org/zkoss/zul/Listbox.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 setMultiple has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              @SuppressWarnings("rawtypes")
                              public void setMultiple(boolean multiple) {
                                  if (_multiple != multiple) {
                                      _multiple = multiple;
                                      if (!_multiple && _selItems.size() > 1) {
                          Severity: Minor
                          Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixGroupsInfoAfterRemove has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private void fixGroupsInfoAfterRemove(Component child, int index) {
                                  if (!_isReplacingItem) { //@see Renderer#render
                                      //called by #removeChild(), handling GroupInfo if !isReplcingItem
                                      if (child instanceof Listgroup) {
                                          int[] prev = null, remove = null;
                          Severity: Minor
                          Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                            Method doInitRenderer has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @SuppressWarnings("rawtypes")
                                private void doInitRenderer() {
                                    if (getPage() == null)
                                        return;
                                    // sync the multiple status from model
                            Severity: Minor
                            Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                              Method removeChild has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public boolean removeChild(Component child) {
                                      if (_paging == child && _pgi == child && inPagingMold())
                                          throw new IllegalStateException(
                                                  "The paging component cannot be removed manually. It is removed automatically when changing the mold");
                                      // Feature 1906110: prevent developers from removing it accidently
                              Severity: Minor
                              Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                                Method addVisibleItemCount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    /* package */void addVisibleItemCount(int count) {
                                        if (count != 0) {
                                            _visibleItemCount += count;
                                            if (inPagingMold()) {
                                                final Paginal pgi = getPaginal();
                                Severity: Minor
                                Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixGroupsInfoAfterInsert has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private void fixGroupsInfoAfterInsert(Listitem newItem) {
                                        if (_isReplacingItem) //@see Renderer#render
                                            return; //called by #insertBefore(), skip handling GroupInfo
                                
                                        if (newItem instanceof Listgroup) {
                                Severity: Minor
                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

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

                                          public void onEvent(Event event) throws Exception {
                                              if (_modelInitListener != null) {
                                                  Listbox.this.removeEventListener("onInitModel", _modelInitListener);
                                                  _modelInitListener = null;
                                              }
                                  Severity: Minor
                                  Found in zul/src/main/java/org/zkoss/zul/Listbox.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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      /* package */int getGroupIndex(int index) {
                                          int j = 0, gindex = -1;
                                          int[] g = null;
                                          for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext(); ++j) {
                                              g = it.next();
                                  Severity: Minor
                                  Found in zul/src/main/java/org/zkoss/zul/Listbox.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 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      @SuppressWarnings("rawtypes")
                                      private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
                                          s.defaultReadObject();
                                  
                                          _model = (ListModel) s.readObject();
                                  Severity: Minor
                                  Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixSelectedIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      private void fixSelectedIndex(int j) {
                                          if (!_selItems.isEmpty()) {
                                              int realj = getRealIndex(j);
                                              if (realj < 0)
                                                  realj = 0;
                                  Severity: Minor
                                  Found in zul/src/main/java/org/zkoss/zul/Listbox.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 beforeChildAdded has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public void beforeChildAdded(Component newChild, Component refChild) {
                                          if (newChild instanceof Listitem) {
                                              if (newChild instanceof Listgroupfoot) {
                                                  if (!hasGroup())
                                                      throw new UiException("Listgroupfoot cannot exist alone, you have to add a Listgroup first");
                                  Severity: Minor
                                  Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

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

                                            public boolean hasNext() {
                                                if (!inPagingMold())
                                                    return _it.hasNext();
                                    
                                                if (!_isBeginning && _count >= getPaginal().getPageSize()) {
                                    Severity: Minor
                                    Found in zul/src/main/java/org/zkoss/zul/Listbox.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 setPaginal has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public void setPaginal(Paginal pgi) {
                                            if (!Objects.equals(pgi, _pgi)) {
                                                final Paginal old = _pgi;
                                                _pgi = pgi; // assign before detach paging, since removeChild
                                                // assumes it
                                    Severity: Minor
                                    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                                      Method afterUnmarshal has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          private void afterUnmarshal(int index) {
                                              for (Iterator<Component> it = getChildren().iterator(); it.hasNext();) {
                                                  final Object child = it.next();
                                                  if (child instanceof Listitem) {
                                                      final Listitem li = (Listitem) child;
                                      Severity: Minor
                                      Found in zul/src/main/java/org/zkoss/zul/Listbox.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 onPageAttached has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public void onPageAttached(Page newpage, Page oldpage) {
                                              super.onPageAttached(newpage, oldpage);
                                              if (oldpage == null) { // mark as a new attached Listbox
                                                  final Execution exec = Executions.getCurrent();
                                                  exec.setAttribute("zkoss.Listbox.deferInitModel_" + getUuid(), Boolean.TRUE);
                                      Severity: Minor
                                      Found in zul/src/main/java/org/zkoss/zul/Listbox.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 10 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                              public void onEvent(Event event) {
                                                  //Bug ZK-1622: reset anchor position after changing page
                                                  _anchorTop = 0;
                                                  _anchorLeft = 0;
                                                  if (event instanceof PagingEvent) {
                                      Severity: Minor
                                      Found in zul/src/main/java/org/zkoss/zul/Listbox.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 setMold has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public void setMold(String mold) {
                                              final String old = getMold();
                                              if (!Objects.equals(old, mold)) {
                                                  super.setMold(mold);
                                                  // we have to change model before detaching paging,
                                      Severity: Minor
                                      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

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

                                                private Listitem getVisibleRow(Listitem item) {
                                                    if (item instanceof Listgroup) {
                                                        final Listgroup g = (Listgroup) item;
                                                        if (!g.isOpen()) {
                                                            for (int j = 0, len = g.getItemCount(); j < len && _it.hasNext(); j++)
                                        Severity: Minor
                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 onAfterRender has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public void onAfterRender() {
                                                if (inPagingMold() && _model instanceof Pageable) {
                                                    Pageable m = (Pageable) _model;
                                                    if (m.getPageSize() > 0) { //min page size is 1
                                                        _pgi.setPageSize(m.getPageSize());
                                        Severity: Minor
                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 onEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                                public void onEvent(Event event) {
                                                    if (_model != null && inPagingMold()) {
                                                        final Paginal pgi = getPaginal();
                                                        int pgsz = pgi.getPageSize();
                                                        int ofs = pgi.getActivePage() * pgsz;
                                        Severity: Minor
                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 getGroupsInfoAt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            /* package */int[] getGroupsInfoAt(int index, boolean isListgroup) {
                                                for (int[] g : _groupsInfo) {
                                                    if (isListgroup) {
                                                        if (index == g[0])
                                                            return g;
                                        Severity: Minor
                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 checkInvalidateForMoved has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            private void checkInvalidateForMoved(Listitem child, boolean bRemove) {
                                                // No need to invalidate if
                                                // 1) act == last and child in act
                                                // 2) act != last and child after act
                                                // Except removing last elem which in act and act has only one elem
                                        Severity: Minor
                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixRefChildBeforeFoot has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            private Component fixRefChildBeforeFoot(Component refChild) {
                                                if (refChild == null) {
                                                    if (_listfoot != null)
                                                        refChild = _listfoot;
                                                    else if (_frozen != null)
                                        Severity: Minor
                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 (!item.isDisabled() && item.isSelectable())
                                                                        curSeldItems.add(item);
                                        Severity: Major
                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if (hds != null) {
                                                                      for (Component listheader : hds.getChildren()) {
                                                                          ((Listheader) listheader).setSortDirection("natural");
                                                                      }
                                                                  }
                                          Severity: Major
                                          Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    if (g[2] != -1)
                                                                        g[2] += (infront ? 1 : -1);
                                            Severity: Major
                                            Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if (!group.isOpen()) {
                                                                          addVisibleItemCount(isRemove ? group.getVisibleItemCount() : -group.getVisibleItemCount());
                                                                      }
                                              Severity: Major
                                              Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if (m.getPageSize() > 0) { //min page size is 1
                                                                            pgi.setPageSize(m.getPageSize());
                                                                        } else {
                                                                            m.setPageSize(pgi.getPageSize());
                                                                        }
                                                Severity: Major
                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          if (m.getActivePage() >= 0) { //min page index is 0
                                                                              pgi.setActivePage(m.getActivePage());
                                                                          } else {
                                                                              m.setActivePage(pgi.getActivePage());
                                                                          }
                                                  Severity: Major
                                                  Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                            if (realIndex >= 0 && realIndex < getItemCount())
                                                                                removeChild(getChildren().get(realIndex));
                                                    Severity: Major
                                                    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                                                      Consider simplifying this complex logical expression.
                                                      Open

                                                                                  if (firstItemIndex <= index && index <= lastItemIndex // ZK-2658
                                                                                          && !curSeldItems.contains(item)
                                                                                          && (!paging || (from <= index && index < to))
                                                                                  ) {
                                                                                      removeItemFromSelection(item);
                                                      Severity: Major
                                                      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 40 mins to fix

                                                        Method onPageDetached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            public void onPageDetached(Page page) {
                                                                super.onPageDetached(page);
                                                                if (_model != null && _dataListener != null)
                                                                    _model.removeListDataListener(_dataListener);
                                                                if (_model instanceof PageableModel && _pgListener != null)
                                                        Severity: Minor
                                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 selectItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            public void selectItem(Listitem item) {
                                                                if (item == null) {
                                                                    setSelectedIndex(-1);
                                                                } else {
                                                                    if (item.getParent() != this)
                                                        Severity: Minor
                                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixRefChildForHeader has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            private Component fixRefChildForHeader(Component refChild) {
                                                                if (refChild != null && refChild.getParent() != this)
                                                                    refChild = null;
                                                        
                                                                // try the first listitem
                                                        Severity: Minor
                                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 clone has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            @SuppressWarnings("rawtypes")
                                                            public Object clone() {
                                                                final Listbox clone = (Listbox) super.clone();
                                                                clone.init();
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in zul/src/main/java/org/zkoss/zul/Listbox.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 zul/src/main/java/org/zkoss/zul/Listbox.java - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                          return true;
                                                          Severity: Major
                                                          Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                            return true;
                                                            Severity: Major
                                                            Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                              return true;
                                                              Severity: Major
                                                              Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 30 mins to fix

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

                                                                    public void selectAll() {
                                                                        if (!_multiple)
                                                                            throw new UiException("Appliable only to the multiple seltype: " + this);
                                                                
                                                                        if (_items.size() != _selItems.size()) {
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.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 fixItemIndices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    private void fixItemIndices(int j, int to) {
                                                                        int realj = getRealIndex(j);
                                                                        if (realj < 0)
                                                                            realj = 0;
                                                                        if (realj < _items.size()) {
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.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 renderAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    public void renderAll() {
                                                                        if (_model == null)
                                                                            return;
                                                                
                                                                        _renderAll = true;
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.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 getDataLoader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    /* package */DataLoader getDataLoader() {
                                                                        if (_dataLoader == null) {
                                                                            _rod = evalRod();
                                                                            final String loadercls = Library.getProperty("org.zkoss.zul.listbox.DataLoader.class");
                                                                            try {
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.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 doSort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    private static boolean doSort(Listbox listbox) {
                                                                        Listhead hds = listbox.getListhead();
                                                                        if (!listbox.isAutosort() || hds == null)
                                                                            return false;
                                                                        for (Iterator<Component> it = hds.getChildren().iterator(); it.hasNext();) {
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.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

                                                                    /* package */int getGroupIndex(int index) {
                                                                        int j = 0, gindex = -1;
                                                                        int[] g = null;
                                                                        for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext(); ++j) {
                                                                            g = it.next();
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 3 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 252..265

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

                                                                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 void setMold(String mold) {
                                                                        final String old = getMold();
                                                                        if (!Objects.equals(old, mold)) {
                                                                            super.setMold(mold);
                                                                            // we have to change model before detaching paging,
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1348..1381

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

                                                                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

                                                                                    if (preRow == null) {
                                                                                        if (!group.isOpen()) {
                                                                                            addVisibleItemCount(isRemove ? group.getVisibleItemCount() : -group.getVisibleItemCount());
                                                                                        }
                                                                                    } else {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 542..557

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

                                                                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 3 locations. Consider refactoring.
                                                                Open

                                                                            if (event.getType() == ListDataEvent.STRUCTURE_CHANGED && _model instanceof Sortable && _listhead != null) { //ZK-1705 added null check for _listhead
                                                                                Sortable<Object> smodel = cast(_model);
                                                                                List<Listheader> headers = cast(_listhead.getChildren());
                                                                                boolean found = false;
                                                                                for (Listheader col : headers) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 2 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1134..1153
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 1598..1617

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

                                                                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

                                                                                if (inPagingMold()) {
                                                                                    if (_model instanceof PageableModel)
                                                                                        ((PageableModel) _model).addPagingEventListener((PagingListener) _pgListener);
                                                                                    //B30-2129667, B36-2782751, (ROD) exception when zul applyProperties
                                                                                    //must update paginal totalSize or exception in setActivePage
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 811..835

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

                                                                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 void onEvent(Event event) {
                                                                            //Bug ZK-1622: reset anchor position after changing page
                                                                            _anchorTop = 0;
                                                                            _anchorLeft = 0;
                                                                            if (event instanceof PagingEvent) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 539..559

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

                                                                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

                                                                                if (_model != null) {
                                                                                    _model.removeListDataListener(_dataListener);
                                                                                    if (_model instanceof PageableModel && _pgListener != null)
                                                                                        ((PageableModel) _model).removePagingEventListener((PagingListener) _pgListener);
                                                                                    GroupsModel groupsModel = getGroupsModel();
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 778..801

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

                                                                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

                                                                            if (_model != null && inPagingMold()) {
                                                                                final Paginal pgi = getPaginal();
                                                                                int pgsz = pgi.getPageSize();
                                                                                int ofs = pgi.getActivePage() * pgsz;
                                                                                if (event instanceof PagingEvent) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 639..658

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

                                                                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

                                                                    @SuppressWarnings("rawtypes")
                                                                    public void setMultiple(boolean multiple) {
                                                                        if (_multiple != multiple) {
                                                                            _multiple = multiple;
                                                                            if (!_multiple && _selItems.size() > 1) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 971..989

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

                                                                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

                                                                                if ((!infront || beginning != j) && o instanceof Listgroup) {
                                                                                    int[] g = getLastGroupsInfoAt(j + (infront ? -1 : 1));
                                                                                    if (g != null) {
                                                                                        g[0] = j;
                                                                                        if (g[2] != -1)
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 184..191

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

                                                                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

                                                                        } else if (!_groupsInfo.isEmpty()) {
                                                                            int index = newItem.getIndex();
                                                                            final int[] g = getGroupsInfoAt(index);
                                                                            if (g != null) {
                                                                                g[1]++;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 458..467

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

                                                                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

                                                                            try {
                                                                                try {
                                                                                    _renderer.render(item, value, index);
                                                                                } catch (AbstractMethodError ex) {
                                                                                    final Method m = _renderer.getClass().getMethod("render",
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Combobox.java on lines 635..647

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

                                                                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 void onAfterRender() {
                                                                        if (inPagingMold() && _model instanceof Pageable) {
                                                                            Pageable m = (Pageable) _model;
                                                                            if (m.getPageSize() > 0) { //min page size is 1
                                                                                _pgi.setPageSize(m.getPageSize());
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1948..1963

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

                                                                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

                                                                        if (clone._model != null) {
                                                                            if (clone._model instanceof ComponentCloneListener) {
                                                                                final ListModel model = (ListModel) ((ComponentCloneListener) clone._model).willClone(clone);
                                                                                if (model != null)
                                                                                    clone._model = model;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1584..1599

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

                                                                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

                                                                                } else if (getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) {
                                                                                    getDataLoader().syncModel(-1, -1); // have to recreate all
                                                                                } else {
                                                                                    //bug# 3039282, we need to resyncModel if not in a defer mode
                                                                                    final Execution exec = Executions.getCurrent();
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 959..969

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

                                                                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

                                                                    private static boolean doSort(Listbox listbox) {
                                                                        Listhead hds = listbox.getListhead();
                                                                        if (!listbox.isAutosort() || hds == null)
                                                                            return false;
                                                                        for (Iterator<Component> it = hds.getChildren().iterator(); it.hasNext();) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 918..930

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

                                                                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

                                                                    /* package */DataLoader getDataLoader() {
                                                                        if (_dataLoader == null) {
                                                                            _rod = evalRod();
                                                                            final String loadercls = Library.getProperty("org.zkoss.zul.listbox.DataLoader.class");
                                                                            try {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1538..1551

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

                                                                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 void onPageDetached(Page page) {
                                                                        super.onPageDetached(page);
                                                                        if (_model != null && _dataListener != null)
                                                                            _model.removeListDataListener(_dataListener);
                                                                        if (_model instanceof PageableModel && _pgListener != null)
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 328..337

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

                                                                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

                                                                    /*package*/ boolean isAutosort() {
                                                                        String attr = "org.zkoss.zul.listbox.autoSort";
                                                                        Object val = getAttribute(attr, true);
                                                                        if (val == null)
                                                                            val = Library.getProperty(attr);
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1485..1492
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2726..2733

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

                                                                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

                                                                        } else if (newChild instanceof Paging) {
                                                                            if (_paging != null && _paging != newChild)
                                                                                throw new UiException("Only one paging is allowed: " + this);
                                                                            if (_pgi != null)
                                                                                throw new UiException("External paging cannot coexist with child paging");
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 1279..1288

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

                                                                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

                                                                    private void addPagingListener(Paginal pgi) {
                                                                        if (_pgListener == null)
                                                                            _pgListener = new PGListener();
                                                                        pgi.addEventListener(ZulEvents.ON_PAGING, _pgListener);
                                                                        if (_model instanceof PageableModel) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 677..688

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

                                                                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

                                                                        if (_model != null && _model != model) {
                                                                            int threshold = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
                                                                            int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize());
                                                                            if (diff > threshold)
                                                                                invalidate();
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 770..775

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

                                                                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

                                                                    private int preloadSize() {
                                                                        final String size = (String) getAttribute("pre-load-size");
                                                                        int sz = size != null ? Integer.parseInt(size) : _preloadsz;
                                                                
                                                                        if ((sz = Utils.getIntAttribute(this, "org.zkoss.zul.listbox.preloadSize", sz, true)) < 0)
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1503..1510
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2154..2161

                                                                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

                                                                                if (count < 0 && _model instanceof Pageable) {
                                                                                    Pageable p = (Pageable) _model;
                                                                                    int actpg = p.getActivePage();
                                                                                    int maxPageIndex = p.getPageCount() - 1;
                                                                                    if (actpg > maxPageIndex) {
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 128..135

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

                                                                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

                                                                                if (g != null) {
                                                                                    g[1]--;
                                                                                    if (g[2] != -1)
                                                                                        g[2]--;
                                                                                    fixItemIndices(index, -1, false);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 498..504

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

                                                                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 isVflex() {
                                                                        final String vflex = getVflex();
                                                                        if ("true".equals(vflex) || "min".equals(vflex)) {
                                                                            return true;
                                                                        }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 55 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 417..426

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

                                                                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 3 locations. Consider refactoring.
                                                                Open

                                                                                if (isReorder) {
                                                                                    final int nindex = ((Listgroupfoot) newChild).getIndex();
                                                                                    final int[] ginfo = getGroupsInfoAt(nindex);
                                                                                    if (ginfo != null) {
                                                                                        ginfo[1]--;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 55 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2147..2154
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2105..2112

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

                                                                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 3 locations. Consider refactoring.
                                                                Open

                                                                                if (isReorder) {
                                                                                    final int idx = ((Listgroupfoot) newChild).getIndex();
                                                                                    final int[] ginfo = getGroupsInfoAt(idx);
                                                                                    if (ginfo != null) {
                                                                                        ginfo[1]--;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 55 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2147..2154
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2126..2133

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

                                                                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 3 locations. Consider refactoring.
                                                                Open

                                                                                    if (isReorder) {
                                                                                        final int nindex = ((Listgroupfoot) newChild).getIndex();
                                                                                        final int[] ginfo = getGroupsInfoAt(nindex);
                                                                                        if (ginfo != null) {
                                                                                            ginfo[1]--;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 55 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2126..2133
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2105..2112

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

                                                                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

                                                                            if (isRemove && _model instanceof Pageable) {
                                                                                Pageable p = (Pageable) _model;
                                                                                int actpg = p.getActivePage();
                                                                                int maxPageIndex = p.getPageCount() - 1;
                                                                                if (actpg > maxPageIndex) {
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 55 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 565..572

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

                                                                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

                                                                            if (pgi != null) {
                                                                                int pgsz = pgi.getPageSize();
                                                                                from = pgi.getActivePage() * pgsz;
                                                                                to = from + pgsz; // excluded
                                                                            } else {
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 55 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2868..2875

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

                                                                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

                                                                                if (!toload.isEmpty()) {
                                                                                    int bfcnt = cnt / 3;
                                                                                    for (Iterator<Listitem> e = toload.iterator(); bfcnt > 0 && e.hasNext(); --bfcnt, --cnt) {
                                                                                        items.add(e.next());
                                                                                    }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 55 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1882..1887

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

                                                                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

                                                                    private void smartUpdateSelection() {
                                                                        final StringBuffer sb = new StringBuffer(80);
                                                                        for (Listitem item : _selItems) {
                                                                            if (sb.length() > 0)
                                                                                sb.append(',');
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 50 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 1172..1180

                                                                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

                                                                    private boolean isIgnoreSortWhenChanged() {
                                                                        String attr = "org.zkoss.zul.listbox.autoSort";
                                                                        Object val = getAttribute(attr, true);
                                                                        if (val == null)
                                                                            val = Library.getProperty(attr);
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 50 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1530..1536
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2739..2745

                                                                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 19 locations. Consider refactoring.
                                                                Open

                                                                    public void setName(String name) {
                                                                        if (name != null && name.length() == 0)
                                                                            name = null;
                                                                        if (!Objects.equals(_name, name)) {
                                                                            _name = name;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 18 other locations - About 50 mins to fix
                                                                zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
                                                                zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
                                                                zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
                                                                zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
                                                                zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
                                                                zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
                                                                zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
                                                                zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
                                                                zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
                                                                zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
                                                                zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
                                                                zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
                                                                zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
                                                                zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
                                                                zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

                                                                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 19 locations. Consider refactoring.
                                                                Open

                                                                    public void setOddRowSclass(String scls) {
                                                                        if (scls != null && scls.length() == 0)
                                                                            scls = null;
                                                                        if (!Objects.equals(_scOddRow, scls)) {
                                                                            _scOddRow = scls;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 18 other locations - About 50 mins to fix
                                                                zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
                                                                zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
                                                                zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
                                                                zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
                                                                zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
                                                                zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
                                                                zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
                                                                zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
                                                                zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
                                                                zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
                                                                zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
                                                                zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
                                                                zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
                                                                zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
                                                                zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

                                                                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

                                                                    /* package */int[] getLastGroupsInfoAt(int index) {
                                                                        int[] rg = null;
                                                                        for (int[] g : _groupsInfo) {
                                                                            if (index == g[0])
                                                                                rg = g;
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 50 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 236..245

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

                                                                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

                                                                        } else if (newChild instanceof Paging) {
                                                                            refChild = null; // the last: paging
                                                                            if (super.insertBefore(newChild, refChild)) {
                                                                                _pgi = _paging = (Paging) newChild;
                                                                                return true;
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 50 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 1315..1323

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

                                                                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

                                                                                final int jto = refChild instanceof Listitem ? ((Listitem) refChild).getIndex() : -1,
                                                                                        fixFrom = jfrom < 0 || (jto >= 0 && jfrom > jto) ? jto : jfrom;
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 45 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 307..308

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

                                                                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 3 locations. Consider refactoring.
                                                                Open

                                                                        protected void removeRange(int fromIndex, int toIndex) {
                                                                            ListIterator<Component> it = listIterator(toIndex);
                                                                            for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                                                                                it.previous();
                                                                                it.remove();
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 45 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 417..423
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 678..684

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

                                                                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 3 locations. Consider refactoring.
                                                                Open

                                                                            protected void removeRange(int fromIndex, int toIndex) {
                                                                                ListIterator<Listitem> it = listIterator(toIndex);
                                                                                for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                                                                                    it.previous();
                                                                                    it.remove();
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 45 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 483..489
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 678..684

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

                                                                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

                                                                    private <T> Set<T> collectUnselectedObjects(Set<T> previousSelection, Set<T> currentSelection) {
                                                                        Set<T> prevSeldItems = previousSelection != null ? new LinkedHashSet<T>(previousSelection)
                                                                                : new LinkedHashSet<T>();
                                                                        if (currentSelection != null && prevSeldItems.size() > 0)
                                                                            prevSeldItems.removeAll(currentSelection);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 45 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2763..2769

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

                                                                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

                                                                        if (size > 0) {
                                                                            List groupsInfo = (List) s.readObject();
                                                                            for (int i = 0; i < size; i++)
                                                                                _groupsInfo.add((int[]) groupsInfo.get(i));
                                                                        }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 45 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 664..668

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

                                                                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 5 locations. Consider refactoring.
                                                                Open

                                                                        /* package */void doCatch(Throwable ex) {
                                                                            if (_ctrled) {
                                                                                try {
                                                                                    ((RendererCtrl) _renderer).doCatch(ex);
                                                                                } catch (Throwable t) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 4 other locations - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Combobox.java on lines 660..670
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1224..1234
                                                                zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 712..722
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2394..2404

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

                                                                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

                                                                            if (paging && (!isCheckmarkDeselectOther() || selectAll)) {
                                                                                // use toArray() to prevent java.util.ConcurrentModificationException
                                                                                for (Object item : realPrevSeldItems.toArray()) {
                                                                                    int index = ((Listitem) item).getIndex();
                                                                                    if (index >= to || index < from)
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2878..2885

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

                                                                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

                                                                                    _groupsInfo.add(idx, new int[] { index, size, size > 1 && prev[2] >= index ? prev[2] + 1 : -1 });
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 451..451

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

                                                                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

                                                                                if (sel < 0 || sel < begin || sel >= end) { //not in selection range
                                                                                    sel = size > oldsize ? (end - 1) : begin;
                                                                                }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2962..2964

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

                                                                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 3 locations. Consider refactoring.
                                                                Open

                                                                    private void removePagingListener(Paginal pgi) {
                                                                        if (_model instanceof PageableModel) {
                                                                            ((PageableModel) _model).removePagingEventListener((PagingListener) _pgListener);
                                                                        }
                                                                        pgi.removeEventListener(ZulEvents.ON_PAGING, _pgListener);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 691..697
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 673..679

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

                                                                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 5 locations. Consider refactoring.
                                                                Open

                                                                    public void setInnerWidth(String innerWidth) {
                                                                        if (innerWidth == null)
                                                                            innerWidth = "100%";
                                                                        if (!_innerWidth.equals(innerWidth)) {
                                                                            _innerWidth = innerWidth;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 4 other locations - About 40 mins to fix
                                                                zhtml/src/main/java/org/zkoss/zhtml/impl/ContentTag.java on lines 53..60
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1000..1007
                                                                zul/src/main/java/org/zkoss/zul/Iframe.java on lines 71..78
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 921..928

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

                                                                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

                                                                        if (_dataLoader != null) {
                                                                            s.writeInt(_dataLoader.getOffset());
                                                                            s.writeInt(_dataLoader.getLimit());
                                                                        } else {
                                                                            s.writeInt(0);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1667..1673

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

                                                                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

                                                                                            if (smodel != null) { //still have to add selection if not multiple select
                                                                                                Object ele = _model.getElementAt(item.getIndex());
                                                                                                if (ctrl == null || ctrl.isSelectable(ele))
                                                                                                    smodel.addToSelection(ele);
                                                                                            }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3731..3735

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

                                                                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

                                                                                        if (item != null) {
                                                                                            Object ele = _model.getElementAt(item.getIndex());
                                                                                            if (ctrl == null || ctrl.isSelectable(ele))
                                                                                                selObjs.add(ele);
                                                                                        }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 40 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3742..3746

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

                                                                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

                                                                    private void postOnPagingInitRender() {
                                                                        if (getAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED) == null
                                                                                && getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) { // B50-ZK-345
                                                                            setAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED, Boolean.TRUE);
                                                                            Events.postEvent("onPagingInitRender", this, null);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1098..1104

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

                                                                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

                                                                    private boolean isCheckmarkDeselectOther() {
                                                                        if (_ckDeselectOther == null) //ok to race
                                                                            _ckDeselectOther = Boolean
                                                                                    .valueOf("true".equals(Library.getProperty("org.zkoss.zul.listbox.checkmarkDeselectOthers")));
                                                                        return Utils.testAttribute(this, "org.zkoss.zul.listbox.checkmarkDeselectOthers", _ckDeselectOther.booleanValue(), true);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2750..2755

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

                                                                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 7 locations. Consider refactoring.
                                                                Open

                                                                    public void setMaxlength(int maxlength) {
                                                                        if (maxlength < 0)
                                                                            maxlength = 0;
                                                                        if (_maxlength != maxlength) {
                                                                            _maxlength = maxlength;
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 6 other locations - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listheader.java on lines 368..375
                                                                zul/src/main/java/org/zkoss/zul/Panel.java on lines 317..324
                                                                zul/src/main/java/org/zkoss/zul/Panel.java on lines 341..348
                                                                zul/src/main/java/org/zkoss/zul/Treecol.java on lines 322..329
                                                                zul/src/main/java/org/zkoss/zul/Window.java on lines 298..305
                                                                zul/src/main/java/org/zkoss/zul/Window.java on lines 322..329

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

                                                                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

                                                                            SelectEvent evt = new SelectEvent(Events.ON_SELECT, this, curSeldItems, prevSeldItems, unselectedItems,
                                                                                    selectedObjects, prevSeldObjects, unselectedObjects,
                                                                                    desktop.getComponentByUuidIfAny((String) data.get("reference")), null, AuRequests.parseKeys(data));
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2948..2950

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

                                                                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

                                                                                if (selectionControl != null) {
                                                                                    Clients.response(new AuInvoke(this, "$doService", new Object[] { cmd, new JSONAware() {
                                                                                        public String toJSONString() {
                                                                                            return String.valueOf(selectionControl.isSelectAll());
                                                                                        }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2994..3000

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

                                                                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

                                                                    private int initRodSize() {
                                                                        int sz = Utils.getIntAttribute(this, "org.zkoss.zul.listbox.initRodSize", INIT_LIMIT, true);
                                                                        if ((sz) < 0)
                                                                            throw new UiException("nonnegative is required: " + sz);
                                                                        return sz;
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1520..1525

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

                                                                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 Listitem next() {
                                                                            if (!hasNext()) //use _items.size() to control if reach listfoot
                                                                                throw new NoSuchElementException();
                                                                
                                                                            prepare();
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2993..3002

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

                                                                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 Listitem previous() {
                                                                            if (!hasPrevious()) //use _j >= 0 to control if reach listhead
                                                                                throw new NoSuchElementException();
                                                                
                                                                            prepare();
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2982..2991

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

                                                                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 5 locations. Consider refactoring.
                                                                Open

                                                                        } else if (cmd.equals(Events.ON_ANCHOR_POS)) {
                                                                            final Map<String, Object> data = request.getData();
                                                                            _anchorTop = AuRequests.getInt(data, "top", 0);
                                                                            _anchorLeft = AuRequests.getInt(data, "left", 0);
                                                                        } else if (cmd.equals(Events.ON_TOP_PAD)) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 4 other locations - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1848..1852
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3629..3633
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2978..2982
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2974..2978

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

                                                                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 5 locations. Consider refactoring.
                                                                Open

                                                                        } else if (cmd.equals(Events.ON_SCROLL_POS)) {
                                                                            final Map<String, Object> data = request.getData();
                                                                            _currentTop = AuRequests.getInt(data, "top", 0);
                                                                            _currentLeft = AuRequests.getInt(data, "left", 0);
                                                                        } else if (cmd.equals(Events.ON_ANCHOR_POS)) {
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 4 other locations - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1848..1852
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3633..3637
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2978..2982
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2974..2978

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

                                                                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 4 locations. Consider refactoring.
                                                                Open

                                                                        if (_model instanceof PageableModel && _pgListener != null) {
                                                                            ((PageableModel) _model).removePagingEventListener((PagingListener) _pgListener);
                                                                            ((PageableModel) _model).addPagingEventListener((PagingListener) _pgListener);
                                                                        }
                                                                Severity: Major
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 3 other locations - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 318..321
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 296..299
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2032..2035

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

                                                                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

                                                                            if (_model != null && paging) {
                                                                                prevSeldItems = null;
                                                                                unselectedItems = null;
                                                                            } else {
                                                                                unselectedItems = collectUnselectedObjects(realPrevSeldItems, curSeldItems);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 2930..2935

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

                                                                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

                                                                        try {
                                                                            for (final Listitem item : items)
                                                                                renderer.render(item, item.getIndex());
                                                                        } catch (Throwable ex) {
                                                                            renderer.doCatch(ex);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1306..1313

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

                                                                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 void setSeltype(String seltype) throws WrongValueException {
                                                                        if ("single".equals(seltype))
                                                                            setMultiple(false);
                                                                        else if ("multiple".equals(seltype))
                                                                            setMultiple(true);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Tree.java on lines 951..958

                                                                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 2 locations. Consider refactoring.
                                                                Open

                                                                                    fixItemIndices(fixFrom, jfrom >= 0 && jto >= 0 ? jfrom > jto ? jfrom : jto : -1, !isReorder);
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 314..314

                                                                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 2 locations. Consider refactoring.
                                                                Open

                                                                            if (newChild instanceof Listgroupfoot) {
                                                                                if (!hasGroup())
                                                                                    throw new UiException("Listgroupfoot cannot exist alone, you have to add a Listgroup first");
                                                                                if (refChild == null) {
                                                                                    if (getLastChild() instanceof Listgroupfoot)
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Rows.java on lines 277..284

                                                                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

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

                                                                            if (!(_renderer instanceof ListitemRendererExt)
                                                                                    || (((ListitemRendererExt) _renderer).getControls() & ListitemRendererExt.DETACH_ON_RENDER) != 0) { // detach
                                                                                // (default)
                                                                                cell.detach();
                                                                            }
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Grid.java on lines 1185..1188

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

                                                                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

                                                                        } else if (newChild instanceof Listfoot) {
                                                                            if (_listfoot != null && _listfoot != newChild)
                                                                                throw new UiException("Only one listfoot is allowed: " + this);
                                                                            if (inSelectMold())
                                                                                log.warn("Mold select ignores listfoot");
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1658..1663

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

                                                                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

                                                                        } else if (newChild instanceof Frozen) {
                                                                            if (_frozen != null && _frozen != newChild)
                                                                                throw new UiException("Only one frozen child is allowed: " + this);
                                                                            if (inSelectMold())
                                                                                log.warn("Mold select ignores frozen");
                                                                Severity: Minor
                                                                Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
                                                                zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1663..1668

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

                                                                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