zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java

Summary

Maintainability
F
1 wk
Test Coverage

File KeyFactory.java has 589 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 *  Copyright 2004 Brian S O'Neill
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 1 day to fix

    KeyFactory has 33 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @SuppressWarnings("unchecked")
    class KeyFactory {
        static final Object NULL = new Comparable() {
            public int compareTo(Object obj) {
                return obj == this || obj == null ? 0 : 1;
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 4 hrs to fix

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

          static boolean equals(Object a, Object b) {
              if (a == b) {
                  return true;
              }
              if (a == null || b == null) {
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          static int hashCode(Object a) {
              if (a == null) {
                  return -1;
              }
              if (!a.getClass().isArray()) {
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method compare has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          static int compare(Object a, Object b) {
              if (a == b) {
                  return 0;
              }
              if (a == null) {
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method createKey has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public static Object createKey(Object obj) {
              if (obj == null) {
                  return NULL;
              }
              if (!obj.getClass().isArray()) {
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 compare has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          static int compare(Object a, Object b) {
              if (a == b) {
                  return 0;
              }
              if (a == null) {
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 1 hr to fix

        Method equals has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static boolean equals(Object a, Object b) {
                if (a == b) {
                    return true;
                }
                if (a == null || b == null) {
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 1 hr to fix

          Method hashCode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static int hashCode(Object a) {
                  if (a == null) {
                      return -1;
                  }
                  if (!a.getClass().isArray()) {
          Severity: Minor
          Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 1 hr to fix

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

                static int compare(double[] a, double[] b) {
                    if (a == b) {
                        return 0;
                    }
                    if (a == null) {
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 compare has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                static int compare(float[] a, float[] b) {
                    if (a == b) {
                        return 0;
                    }
                    if (a == null) {
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 compare has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                static int compare(boolean[] a, boolean[] b) {
                    if (a == b) {
                        return 0;
                    }
                    if (a == null) {
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 createKey has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static Object createKey(Object obj) {
                    if (obj == null) {
                        return NULL;
                    }
                    if (!obj.getClass().isArray()) {
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 1 hr to fix

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

                  static int compare(Object[] a, Object[] b) {
                      if (a == b) {
                          return 0;
                      }
                      if (a == null) {
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  static boolean equals(Object[] a, Object[] b) {
                      if (a == b) {
                          return true;
                      }
                      if (a == null || b == null) {
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Avoid too many return statements within this method.
              Open

                          return hashCode((boolean[]) a);
              Severity: Major
              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return Arrays.equals((double[]) a, (double[]) b);
                Severity: Major
                Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return Arrays.equals((long[]) a, (long[]) b);
                  Severity: Major
                  Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return Arrays.equals((int[]) a, (int[]) b);
                    Severity: Major
                    Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return createKey((double[]) obj);
                      Severity: Major
                      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return createKey((int[]) obj);
                        Severity: Major
                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return Arrays.equals((char[]) a, (char[]) b);
                          Severity: Major
                          Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return true;
                            Severity: Major
                            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return equals((Object[]) a, (Object[]) b);
                              Severity: Major
                              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return Integer.compare(a.length, b.length);
                                Severity: Major
                                Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return createKey((long[]) obj);
                                  Severity: Major
                                  Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return Arrays.equals((float[]) a, (float[]) b);
                                    Severity: Major
                                    Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return hashCode((double[]) a);
                                      Severity: Major
                                      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return Arrays.equals((boolean[]) a, (boolean[]) b);
                                        Severity: Major
                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return createKey((byte[]) obj);
                                          Severity: Major
                                          Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                        return createKey((Object[]) obj);
                                            Severity: Major
                                            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return hashCode((float[]) a);
                                              Severity: Major
                                              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                            return hashCode((Object[]) a);
                                                Severity: Major
                                                Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return createKey((boolean[]) obj);
                                                  Severity: Major
                                                  Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                return hashCode((char[]) a);
                                                    Severity: Major
                                                    Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return hashCode((int[]) a);
                                                      Severity: Major
                                                      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return Arrays.equals((byte[]) a, (byte[]) b);
                                                        Severity: Major
                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                      return hashCode((byte[]) a);
                                                          Severity: Major
                                                          Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                        return hashCode((long[]) a);
                                                            Severity: Major
                                                            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                          return createKey((char[]) obj);
                                                              Severity: Major
                                                              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                            return createKey((float[]) obj);
                                                                Severity: Major
                                                                Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                              return a.equals(b);
                                                                  Severity: Major
                                                                  Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                return Arrays.equals((short[]) a, (short[]) b);
                                                                    Severity: Major
                                                                    Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                              return Integer.compare(a.length, b.length);
                                                                      Severity: Major
                                                                      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                    return compare((long[]) a, (long[]) b);
                                                                        Severity: Major
                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                  return a.length < b.length ? -1 : (a.length > b.length ? 1 : 0);
                                                                          Severity: Major
                                                                          Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                    return Integer.compare(a.length, b.length);
                                                                            Severity: Major
                                                                            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                          return compare((boolean[]) a, (boolean[]) b);
                                                                              Severity: Major
                                                                              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                        return Integer.compare(a.length, b.length);
                                                                                Severity: Major
                                                                                Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                              return compare((byte[]) a, (byte[]) b);
                                                                                  Severity: Major
                                                                                  Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                            return Integer.compare(a.length, b.length);
                                                                                    Severity: Major
                                                                                    Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                  return compare((float[]) a, (float[]) b);
                                                                                      Severity: Major
                                                                                      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                return Integer.compare(a.length, b.length);
                                                                                        Severity: Major
                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                      return compare((short[]) a, (short[]) b);
                                                                                          Severity: Major
                                                                                          Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                    return a.length < b.length ? -1 : (a.length > b.length ? 1 : 0);
                                                                                            Severity: Major
                                                                                            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                          return compare((int[]) a, (int[]) b);
                                                                                              Severity: Major
                                                                                              Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                            return compare((Object[]) a, (Object[]) b);
                                                                                                Severity: Major
                                                                                                Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                          return Integer.compare(a.length, b.length);
                                                                                                  Severity: Major
                                                                                                  Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                                return compare((char[]) a, (char[]) b);
                                                                                                    Severity: Major
                                                                                                    Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

                                                                                                      Avoid too many return statements within this method.
                                                                                                      Open

                                                                                                                  return compare((double[]) a, (double[]) b);
                                                                                                      Severity: Major
                                                                                                      Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 30 mins to fix

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

                                                                                                            static int compare(long[] a, long[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Minor
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                            static int compare(char[] a, char[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Minor
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                            static int compare(byte[] a, byte[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Minor
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                            static int compare(short[] a, short[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Minor
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                            static int compare(int[] a, int[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Minor
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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

                                                                                                            static int compare(double[] a, double[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 1 other location - About 2 hrs to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 344..362

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

                                                                                                        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

                                                                                                            static int compare(float[] a, float[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 1 other location - About 2 hrs to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 324..342

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int compare(short[] a, short[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 4 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 286..303
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 305..322
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 364..381
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 383..400

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int compare(byte[] a, byte[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 4 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 305..322
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 364..381
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 383..400
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 402..419

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int compare(int[] a, int[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 4 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 286..303
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 305..322
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 383..400
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 402..419

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int compare(char[] a, char[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 4 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 286..303
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 364..381
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 383..400
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 402..419

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int compare(long[] a, long[] b) {
                                                                                                                if (a == b) {
                                                                                                                    return 0;
                                                                                                                }
                                                                                                                if (a == null) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 4 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 286..303
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 305..322
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 364..381
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 402..419

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

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

                                                                                                            private static class FloatArrayKey implements ArrayKey {
                                                                                                                protected final float[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                FloatArrayKey(float[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class IntArrayKey implements ArrayKey {
                                                                                                                protected final int[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                IntArrayKey(int[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class BooleanArrayKey implements ArrayKey {
                                                                                                                protected final boolean[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                BooleanArrayKey(boolean[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class LongArrayKey implements ArrayKey {
                                                                                                                protected final long[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                LongArrayKey(long[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class ShortArrayKey implements ArrayKey {
                                                                                                                protected final short[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                ShortArrayKey(short[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class CharArrayKey implements ArrayKey {
                                                                                                                protected final char[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                CharArrayKey(char[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class DoubleArrayKey implements ArrayKey {
                                                                                                                protected final double[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                DoubleArrayKey(double[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class ByteArrayKey implements ArrayKey {
                                                                                                                protected final byte[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                ByteArrayKey(byte[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 678..700

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

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

                                                                                                            private static class ObjectArrayKey implements ArrayKey {
                                                                                                                protected final Object[] mArray;
                                                                                                                private transient int mHash;
                                                                                                        
                                                                                                                ObjectArrayKey(Object[] array) {
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 8 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 494..515
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 517..538
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 540..561
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 563..584
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 586..607
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 609..630
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 632..653
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 655..676

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int hashCode(short[] a) {
                                                                                                                int hash = 0;
                                                                                                                for (int i = a.length; --i >= 0;) {
                                                                                                                    hash = (hash << 1) + a[i];
                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 2 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 119..125
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 144..150

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int hashCode(int[] a) {
                                                                                                                int hash = 0;
                                                                                                                for (int i = a.length; --i >= 0;) {
                                                                                                                    hash = (hash << 1) + a[i];
                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 2 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 119..125
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 161..167

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            static int hashCode(char[] a) {
                                                                                                                int hash = 0;
                                                                                                                for (int i = a.length; --i >= 0;) {
                                                                                                                    hash = (hash << 1) + a[i];
                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java and 2 other locations - About 1 hr to fix
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 144..150
                                                                                                        zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java on lines 161..167

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

                                                                                                        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