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

Summary

Maintainability
F
1 wk
Test Coverage

File Rows.java has 537 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Rows.java

    Purpose:
        
    Description:
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 1 day to fix

    Method updateVisibleCount has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

        private void updateVisibleCount(Row row, boolean isRemove) {
            if (row instanceof Group || row.isVisible()) {
                final Group g = getGroup(row.getIndex());
    
                // We shall update the number of the visible item in the following cases.
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 7 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 fixGroupsInfoAfterRemove has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        private void fixGroupsInfoAfterRemove(Row child, int index) {
            if (!_isReplacingRow) { //@see Grid.Renderer#render 
                //called by #removeChild, handling GroupInfo if !isReplcingRow
                if (child instanceof Group) {
                    int[] prev = null, remove = null;
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Rows.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

    Rows has 41 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Rows extends XulElement {
        private int _visibleItemCount;
    
        private transient List<int[]> _groupsInfo;
        private transient List<Group> _groups;
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 5 hrs to fix

      Method fixGroupsInfoAfterInsert has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

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

          /*package*/ void fixGroupIndex(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/Rows.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 fixGroupsInfoBeforeInsert has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          private void fixGroupsInfoBeforeInsert(Row newItem, Row refChild, boolean isReorder) {
              if (_isReplacingRow) //@see Grid.Renderer#render
                  return; //called by #insertBefore(), skip handling GroupInfo
      
              if (newItem instanceof Groupfoot) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Rows.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 addVisibleItemCount has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          /*package*/ void addVisibleItemCount(int count) {
              if (count != 0) {
                  _visibleItemCount += count;
                  final Grid grid = getGrid();
                  if (grid != null) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Rows.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 insertBefore has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean insertBefore(Component child, Component refChild) {
              final Grid grid = getGrid();
              final boolean isReorder = child.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/Rows.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 checkInvalidateForMoved has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          private void checkInvalidateForMoved(Component 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 element which in act and act has only one element
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Rows.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 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method updateVisibleCount has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method fixGroupsInfoAfterInsert has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            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/Rows.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 fixGroupsInfoBeforeInsert has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void fixGroupsInfoBeforeInsert(Row newItem, Row refChild, boolean isReorder) {
                    if (_isReplacingRow) //@see Grid.Renderer#render
                        return; //called by #insertBefore(), skip handling GroupInfo
            
                    if (newItem instanceof Groupfoot) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 1 hr to fix

              Method addVisibleItemCount has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  /*package*/ void addVisibleItemCount(int count) {
                      if (count != 0) {
                          _visibleItemCount += count;
                          final Grid grid = getGrid();
                          if (grid != null) {
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 1 hr to fix

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

                    public void beforeChildAdded(Component child, Component refChild) {
                        if (!(child instanceof Row))
                            throw new UiException("Unsupported child for rows: " + child);
                        if (child instanceof Groupfoot) {
                            if (!hasGroup())
                Severity: Minor
                Found in zul/src/main/java/org/zkoss/zul/Rows.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

                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/Rows.java - About 45 mins to fix

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

                      /*package*/ int[] getGroupsInfoAt(int index, boolean isGroup) {
                          for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext();) {
                              int[] g = it.next();
                              if (isGroup) {
                                  if (index == g[0])
                  Severity: Minor
                  Found in zul/src/main/java/org/zkoss/zul/Rows.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 (realIndex >= 0 && realIndex < getChildren().size())
                                              removeChild(getChildren().get(realIndex));
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (actpg > maxPageIndex) {
                                                p.setActivePage(maxPageIndex);
                                            }
                    Severity: Major
                    Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 45 mins to fix

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

                          private void fixRowIndices(int j, int to) {
                              int realj = getRealIndex(j);
                              if (realj < 0)
                                  realj = 0;
                              List items = getChildren();
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/Rows.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/Rows.java and 1 other location - About 3 hrs to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1595..1608

                      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

                      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/Rows.java and 1 other location - About 2 hrs to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1952..1971

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

                                      if ((!infront || beginning != j) && o instanceof Group) {
                                          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/Rows.java and 1 other location - About 1 hr to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1548..1555

                      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 (hasGroup()) {
                                  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/Rows.java and 1 other location - About 1 hr to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2190..2198

                      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

                                          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/Rows.java and 1 other location - About 1 hr to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1447..1454

                      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]--;
                                          fixGroupIndex(index, -1, false);
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/Rows.java and 1 other location - About 1 hr to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2228..2234

                      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

                                  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/Rows.java and 1 other location - About 55 mins to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1979..1986

                      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 (isReorder) {
                                          final int idx = newItem.getIndex();
                                          final int[] ginfo = getGroupsInfoAt(idx);
                                          if (ginfo != null) {
                                              ginfo[1]--;
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/Rows.java and 1 other location - About 50 mins to fix
                      zul/src/main/java/org/zkoss/zul/Rows.java on lines 414..421

                      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/Rows.java and 1 other location - About 50 mins to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1634..1643

                      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

                                      if (isReorder) {
                                          final int nindex = newItem.getIndex();
                                          final int[] ginfo = getGroupsInfoAt(nindex);
                                          if (ginfo != null) {
                                              ginfo[1]--;
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/Rows.java and 1 other location - About 50 mins to fix
                      zul/src/main/java/org/zkoss/zul/Rows.java on lines 394..401

                      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

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

                      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/Rows.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/Listbox.java on lines 483..489

                      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/Rows.java and 1 other location - About 45 mins to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3296..3300

                      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 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/Rows.java and 1 other location - About 40 mins to fix
                      zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2183..2183

                      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

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

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

                      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

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

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 42.

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

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

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

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

                      Refactorings

                      Further Reading

                      There are no issues that match your filters.

                      Category
                      Status