Showing 7,775 of 7,775 total issues

Consider simplifying this complex logical expression.
Open

            if (((cc < '0' || cc > '9') && cc != '-' && cc != '+')
                || (j && (cc == '-' || cc == '+')))
                if (jdot < 0 && cc == '.') {
                    jdot = j;
                } else {
Severity: Major
Found in zk/src/main/resources/web/js/zk/math.ts - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (!wnd) {
                const wnd = new zul.wnd.Window({
                        id: 'aualert',
                        closable: true,
                        sclass: 'z-messagebox-window',
    Severity: Major
    Found in zul/src/main/resources/web/js/zul/dom.ts - About 1 hr to fix

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

              } else if (o instanceof long[]) {
                  if (element instanceof Number) {
                      long v = ((Number)element).longValue();
                      final long[] ary = (long[])o;
                      for (int j = 0; j < ary.length; j++)
      Severity: Major
      Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java and 3 other locations - About 1 hr to fix
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 212..220
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 204..212
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 188..196

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 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

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

          public boolean equals(Object o) {
              if (this == o)
                  return true;
              if (!(o instanceof TreeitemComparator))
                  return false;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/TreeitemComparator.java and 2 other locations - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/ListitemComparator.java on lines 277..284
      zul/src/main/java/org/zkoss/zul/RowComparator.java on lines 202..209

      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

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

          public boolean equals(Object o) {
              if (this == o)
                  return true;
              if (!(o instanceof RowComparator))
                  return false;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/RowComparator.java and 2 other locations - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/ListitemComparator.java on lines 277..284
      zul/src/main/java/org/zkoss/zul/TreeitemComparator.java on lines 273..280

      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

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

          public boolean equals(Object o) {
              if (this == o)
                  return true;
              if (!(o instanceof ListitemComparator))
                  return false;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/ListitemComparator.java and 2 other locations - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/RowComparator.java on lines 202..209
      zul/src/main/java/org/zkoss/zul/TreeitemComparator.java on lines 273..280

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

              } else if (o instanceof int[]) {
                  if (element instanceof Number) {
                      int v = ((Number)element).intValue();
                      final int[] ary = (int[])o;
                      for (int j = 0; j < ary.length; j++)
      Severity: Major
      Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java and 3 other locations - About 1 hr to fix
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 212..220
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 204..212
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 196..204

      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

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

              for (Map.Entry<K, V> me : _cache.entrySet()) {
                  V value = me.getValue();
                  if (value instanceof FormProxyObject) {
                      FormProxyObject proxyValue = (FormProxyObject) value;
                      proxyValue.submitToOrigin(ctx);
      Severity: Major
      Found in zkbind/src/main/java/org/zkoss/bind/proxy/MapProxy.java and 1 other location - About 1 hr to fix
      zkbind/src/main/java/org/zkoss/bind/proxy/ListModelMapProxy.java on lines 351..360

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

              } else if (o instanceof short[]) {
                  if (element instanceof Number) {
                      short v = ((Number)element).shortValue();
                      final short[] ary = (short[])o;
                      for (int j = 0; j < ary.length; j++)
      Severity: Major
      Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java and 3 other locations - About 1 hr to fix
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 212..220
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 196..204
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 188..196

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 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

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

                              if (ZKBIND1_ANNO.equals(nm) || ZKBIND2_ANNO.equals(nm) || BIND_ANNO.equals(nm)
                                      || LOAD_ANNO.equals(nm) || SAVE_ANNO.equals(nm) || VALIDATOR_ANNO.equals(nm)
                                      || REFERENCE_ANNO.equals(nm) || CONVERTER_ANNO.equals(nm) || TEMPLATE_ANNO.equals(nm)
      zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 88..90

      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

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

                  if (codepoint > (ESCAPE_LEVELS_LEN - 2) && level < ESCAPE_LEVELS[ESCAPE_LEVELS_LEN - 1] &&
                          codepoint != '\u2028' && codepoint != '\u2029') {
      
                      if (Character.charCount(codepoint) > 1) {
                          // This is to compensate that we are actually escaping two char[] positions with a single codepoint.
      zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java on lines 420..430

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

              } else if (o instanceof byte[]) {
                  if (element instanceof Number) {
                      byte v = ((Number)element).byteValue();
                      final byte[] ary = (byte[])o;
                      for (int j = 0; j < ary.length; j++)
      Severity: Major
      Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java and 3 other locations - About 1 hr to fix
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 204..212
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 196..204
      zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java on lines 188..196

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 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

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

                              if (ZKBIND1_ANNO.equals(nm) || ZKBIND2_ANNO.equals(nm) || BIND_ANNO.equals(nm)
                                      || LOAD_ANNO.equals(nm) || SAVE_ANNO.equals(nm) || VALIDATOR_ANNO.equals(nm)
                                      || CONVERTER_ANNO.equals(nm) || ID_ANNO.equals(nm) || INIT_ANNO.equals(nm)) {
      zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 95..97

      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

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

              for (Map.Entry<K, V> me : getCache().entrySet()) {
                  V value = me.getValue();
                  if (value instanceof FormProxyObject) {
                      FormProxyObject proxyValue = (FormProxyObject) value;
                      proxyValue.submitToOrigin(ctx);
      zkbind/src/main/java/org/zkoss/bind/proxy/MapProxy.java on lines 98..107

      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

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

                  if (codepoint > (ESCAPE_LEVELS_LEN - 2) && level < ESCAPE_LEVELS[ESCAPE_LEVELS_LEN - 1] &&
                          codepoint != '\u2028' && codepoint != '\u2029') {
      
                      if (Character.charCount(codepoint) > 1) {
                          // This is to compensate that we are actually escaping two char[] positions with a single codepoint.
      zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java on lines 269..279

      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

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

          public void setMaxpos(double maxpos) throws WrongValueException {
              if (maxpos <= 0)
                  throw new WrongValueException("Nonpositive is not allowed: " + maxpos);
      
              if (Double.compare(_maxpos, maxpos) != 0) {
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/Slider.java and 1 other location - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/Slider.java on lines 199..209

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

          public class AgeLimitIndicator implements Converter {
      
              public Object coerceToUi(Object val, Component component, BindContext ctx) {
      
                  Number limit = (Number)ctx.getConverterArg("limit");
      zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va05.java on lines 57..71

      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

      Severity
      Category
      Status
      Source
      Language