zcommon/src/main/java/org/zkoss/lang/Objects.java

Summary

Maintainability
F
1 wk
Test Coverage

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

    public static final boolean equals(Object a, Object b) {
        if (a == b || (a != null && b != null && a.equals(b)))
            return true;
        if ((a instanceof BigDecimal) && (b instanceof BigDecimal))
            return ((BigDecimal)a).compareTo((BigDecimal) b) == 0;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

Method toString has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String toString(Object o) {
        if (o == null) return null;
        if (o instanceof Date) return DateFormats.format((Date)o, false);
        if (o instanceof Class) {
            final Class cls = (Class)o;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 5 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

    public static final boolean equals(Object a, Object b) {
        if (a == b || (a != null && b != null && a.equals(b)))
            return true;
        if ((a instanceof BigDecimal) && (b instanceof BigDecimal))
            return ((BigDecimal)a).compareTo((BigDecimal) b) == 0;
Severity: Major
Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 3 hrs to fix

    File Objects.java has 265 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Objects.java
    
    
        Purpose: Utilities related to Object.
        Description:
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 2 hrs to fix

      Method toString has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static final String toString(Object o) {
              if (o == null) return null;
              if (o instanceof Date) return DateFormats.format((Date)o, false);
              if (o instanceof Class) {
                  final Class cls = (Class)o;
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 1 hr to fix

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

            public static final Object clone(Object o) {
                if (o == null)
                    return o;
        
                try {
        Severity: Minor
        Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 55 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Avoid too many return statements within this method.
        Open

                            return false;
        Severity: Major
        Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return false;
          Severity: Major
          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return ArraysX.toString((char[])o);
            Severity: Major
            Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

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

                Avoid too many return statements within this method.
                Open

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

                  Avoid too many return statements within this method.
                  Open

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

                    Avoid too many return statements within this method.
                    Open

                                    return ArraysX.toString((byte[])o);
                    Severity: Major
                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return false;
                      Severity: Major
                      Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                            return false;
                        Severity: Major
                        Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return ArraysX.toString((short[])o);
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                return false;
                            Severity: Major
                            Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return false;
                              Severity: Major
                              Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return ArraysX.toString((Object[])o);
                                Severity: Major
                                Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                      return false;
                                  Severity: Major
                                  Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return (o.toString()).toCharArray();
                                    Severity: Major
                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                      return false;
                                      Severity: Major
                                      Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                        return false;
                                        Severity: Major
                                        Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                              return false;
                                          Severity: Major
                                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                                return false;
                                            Severity: Major
                                            Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

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

                                                Avoid too many return statements within this method.
                                                Open

                                                                return ArraysX.toString((double[])o);
                                                Severity: Major
                                                Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                      return false;
                                                  Severity: Major
                                                  Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                            return o.toString();
                                                    Severity: Major
                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

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

                                                        Avoid too many return statements within this method.
                                                        Open

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

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                              return false;
                                                          Severity: Major
                                                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                            return false;
                                                            Severity: Major
                                                            Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                              return ArraysX.toString((int[])o);
                                                              Severity: Major
                                                              Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

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

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                          return false;
                                                                  Severity: Major
                                                                  Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                    return false;
                                                                    Severity: Major
                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                      return false;
                                                                      Severity: Major
                                                                      Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                        return ArraysX.toString((long[])o);
                                                                        Severity: Major
                                                                        Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

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

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                            return false;
                                                                            Severity: Major
                                                                            Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

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

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                return ArraysX.toString((boolean[])o);
                                                                                Severity: Major
                                                                                Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                                  return ArraysX.toString((float[])o);
                                                                                  Severity: Major
                                                                                  Found in zcommon/src/main/java/org/zkoss/lang/Objects.java - About 30 mins to fix

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

                                                                                        public static final char[] toCharArray(Object o) {
                                                                                            if (o == null)
                                                                                                return null;
                                                                                            if (o instanceof char[])
                                                                                                return (char[])o;
                                                                                    Severity: Minor
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.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

                                                                                            if (o.getClass().isArray()) {
                                                                                                if (o instanceof Object[])
                                                                                                    return ArraysX.toString((Object[])o);
                                                                                                if (o instanceof int[])
                                                                                                    return ArraysX.toString((int[])o);
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 1 other location - About 2 hrs to fix
                                                                                    zcommon/src/main/java/org/zkoss/json/JSONValue.java on lines 105..124

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

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof double[]) && (b instanceof double[])) {
                                                                                                final double[] as = (double[])a;
                                                                                                final double[] bs = (double[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 1 other location - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 279..288

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 102.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof float[]) && (b instanceof float[])) {
                                                                                                final float[] as = (float[])a;
                                                                                                final float[] bs = (float[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 1 other location - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 269..278

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 102.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof byte[]) && (b instanceof byte[])) {
                                                                                                final byte[] as = (byte[])a;
                                                                                                final byte[] bs = (byte[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof char[]) && (b instanceof char[])) {
                                                                                                final char[] as = (char[])a;
                                                                                                final char[] bs = (char[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof long[]) && (b instanceof long[])) {
                                                                                                final long[] as = (long[])a;
                                                                                                final long[] bs = (long[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof boolean[]) && (b instanceof boolean[])) {
                                                                                                final boolean[] as = (boolean[])a;
                                                                                                final boolean[] bs = (boolean[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof int[]) && (b instanceof int[])) {
                                                                                                final int[] as = (int[])a;
                                                                                                final int[] bs = (int[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                            if ((a instanceof short[]) && (b instanceof short[])) {
                                                                                                final short[] as = (short[])a;
                                                                                                final short[] bs = (short[])b;
                                                                                                if (as.length != bs.length)
                                                                                                    return false;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                        public static final int hashCode(char[] v) {
                                                                                            int h = 1; //not to return 0 if possible, so caller cache it easily
                                                                                            for (int j=v.length; --j>=0;)
                                                                                                h = nextHashCode(h, v[j]);
                                                                                            return h;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 3 other locations - About 40 mins to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 110..115
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 151..156
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 164..169

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 50.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                        public static final int hashCode(int[] v) {
                                                                                            int h = 1; //not to return 0 if possible, so caller cache it easily
                                                                                            for (int j=v.length; --j>=0;)
                                                                                                h = nextHashCode(h, v[j]);
                                                                                            return h;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 3 other locations - About 40 mins to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 110..115
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 138..143
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 151..156

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 50.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                        public static final int hashCode(short[] v) {
                                                                                            int h = 1; //not to return 0 if possible, so caller cache it easily
                                                                                            for (int j=v.length; --j>=0;)
                                                                                                h = nextHashCode(h, v[j]);
                                                                                            return h;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 3 other locations - About 40 mins to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 110..115
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 138..143
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 164..169

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 50.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

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

                                                                                        public static final int hashCode(byte[] v) {
                                                                                            int h = 1; //not to return 0 if possible, so caller cache it easily
                                                                                            for (int j=v.length; --j>=0;)
                                                                                                h = nextHashCode(h, v[j]);
                                                                                            return h;
                                                                                    Severity: Major
                                                                                    Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 3 other locations - About 40 mins to fix
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 138..143
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 151..156
                                                                                    zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 164..169

                                                                                    Duplicated Code

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

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

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

                                                                                    Tuning

                                                                                    This issue has a mass of 50.

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

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

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

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

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    There are no issues that match your filters.

                                                                                    Category
                                                                                    Status