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

Summary

Maintainability
F
5 days
Test Coverage

File ListModelMap.java has 642 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ListModelMap.java

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

    Method removePartial has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        @SuppressWarnings("unchecked")
        private boolean removePartial(Collection<?> master, Collection<?> c, boolean isRemove, boolean byKey,
                boolean byValue) {
            int sz = c.size();
            int removed = 0;
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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

    ListModelMap has 31 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class ListModelMap<K, V> extends AbstractListModel<Map.Entry<K, V>>
            implements Sortable<Map.Entry<K, V>>, Map<K, V>, java.io.Serializable {
        private static final long serialVersionUID = 20120206122736L;
    
        protected Map<K, V> _map;
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 3 hrs to fix

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

          public void putAll(Map<? extends K, ? extends V> c) {
              if (c == _map) //special case
                  return;
      
              if (_map instanceof LinkedHashMap) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 removePartial has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @SuppressWarnings("unchecked")
          private boolean removePartial(Collection<?> master, Collection<?> c, boolean isRemove, boolean byKey,
                  boolean byValue) {
              int sz = c.size();
              int removed = 0;
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 1 hr to fix

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

                public final boolean equals(Object o) {
                    if (_entry != null)
                        return _entry.equals(o);
        
                    if (!(o instanceof Map.Entry))
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 putAll has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void putAll(Map<? extends K, ? extends V> c) {
                if (c == _map) //special case
                    return;
        
                if (_map instanceof LinkedHashMap) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 1 hr to fix

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

              private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
                  s.defaultReadObject();
          
                  //the performance is bad, but no better algorithm
                  @SuppressWarnings("rawtypes")
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 put has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public V put(K key, V o) {
                  final V ret;
                  if (_map.containsKey(key)) {
                      if (Objects.equals(o, _map.get(key))) {
                          return o; //nothing changed
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 removeAll has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

                  public boolean removeAll(Collection<?> c) {
                      if (_set == c || this == c) { //special case
                          clear();
                          return true;
                      }
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

                  public boolean remove(Object o) {
                      //bug #1819318 Problem while using SortedSet with Databinding
                      if (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
                          int index = indexOfAndRemove(o);
                          if (index < 0) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

                  public boolean removeAll(Collection<?> c) {
                      if (_col == c || this == c) { //special case
                          clearSelection();
                          clear();
                          return true;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

                  public boolean retainAll(Collection<?> c) {
                      if (_set == c || this == c) { //special case
                          return false;
                      }
                      //bug #1819318 Problem while using SortedSet with Databinding
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

                  public boolean retainAll(Collection<?> c) {
                      if (_col == c || this == c) { //special case
                          return false;
                      }
                      //bug #1819318 Problem while using SortedSet with Databinding
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

              private boolean removePartial(Collection<?> master, Collection<?> c, boolean isRemove, boolean byKey,
                      boolean byValue) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 35 mins to fix

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

                public V remove(Object key) {
                    if (_map.containsKey(key)) {
                        //bug #1819318 Problem while using SortedSet with Databinding
                        V ret = null;
                        removeSelectionByKey(key);
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    public boolean remove(Object o) {
                        boolean ret = false;
                        if (_set.contains(o)) {
                            //bug #1819318 Problem while using SortedSet with Databinding
                            removeFromSelection(o);
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 writeObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    private void writeObject(java.io.ObjectOutputStream s) throws IOException {
                        s.defaultWriteObject();
                        if (_entry != null) {
                            s.writeObject(_entry.getKey());
                            s.writeObject(_entry.getValue());
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                    public boolean remove(Object o) {
                        boolean ret = false;
                        if (_set.contains(o)) {
                            //bug #1819318 Problem while using SortedSet with Databinding
                            removeFromSelection(o);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/ListModelSet.java on lines 283..298

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

            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 (_map instanceof LinkedHashMap) {
                            //bug 1869614 Problem when switching from ListModelList to ListModelMap, 
                            //java.lang.IndexOutOfBoundsException: 1, interval added index should be _map.size() - 1
                            final int i1 = _map.size() - 1;
                            fireEvent(ListDataEvent.INTERVAL_ADDED, i1, i1);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/ListModelSet.java on lines 169..180

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 82.

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

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

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

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

            Refactorings

            Further Reading

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

                        if (k1 == k2 || (k1 != null && k1.equals(k2))) {
                            Object v1 = getValue();
                            Object v2 = e.getValue();
                            if (v1 == v2 || (v1 != null && v1.equals(v2)))
                                return true;
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
            zcommon/src/main/java/org/zkoss/util/FilterMap.java on lines 148..153

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

            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 (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
                            return removePartial(_col, c, true, false, true);
                        } else { //bug #1839634 Problem while using HashSet with Databinding
                            removeAllSelection(c);
                            final boolean ret = _col.removeAll(c);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 808..817

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

            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 (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
                            return removePartial(_col, c, false, false, true);
                        } else { //bug #1839634 Problem while using HashSet with Databinding
                            retainAllSelection(c);
                            final boolean ret = _col.retainAll(c);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 791..800

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

            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 (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
                            return removePartial(_set, c, true, _keyset, false);
                        } else { //bug #1839634 Problem while using HashSet with Databinding
                            removeAllSelection(c);
                            final boolean ret = _set.removeAll(c);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 589..598

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

            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 (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
                            return removePartial(_set, c, false, _keyset, false);
                        } else { //bug #1839634 Problem while using HashSet with Databinding
                            retainAllSelection(c);
                            final boolean ret = _set.retainAll(c);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 572..581

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

            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 indexOf(Object o) {
                    int j = 0;
                    for (Iterator<?> it = _map.entrySet().iterator(); it.hasNext(); ++j) {
                        if (Objects.equals(o, it.next()))
                            return j;
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 45 mins to fix
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 301..308

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 56.

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

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

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

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

            Refactorings

            Further Reading

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

                public int indexOfKey(Object o) {
                    int j = 0;
                    for (Iterator<K> it = _map.keySet().iterator(); it.hasNext(); ++j) {
                        if (Objects.equals(o, it.next()))
                            return j;
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 45 mins to fix
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 315..322

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

                        } else {
                            ++retained;
                            if (begin >= 0) {
                                fireEvent(ListDataEvent.INTERVAL_REMOVED, begin, index - 1);
                                index = begin; //this range removed, the index is reset to begin
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/ListModelSet.java on lines 371..378

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 52.

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

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

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

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

            Refactorings

            Further Reading

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

                    public void clear() {
                        int i2 = _col.size() - 1;
                        if (i2 < 0) {
                            return;
                        }
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 4 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/ListModelList.java on lines 212..220
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 218..226
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 536..544
            zul/src/main/java/org/zkoss/zul/ListModelSet.java on lines 216..224

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

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

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

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

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

            Refactorings

            Further Reading

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

                public void clear() {
                    int i2 = _map.size() - 1;
                    if (i2 < 0) {
                        return;
                    }
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 4 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/ListModelList.java on lines 212..220
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 536..544
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 742..750
            zul/src/main/java/org/zkoss/zul/ListModelSet.java on lines 216..224

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

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

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

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

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

            Refactorings

            Further Reading

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

                    public void clear() {
                        int i2 = _set.size() - 1;
                        if (i2 < 0) {
                            return;
                        }
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 4 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/ListModelList.java on lines 212..220
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 218..226
            zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 742..750
            zul/src/main/java/org/zkoss/zul/ListModelSet.java on lines 216..224

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

            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