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

Summary

Maintainability
F
6 days
Test Coverage

File AbstractTreeModel.java has 684 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* AbstractTreeModel.java

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

    AbstractTreeModel has 71 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public abstract class AbstractTreeModel<E> implements TreeModel<E>, TreeSelectableModel, TreeOpenableModel,
            Selectable<E>, Openable<E>, java.io.Serializable, PageableModel {
    
        private static final Logger log = LoggerFactory.getLogger(AbstractTreeModel.class);
    
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 1 day to fix

      Method addSelectionPaths has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean addSelectionPaths(int[][] paths) {
              boolean added = false;
              final int len = paths != null ? paths.length : 0;
              final boolean multiple = isMultiple();
              for (int j = 0; j < len; ++j)
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 getPageCount has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public int getPageCount() {
              if (_pageCount < 1) { // dirty/invalid value, re-calculation required
                  if (_root != null) {
                      int count = getTotalSize();
                      // no child or _pageSize is still default value -1, return one page anyway
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 setPageSize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public void setPageSize(int size) throws WrongValueException {
              if (size < 0) {
                  throw new WrongValueException("expecting positive non zero value, got: " + size);
              }
              
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 verifyPrefix has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

              private boolean verifyPrefix(int[] path, int update) {
                  if (path.length > this.path.length)
                      return false;
                  int i = 0;
                  for (; i < path.length; i++) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 setActivePage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public void setActivePage(int pg) throws WrongValueException {
              if (pg < 0) {
                  throw new WrongValueException("expecting positive non zero value, got: " + pg);
              }
              if (pg > 0) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 fireEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void fireEvent(int evtType, int[] path, int indexFrom, int indexTo, int[][] affectedPaths) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 35 mins to fix

        Method fireEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public void fireEvent(int evtType, int[] path, int indexFrom, int indexTo, int[] affectedPath) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 35 mins to fix

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

              public void setMultiple(boolean multiple) {
                  if (_multiple != multiple) {
                      _multiple = multiple;
                      fireEvent(TreeDataEvent.MULTIPLE_CHANGED, null, -1, -1);
          
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 setSelectAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                  public void setSelectAll(boolean selectAll) {
                      if (selectAll) {
                          List<E> all = new LinkedList<>();
                          List<E> allNodes = model.getAllNodes();
                          for (E o : allNodes) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 addOpenPaths has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public boolean addOpenPaths(int[][] paths) {
                  boolean added = false;
                  final int len = paths != null ? paths.length : 0;
                  for (int j = 0; j < len; ++j) {
                      if (paths[j] != null) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 removeSelectionPaths has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public boolean removeSelectionPaths(int[][] paths) {
                  boolean found = false;
                  final int len = paths != null ? paths.length : 0;
                  for (int j = 0; j < len && !_selection.isEmpty(); ++j) {
                      final Path path = new Path(paths[j]);
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 clearSelection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public void clearSelection() {
                  if (!_selection.isEmpty()) {
                      final int[][] paths = getSelectionPaths();
                      if (paths != null) {
                          _selection.clear();
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 getChild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public E getChild(int[] path) {
                  E node = getRoot();
                  for (int childCount = 0, i = 0; i < path.length && node != null; i++) {
                      if (path[i] < 0 || path[i] > (childCount = getChildCountOptimized(node)))
                          return null;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 clearOpen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public void clearOpen() {
                  if (!_opens.isEmpty()) {
                      final int[][] paths = getOpenPaths();
                      if (paths != null) {
                          _opens.clear();
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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

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

              public void clearOpen() {
                  if (!_opens.isEmpty()) {
                      final int[][] paths = getOpenPaths();
                      if (paths != null) {
                          _opens.clear();
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 426..435

          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

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

              public void clearSelection() {
                  if (!_selection.isEmpty()) {
                      final int[][] paths = getSelectionPaths();
                      if (paths != null) {
                          _selection.clear();
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 512..521

          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

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

              public int[][] getSelectionPaths() {
                  if (_selection.isEmpty())
                      return null;
          
                  final int[][] paths = new int[_selection.size()][];
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 493..502

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 65.

          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 Set<E> getOpenObjects() {
                  final Set<E> opened = new LinkedHashSet<E>();
                  int[][] paths = getOpenPaths();
                  if (paths != null)
                      for (int i = 0; i < paths.length; i++)
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 558..565

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

          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 Set<E> getSelection() {
                  final Set<E> selected = new LinkedHashSet<E>();
                  int[][] paths = getSelectionPaths();
                  if (paths != null)
                      for (int i = 0; i < paths.length; i++)
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 612..619

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

          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 int[][] getOpenPaths() {
                  if (_opens.isEmpty())
                      return null;
          
                  final int[][] paths = new int[_opens.size()][];
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 407..416

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

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

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

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

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

          Refactorings

          Further Reading

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

              public boolean removeSelectionPath(int[] path) {
                  if (path != null && path.length > 0) {
                      final int[][] paths = new int[1][path.length];
                      paths[0] = path;
                      return removeSelectionPaths(paths);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 341..348
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 439..446
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 463..470

          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

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

              public boolean addOpenPath(int[] path) {
                  if (path != null && path.length > 0) {
                      final int[][] paths = new int[1][path.length];
                      paths[0] = path;
                      return addOpenPaths(paths);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 341..348
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 375..382
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 463..470

          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

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

              public boolean addSelectionPath(int[] path) {
                  if (path != null && path.length > 0) {
                      final int[][] paths = new int[1][path.length];
                      paths[0] = path;
                      return addSelectionPaths(paths);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 375..382
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 439..446
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 463..470

          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

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

              public boolean removeOpenPath(int[] path) {
                  if (path != null && path.length > 0) {
                      final int[][] paths = new int[1][path.length];
                      paths[0] = path;
                      return removeOpenPaths(paths);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 341..348
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 375..382
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 439..446

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

                  for (PagingListener p : _pagingListeners) {
                      try {
                          p.onEvent(new PagingEvent(PageableModel.INTERNAL_EVENT, null, this, _activePage));
                      } catch (Exception e) {
                          log.warn("Failed to publish internal paging event", e);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 365..371
          zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 403..409
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 913..919

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

                  for (PagingListener p : _pagingListeners) {
                      try {
                          p.onEvent(new PagingEvent(PageableModel.INTERNAL_EVENT, null, this, pg));
                      } catch (Exception e) {
                          log.warn("Failed to publish internal paging event", e);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 365..371
          zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 403..409
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 820..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 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

              private boolean isSelectionChanged(Collection<? extends E> selection) {
                  if (_selection.size() != selection.size())
                      return true;
          
                  for (final E e : selection)
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 113..121

          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

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

              @SuppressWarnings("unchecked")
          
              public boolean isSelected(Object child) {
                  final int[] path = getPath((E) child);
                  if (path != null && path.length > 0)
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 601..608
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 627..634
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 643..650

          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

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

              @SuppressWarnings("unchecked")
          
              public boolean removeFromSelection(Object child) {
                  final int[] path = getPath((E) child);
                  if (path != null && path.length > 0)
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 585..592
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 627..634
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 643..650

          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

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

              @SuppressWarnings("unchecked")
          
              public boolean isObjectOpened(Object child) {
                  final int[] path = getPath((E) child);
                  if (path != null && path.length > 0)
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 585..592
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 601..608
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 643..650

          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

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

              @SuppressWarnings("unchecked")
          
              public boolean removeOpenObject(Object child) {
                  final int[] path = getPath((E) child);
                  if (path != null && path.length > 0)
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 585..592
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 601..608
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 627..634

          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

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

              public void fireEvent(int evtType, int[] path, int indexFrom, int indexTo, int[][] affectedPaths) {
                  final TreeDataEvent evt = new TreeDataEvent(this, evtType, path, indexFrom, indexTo, affectedPaths);
                  for (TreeDataListener l : _listeners)
                      l.onChange(evt);
              }
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 192..196

          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

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

              public void fireEvent(int evtType, int[] path, int indexFrom, int indexTo, int[] affectedPath) {
                  final TreeDataEvent evt = new TreeDataEvent(this, evtType, path, indexFrom, indexTo, affectedPath);
                  for (TreeDataListener l : _listeners)
                      l.onChange(evt);
              }
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 35 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 204..208

          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

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

                      if (paths[j] != null) {
                          final Path path = new Path(paths[j]);
                          if (_opens.add(path)) {
                              added = true;
                              fireOpenChanged(path.path);
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 475..481

          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

              public boolean addOpenObject(E child) {
                  final int[] path = getPath(child);
                  if (path != null && path.length > 0)
                      return addOpenPath(path);
                  return false;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 594..599

          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

                  for (int j = 0; j < len && !_opens.isEmpty(); ++j) {
                      final Path path = new Path(paths[j]);
                      if (_opens.remove(path)) {
                          found = true;
                          fireOpenChanged(path.path);
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 452..458

          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

              public boolean addToSelection(E child) {
                  final int[] path = getPath(child);
                  if (path != null && path.length > 0)
                      return addSelectionPath(path);
                  return false;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 636..641

          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

              public void fireEvent(int evtType, int[] path, int indexFrom, int indexTo) {
                  final TreeDataEvent evt = new TreeDataEvent(this, evtType, path, indexFrom, indexTo);
                  for (TreeDataListener l : _listeners)
                      l.onChange(evt);
              }
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractGroupsModel.java on lines 69..73

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

          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

              protected void fireSelectionChanged(int[] path) {
                  final TreeDataEvent evt = new TreeDataEvent(this, TreeDataEvent.SELECTION_CHANGED, path, 0, 1);
                  for (TreeDataListener l : _listeners)
                      l.onChange(evt);
              }
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 228..232

          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

              protected void fireOpenChanged(int[] path) {
                  final TreeDataEvent evt = new TreeDataEvent(this, TreeDataEvent.OPEN_CHANGED, path, 0, 1);
                  for (TreeDataListener l : _listeners)
                      l.onChange(evt);
              }
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 216..220

          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